1 /* 2 * Copyright (c) 2021 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 #ifndef FOUNDATION_APPEXECFWK_SERVICES_APPMGR_INCLUDE_AMS_MGR_REMOTE_CLIENT_MANAGER_H 17 #define FOUNDATION_APPEXECFWK_SERVICES_APPMGR_INCLUDE_AMS_MGR_REMOTE_CLIENT_MANAGER_H 18 19 #include "iremote_object.h" 20 #include "refbase.h" 21 22 #include "app_spawn_client.h" 23 #include "bundlemgr/bundle_mgr_interface.h" 24 25 namespace OHOS { 26 namespace AppExecFwk { 27 class RemoteClientManager { 28 public: 29 RemoteClientManager(); 30 virtual ~RemoteClientManager(); 31 32 /** 33 * GetSpawnClient, Get spawn client. 34 * 35 * @return the spawn client instance. 36 */ 37 std::shared_ptr<AppSpawnClient> GetSpawnClient(); 38 39 /** 40 * @brief Setting spawn client instance. 41 * 42 * @param appSpawnClient, the spawn client instance. 43 */ 44 void SetSpawnClient(const std::shared_ptr<AppSpawnClient> &appSpawnClient); 45 46 /** 47 * GetBundleManager, Get bundle management services. 48 * 49 * @return the bundle management services instance. 50 */ 51 sptr<IBundleMgr> GetBundleManager(); 52 53 /** 54 * @brief Setting bundle management instance. 55 * 56 * @param appSpawnClient, the bundle management instance. 57 */ 58 void SetBundleManager(sptr<IBundleMgr> bundleManager); 59 60 private: 61 std::shared_ptr<AppSpawnClient> appSpawnClient_; 62 sptr<IBundleMgr> bundleManager_; 63 }; 64 } // namespace AppExecFwk 65 } // namespace OHOS 66 67 #endif // FOUNDATION_APPEXECFWK_SERVICES_APPMGR_INCLUDE_AMS_MGR_REMOTE_CLIENT_MANAGER_H