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(const std::string &filePath); 26 virtual ~SystemBundleInstaller() override; 27 /** 28 * @brief Install system and system vendor bundles. 29 * @param appType Indicates the bundle type. 30 * @param userId Indicates the user ID. 31 * @return Returns true if this function called successfully; returns false otherwise. 32 */ 33 bool InstallSystemBundle( 34 Constants::AppType appType, int32_t userId = Constants::UNSPECIFIED_USERID); 35 /** 36 * @brief OTA Install system and system vendor bundles. 37 * @param appType Indicates the bundle type. 38 * @return Returns true if this function called successfully; returns false otherwise. 39 */ 40 bool OTAInstallSystemBundle(Constants::AppType appType); 41 /** 42 * @brief Uninstall system and system vendor bundles. 43 * @param bundleName Indicates the bundle name. 44 * @return Returns true if this function called successfully; returns false otherwise. 45 */ 46 bool UninstallSystemBundle(const std::string &bundleName); 47 /** 48 * @brief Uninstall system and system vendor bundles. 49 * @param bundleName Indicates the bundle name. 50 * @param moduleName Indicates the module name. 51 * @return Returns true if this function called successfully; returns false otherwise. 52 */ 53 bool UninstallSystemBundle(const std::string &bundleName, const std::string &modulePackage); 54 55 private: 56 const std::string filePath_; 57 58 DISALLOW_COPY_AND_MOVE(SystemBundleInstaller); 59 }; 60 } // namespace AppExecFwk 61 } // namespace OHOS 62 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_SYSTEM_BUNDLE_INSTALLER_H