1 /* 2 * Copyright (c) 2023 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 INTERFACES_INNER_API_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PROXY_H 17 #define INTERFACES_INNER_API_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PROXY_H 18 #include "enterprise_device_mgr_proxy.h" 19 20 namespace OHOS { 21 namespace EDM { 22 class ApplicationManagerProxy { 23 public: 24 static std::shared_ptr<ApplicationManagerProxy> GetApplicationManagerProxy(); 25 int32_t AddDisallowedRunningBundles(AppExecFwk::ElementName &admin, std::vector<std::string> &bundles, 26 int32_t userId, bool isSync = false); 27 int32_t RemoveDisallowedRunningBundles(AppExecFwk::ElementName &admin, std::vector<std::string> &bundles, 28 int32_t userId, bool isSync = false); 29 int32_t GetDisallowedRunningBundles(AppExecFwk::ElementName &admin, int32_t userId, 30 std::vector<std::string> &bundles, bool isSync = false); 31 int32_t AddOrRemoveAutoStartApps(MessageParcel &data, bool isAdd); 32 int32_t GetAutoStartApps(MessageParcel &data, std::vector<AppExecFwk::ElementName> &autoStartApps); 33 int32_t AddKeepAliveApps(const AppExecFwk::ElementName &admin, const std::vector<std::string> &keepAliveApps, 34 int32_t userId, std::string &retMessage); 35 int32_t RemoveKeepAliveApps(const AppExecFwk::ElementName &admin, const std::vector<std::string> &keepAliveApps, 36 int32_t userId); 37 int32_t GetKeepAliveApps(const AppExecFwk::ElementName &admin, std::vector<std::string> &keepAliveApps, 38 int32_t userId); 39 private: 40 static std::shared_ptr<ApplicationManagerProxy> instance_; 41 static std::once_flag flag_; 42 }; 43 } // namespace EDM 44 } // namespace OHOS 45 #endif // INTERFACES_INNER_API_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PROXY_H 46