1 /*
2  * Copyright (c) 2021-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 "app_mgr_client.h"
17 
18 #include <cstdio>
19 #include <string>
20 #include <unistd.h>
21 
22 #include "if_system_ability_manager.h"
23 #include "ipc_skeleton.h"
24 
25 #include "app_mgr_interface.h"
26 #include "app_service_manager.h"
27 
28 namespace OHOS {
29 namespace AppExecFwk {
AppMgrClient()30 AppMgrClient::AppMgrClient()
31 {}
32 
~AppMgrClient()33 AppMgrClient::~AppMgrClient()
34 {}
35 
GetRunningProcessInfoByToken(const sptr<IRemoteObject> & token,RunningProcessInfo & info)36 void AppMgrClient::GetRunningProcessInfoByToken(const sptr<IRemoteObject>& token, RunningProcessInfo& info)
37 {}
38 
GetRunningProcessInfoByPid(const pid_t pid,OHOS::AppExecFwk::RunningProcessInfo & info) const39 void AppMgrClient::GetRunningProcessInfoByPid(const pid_t pid, OHOS::AppExecFwk::RunningProcessInfo& info) const {}
40 
LoadAbility(sptr<IRemoteObject> token,sptr<IRemoteObject> preToken,const AbilityInfo & abilityInfo,const ApplicationInfo & appInfo,const AAFwk::Want & want,int32_t abilityRecordId)41 AppMgrResultCode AppMgrClient::LoadAbility(sptr<IRemoteObject> token, sptr<IRemoteObject> preToken,
42     const AbilityInfo& abilityInfo, const ApplicationInfo& appInfo, const AAFwk::Want& want,
43     int32_t abilityRecordId)
44 {
45     return AppMgrResultCode::RESULT_OK;
46 }
47 
TerminateAbility(const sptr<IRemoteObject> & token,bool clearMissionFlag)48 AppMgrResultCode AppMgrClient::TerminateAbility(const sptr<IRemoteObject>& token, bool clearMissionFlag)
49 {
50     return AppMgrResultCode::RESULT_OK;
51 }
52 
UpdateAbilityState(const sptr<IRemoteObject> & token,const AbilityState state)53 AppMgrResultCode AppMgrClient::UpdateAbilityState(const sptr<IRemoteObject>& token, const AbilityState state)
54 {
55     return AppMgrResultCode::RESULT_OK;
56 }
57 
RegisterAppStateCallback(const sptr<IAppStateCallback> & callback)58 AppMgrResultCode AppMgrClient::RegisterAppStateCallback(const sptr<IAppStateCallback>& callback)
59 {
60     return AppMgrResultCode::RESULT_OK;
61 }
62 
AbilityBehaviorAnalysis(const sptr<IRemoteObject> & token,const sptr<IRemoteObject> & preToken,const int32_t visibility,const int32_t perceptibility,const int32_t connectionState)63 AppMgrResultCode AppMgrClient::AbilityBehaviorAnalysis(const sptr<IRemoteObject>& token,
64     const sptr<IRemoteObject>& preToken, const int32_t visibility, const int32_t perceptibility,
65     const int32_t connectionState)
66 {
67     return AppMgrResultCode::RESULT_OK;
68 }
69 
KillProcessByAbilityToken(const sptr<IRemoteObject> & token)70 AppMgrResultCode AppMgrClient::KillProcessByAbilityToken(const sptr<IRemoteObject>& token)
71 {
72     return AppMgrResultCode::RESULT_OK;
73 }
74 
KillProcessesByUserId(int32_t userId)75 AppMgrResultCode AppMgrClient::KillProcessesByUserId(int32_t userId)
76 {
77     return AppMgrResultCode::RESULT_OK;
78 }
79 
KillApplication(const std::string & bundleName,const bool clearPageStack=false)80 AppMgrResultCode AppMgrClient::KillApplication(
81     const std::string& bundleName, const bool clearPageStack = false)
82 {
83     return AppMgrResultCode::RESULT_OK;
84 }
85 
ClearUpApplicationData(const std::string & bundleName,const int32_t userId)86 AppMgrResultCode AppMgrClient::ClearUpApplicationData(const std::string& bundleName, const int32_t userId)
87 {
88     return AppMgrResultCode::RESULT_OK;
89 }
90 
GetAllRunningProcesses(std::vector<RunningProcessInfo> & info)91 AppMgrResultCode AppMgrClient::GetAllRunningProcesses(std::vector<RunningProcessInfo>& info)
92 {
93     return AppMgrResultCode::RESULT_OK;
94 }
95 
GetAllRenderProcesses(std::vector<RenderProcessInfo> & info)96 AppMgrResultCode AppMgrClient::GetAllRenderProcesses(std::vector<RenderProcessInfo>& info)
97 {
98     return AppMgrResultCode::RESULT_OK;
99 }
100 
ConnectAppMgrService()101 AppMgrResultCode AppMgrClient::ConnectAppMgrService()
102 {
103     return AppMgrResultCode::RESULT_OK;
104 }
105 
106 // void AppMgrClient::SetServiceManager(std::unique_ptr<AppServiceManager> serviceMgr)
107 // {}
108 
AbilityAttachTimeOut(const sptr<IRemoteObject> & token)109 void AppMgrClient::AbilityAttachTimeOut(const sptr<IRemoteObject>& token)
110 {}
111 
PrepareTerminate(const sptr<IRemoteObject> & token,bool clearMissionFlag)112 void AppMgrClient::PrepareTerminate(const sptr<IRemoteObject>& token, bool clearMissionFlag)
113 {}
114 }  // namespace AppExecFwk
115 }  // namespace OHOS
116