• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 #include "iservice_registry.h"
18 #include "system_ability_definition.h"
19 #include "system_ability_manager_proxy.h"
20 
21 namespace OHOS {
22 
GetInstance()23 SystemAbilityManagerClient& SystemAbilityManagerClient::GetInstance()
24 {
25     static auto instance = new SystemAbilityManagerClient();
26     return *instance;
27 }
28 
GetSystemAbilityManager()29 sptr<ISystemAbilityManager> SystemAbilityManagerClient::GetSystemAbilityManager()
30 {
31     GTEST_LOG_(INFO) << "GetSystemAbilityManager: return nullptr";
32     return nullptr;
33 }
34 
GetSystemAbility(int32_t systemAbilityId)35 sptr<IRemoteObject> SystemAbilityManagerProxy::GetSystemAbility(int32_t systemAbilityId)
36 {
37     GTEST_LOG_(INFO) << "GetSystemAbility(" << systemAbilityId << "): return nullptr";
38     return nullptr;
39 }
40 
GetSystemAbility(int32_t systemAbilityId,const std::string & deviceId)41 sptr<IRemoteObject> SystemAbilityManagerProxy::GetSystemAbility(int32_t systemAbilityId,
42     const std::string& deviceId)
43 {
44     return GetSystemAbility(systemAbilityId);
45 }
46 
CheckSystemAbilityWrapper(int32_t code,MessageParcel & data)47 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbilityWrapper(int32_t code, MessageParcel& data)
48 {
49     return nullptr;
50 }
51 
CheckSystemAbility(int32_t systemAbilityId)52 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId)
53 {
54     return nullptr;
55 }
56 
CheckSystemAbility(int32_t systemAbilityId,const std::string & deviceId)57 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
58 {
59     return nullptr;
60 }
61 
CheckSystemAbility(int32_t systemAbilityId,bool & isExist)62 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, bool& isExist)
63 {
64     return nullptr;
65 }
66 
AddOnDemandSystemAbilityInfo(int32_t systemAbilityId,const std::u16string & localAbilityManagerName)67 int32_t SystemAbilityManagerProxy::AddOnDemandSystemAbilityInfo(int32_t systemAbilityId,
68     const std::u16string& localAbilityManagerName)
69 {
70     return ERR_INVALID_VALUE;
71 }
72 
RemoveSystemAbilityWrapper(int32_t code,MessageParcel & data)73 int32_t SystemAbilityManagerProxy::RemoveSystemAbilityWrapper(int32_t code, MessageParcel& data)
74 {
75     return ERR_INVALID_VALUE;
76 }
77 
RemoveSystemAbility(int32_t systemAbilityId)78 int32_t SystemAbilityManagerProxy::RemoveSystemAbility(int32_t systemAbilityId)
79 {
80     return ERR_INVALID_VALUE;
81 }
82 
ListSystemAbilities(unsigned int dumpFlags)83 std::vector<std::u16string> SystemAbilityManagerProxy::ListSystemAbilities(unsigned int dumpFlags)
84 {
85     std::vector<std::u16string> saNames;
86 
87     return saNames;
88 }
89 
SubscribeSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityStatusChange> & listener)90 int32_t SystemAbilityManagerProxy::SubscribeSystemAbility(int32_t systemAbilityId,
91     const sptr<ISystemAbilityStatusChange>& listener)
92 {
93     return ERR_INVALID_VALUE;
94 }
95 
UnSubscribeSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityStatusChange> & listener)96 int32_t SystemAbilityManagerProxy::UnSubscribeSystemAbility(int32_t systemAbilityId,
97     const sptr<ISystemAbilityStatusChange>& listener)
98 {
99     return ERR_INVALID_VALUE;
100 }
101 
LoadSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityLoadCallback> & callback)102 int32_t SystemAbilityManagerProxy::LoadSystemAbility(int32_t systemAbilityId,
103     const sptr<ISystemAbilityLoadCallback>& callback)
104 {
105     return ERR_INVALID_VALUE;
106 }
107 
LoadSystemAbility(int32_t systemAbilityId,const std::string & deviceId,const sptr<ISystemAbilityLoadCallback> & callback)108 int32_t SystemAbilityManagerProxy::LoadSystemAbility(int32_t systemAbilityId, const std::string& deviceId,
109     const sptr<ISystemAbilityLoadCallback>& callback)
110 {
111     return ERR_INVALID_VALUE;
112 }
113 
AddSystemAbility(int32_t systemAbilityId,const sptr<IRemoteObject> & ability,const SAExtraProp & extraProp)114 int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability,
115     const SAExtraProp& extraProp)
116 {
117     return ERR_INVALID_VALUE;
118 }
119 
AddSystemAbilityWrapper(int32_t code,MessageParcel & data)120 int32_t SystemAbilityManagerProxy::AddSystemAbilityWrapper(int32_t code, MessageParcel& data)
121 {
122     return ERR_INVALID_VALUE;
123 }
124 
AddSystemProcess(const std::u16string & procName,const sptr<IRemoteObject> & procObject)125 int32_t SystemAbilityManagerProxy::AddSystemProcess(
126     const std::u16string& procName, const sptr<IRemoteObject>& procObject)
127 {
128     return ERR_INVALID_VALUE;
129 }
130 }