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 #ifndef OHOS_CONTAINER_MANAGER_CLIENT_H 17 #define OHOS_CONTAINER_MANAGER_CLIENT_H 18 19 #include <mutex> 20 21 #include "icontainer_manager.h" 22 23 #include "iremote_object.h" 24 #include "system_memory_attr.h" 25 26 namespace OHOS { 27 namespace AAFwk { 28 /** 29 * @class ContainerManagerClient 30 * ContainerManagerClient is used to access container manager services. 31 */ 32 class ContainerManagerClient { 33 public: 34 ContainerManagerClient(); 35 virtual ~ContainerManagerClient(); 36 static std::shared_ptr<ContainerManagerClient> GetInstance(); 37 38 /** 39 * Notify the state of boot 40 * 41 * @param state, state of boot. 42 * @return Returns ERR_OK on success, others on failure. 43 */ 44 ErrCode NotifyBootComplete(int state); 45 private: 46 /** 47 * Connect ability manager service. 48 * 49 * @return Returns ERR_Ok on success, others on failure. 50 */ 51 ErrCode Connect(); 52 53 static std::mutex mutex_; 54 static std::shared_ptr<ContainerManagerClient> instance_; 55 sptr<IRemoteObject> remoteObject_; 56 }; 57 } // namespace AAFwk 58 } // namespace OHOS 59 #endif // OHOS_CONTAINER_MANAGER_CLIENT_H