• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_SYSTEM_BUNDLE_INSTALLER_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_SYSTEM_BUNDLE_INSTALLER_H
18 
19 #include "base_bundle_installer.h"
20 
21 namespace OHOS {
22 namespace AppExecFwk {
23 class SystemBundleInstaller : public BaseBundleInstaller {
24 public:
25     SystemBundleInstaller();
26     virtual ~SystemBundleInstaller() override;
27     /**
28      * @brief Install preinstall app.
29      * @param filePath Indicates the filePath.
30      * @param installParam Indicates the installParam.
31      * @param appType Indicates the bundle type.
32      * @return Returns true if this function called successfully; returns false otherwise.
33      */
34     bool InstallSystemBundle(
35         const std::string &filePath,
36         InstallParam &installParam,
37         Constants::AppType appType);
38     /**
39      * @brief OTA Install preinstall app.
40      * @param filePath Indicates the filePaths.
41      * @param installParam Indicates the installParam.
42      * @param appType Indicates the bundle type.
43      * @return Returns true if this function called successfully; returns false otherwise.
44      */
45     bool OTAInstallSystemBundle(
46         const std::vector<std::string> &filePaths,
47         InstallParam &installParam,
48         Constants::AppType appType);
49     /**
50      * @brief Uninstall preinstall app.
51      * @param bundleName Indicates the bundle name.
52      * @return Returns true if this function called successfully; returns false otherwise.
53      */
54     bool UninstallSystemBundle(const std::string &bundleName);
55     /**
56      * @brief Deleting apps while retaining user data.
57      * @param bundleName Indicates the bundle name.
58      * @param isKeepData Delete app keep app data.
59      * @return Returns true if this function called successfully; returns false otherwise.
60      */
61     bool UninstallSystemBundle(const std::string &bundleName, bool isKeepData);
62     /**
63      * @brief Uninstall preinstall app by modulePackage.
64      * @param bundleName Indicates the bundle name.
65      * @param moduleName Indicates the module name.
66      * @return Returns true if this function called successfully; returns false otherwise.
67      */
68     bool UninstallSystemBundle(const std::string &bundleName, const std::string &modulePackage);
69 
70 private:
71 
72     DISALLOW_COPY_AND_MOVE(SystemBundleInstaller);
73 };
74 }  // namespace AppExecFwk
75 }  // namespace OHOS
76 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_SYSTEM_BUNDLE_INSTALLER_H