• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
19 #include "clear_up_application_data_param.h"
20 #include "enterprise_device_mgr_proxy.h"
21 
22 namespace OHOS {
23 namespace EDM {
24 class ApplicationManagerProxy {
25 public:
26     static std::shared_ptr<ApplicationManagerProxy> GetApplicationManagerProxy();
27     int32_t AddDisallowedRunningBundles(AppExecFwk::ElementName &admin, std::vector<std::string> &bundles,
28         int32_t userId, bool isSync = false);
29     int32_t RemoveDisallowedRunningBundles(AppExecFwk::ElementName &admin, std::vector<std::string> &bundles,
30         int32_t userId, bool isSync = false);
31     int32_t GetDisallowedRunningBundles(AppExecFwk::ElementName &admin, int32_t userId,
32         std::vector<std::string> &bundles, bool isSync = false);
33     int32_t AddOrRemoveAutoStartApps(MessageParcel &data, bool isAdd);
34     int32_t GetAutoStartApps(MessageParcel &data, std::vector<AppExecFwk::ElementName> &autoStartApps);
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     int32_t SetKioskFeatures(MessageParcel &data);
40     int32_t SetAllowedKioskApps(const AppExecFwk::ElementName &admin, const std::vector<std::string> &appIdentifiers);
41     int32_t GetAllowedKioskApps(const AppExecFwk::ElementName &admin, std::vector<std::string> &appIdentifiers);
42     int32_t IsAppKioskAllowed(const std::string &appIdentifier, bool &isAllowed);
43     int32_t ClearUpApplicationData(const AppExecFwk::ElementName &admin, const ClearUpApplicationDataParam &param);
44     int32_t AddKeepAliveApps(const AppExecFwk::ElementName &admin, const std::vector<std::string> &keepAliveApps,
45         bool disallowModify, int32_t userId, std::string &retMessage);
46     int32_t IsModifyKeepAliveAppsDisallowed(const AppExecFwk::ElementName &admin, std::string &keepAliveApp,
47         int32_t userId, bool &disallowModify);
48     int32_t IsModifyAutoStartAppsDisallowed(MessageParcel &data, bool &isDisallowModify);
49 private:
50     static std::shared_ptr<ApplicationManagerProxy> instance_;
51     static std::once_flag flag_;
52 };
53 } // namespace EDM
54 } // namespace OHOS
55 #endif // INTERFACES_INNER_API_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PROXY_H
56