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 SYS_INSTALLER_MODULE_CONSTANTS_H 17 #define SYS_INSTALLER_MODULE_CONSTANTS_H 18 19 namespace OHOS { 20 namespace SysInstaller { 21 static constexpr int32_t APP_SERIAL_NUMBER = -1; 22 static constexpr int32_t REGISTER_LEVEL_ONE = 1; 23 static constexpr int32_t REGISTER_LEVEL_TWO = 2; 24 static constexpr const char *UPDATE_INSTALL_DIR = "/data/module_update_package"; 25 static constexpr const char *UPDATE_ACTIVE_DIR = "/data/module_update/active"; 26 static constexpr const char *UPDATE_BACKUP_DIR = "/data/module_update/backup"; 27 static constexpr const char *MODULE_PREINSTALL_DIR = "/system/module_update"; 28 static constexpr const char *MODULE_ROOT_DIR = "/module_update"; 29 static constexpr const char *HMP_PACKAGE_SUFFIX = ".zip"; 30 static constexpr const char *MODULE_PACKAGE_SUFFIX = ".zip"; 31 static constexpr const char *MODULE_IMAGE_SUFFIX = ".img"; 32 static constexpr const char *HMP_INFO_NAME = "module_info.zip"; 33 static constexpr const char *IMG_FILE_NAME = "module.img"; 34 static constexpr const char *IMG_DIFF_FILE_NAME = "module.diff"; 35 static constexpr const char *PACK_INFO_NAME = "pack.info"; 36 static constexpr const char *MODULE_RESULT_PATH = "/data/updater/module_update_result"; 37 static constexpr const char *MODULE_UPDATE_LOG_FILE = "/data/updater/log/module_update.log"; 38 static constexpr const char *MODULE_UPDATE_PARAMS_FILE = "/data/updater/module_update_params"; 39 static constexpr const char *SA_ABNORMAL = "true"; 40 static constexpr const char *SA_NORMAL = "false"; 41 static constexpr const char *SA_START = "persist.samgr.moduleupdate.start"; 42 static constexpr const char *SA_START_PREFIX = "persist.samgr.moduleupdate"; 43 static constexpr const char *UNLOAD = "unload"; 44 static constexpr const char *LOAD_FAIL = "loadfail"; 45 static constexpr const char *CRASH = "crash"; 46 static constexpr const char *BMS_START_INSTALL = "persist.moduleupdate.bms.scan"; 47 static constexpr const char *BMS_RESULT_PREFIX = "persist.moduleupdate.bms.install"; 48 static constexpr const char *BMS_UPDATE = "update"; 49 static constexpr const char *BMS_REVERT = "revert"; 50 static constexpr const char *NOTIFY_BMS_REVERT = "revert_bms"; 51 static constexpr const char *BMS_INSTALL_FAIL = "false"; 52 static constexpr const char *HMP_INCR_PACKAGE_TYPE = "increment"; 53 static constexpr const char *HVB_PARTITION_NAME = "module_update"; 54 } // namespace SysInstaller 55 } // namespace OHOS 56 #endif // SYS_INSTALLER_MODULE_CONSTANTS_H