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 FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_OVERLAY_MANAGER_CHECKER_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_OVERLAY_MANAGER_CHECKER_H
18 
19 #include "appexecfwk_errors.h"
20 #include "inner_bundle_info.h"
21 #include "bundle_mgr_service.h"
22 #include "singleton.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 class BundleOverlayManager : public DelayedSingleton<BundleOverlayManager> {
27 public:
28     bool IsExistedNonOverlayHap(const std::string &bundleName);
29 
30     bool GetInnerBundleInfo(const std::string &bundleName, InnerBundleInfo &info);
31 
32     ErrCode GetAllOverlayModuleInfo(const std::string &bundleName, std::vector<OverlayModuleInfo> &overlayModuleInfo,
33         int32_t userId);
34 
35     ErrCode GetOverlayModuleInfo(const std::string &bundleName, const std::string &moduleName,
36         OverlayModuleInfo &overlayModuleInfo, int32_t userId);
37 
38     ErrCode GetOverlayBundleInfoForTarget(const std::string &targetBundleName,
39         std::vector<OverlayBundleInfo> &overlayBundleInfo, int32_t userId);
40 
41     ErrCode GetOverlayModuleInfoForTarget(const std::string &targetBundleName, const std::string &targetModuleName,
42         std::vector<OverlayModuleInfo> &overlayModuleInfo, int32_t userId);
43 
44     ErrCode SetOverlayEnabled(const std::string &bundleName, const std::string &moduleName, bool isEnabled,
45         int32_t userId);
46 };
47 } // AppExecFwk
48 } // OHOS
49 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_OVERLAY_MANAGER_CHECKER_H