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 #ifndef OS_ACCOUNT_INTERFACES_INNERKITS_OS_ACCOUNT_CONSTANT_H 16 #define OS_ACCOUNT_INTERFACES_INNERKITS_OS_ACCOUNT_CONSTANT_H 17 18 #include <string> 19 #include "os_account_info.h" 20 21 namespace OHOS { 22 namespace AccountSA { 23 namespace Constants { 24 const std::string PATH_SEPARATOR = "/"; 25 const std::string USER_INFO_BASE = "/data/system/users"; 26 const std::string SYSTEM_ETC_BASE = "/system/etc/account"; 27 const std::string OSACCOUNT_CONSTRAINTS_JSON_PATH = SYSTEM_ETC_BASE + PATH_SEPARATOR + "osaccount_constraints.json"; 28 const std::string CONSTRAINTS_LIST_JSON_PATH = SYSTEM_ETC_BASE + PATH_SEPARATOR + "constraints_list_collection.json"; 29 const std::string ACCOUNT_LIST_FILE_JSON_PATH = USER_INFO_BASE + PATH_SEPARATOR + "account_list.json"; 30 const std::string USER_PHOTO_FILE_PNG_NAME = "fase.png"; 31 const std::string USER_PHOTO_FILE_JPG_NAME = "fase.jpg"; 32 const std::string USER_PHOTO_BASE_JPG_HEAD = "data:image/jpeg;base64,"; 33 const std::string USER_PHOTO_BASE_PNG_HEAD = "data:image/png;base64,"; 34 const std::string USER_INFO_FILE_NAME = "account_info.json"; 35 36 // distributed database 37 const std::string APP_ID = "os_account_mgr_service"; 38 const bool SYNC_OS_ACCOUNT_DATABSE = true; 39 const std::uint32_t DEVICE_UUID_LENGTH = 65; 40 41 // uid judgment 42 const std::int32_t APP_UID_START = 2100; 43 const std::int32_t MAX_SYSTEM_UID_NUM = 2899; 44 45 // subscribe 46 const int SUBSCRIBER_MAX_SIZE = 100; 47 // account restrict 48 const unsigned int LOCAL_NAME_MAX_SIZE = 1024; 49 const unsigned int LOCAL_PHOTO_MAX_SIZE = 1024 * 4; 50 51 // domain info limits 52 const unsigned int DOMAIN_NAME_MAX_SIZE = 128; 53 const unsigned int DOMAIN_ACCOUNT_NAME_MAX_SIZE = 512; 54 55 const std::int32_t ADMIN_LOCAL_ID = 0; 56 const int ADMIN_TYPE = -1; 57 const std::string ADMIN_LOCAL_NAME = "admin"; 58 const std::string STANDARD_LOCAL_NAME = "user"; 59 const std::int32_t START_USER_ID = 100; 60 const std::int32_t MAX_USER_ID = 1099; 61 const std::int32_t INVALID_OS_ACCOUNT_ID = -1; 62 const size_t MAX_USER_ID_LENGTH = 4; 63 const int64_t SERIAL_NUMBER_NUM_START_FOR_ADMIN = 20210231; 64 const int64_t SERIAL_NUMBER_NUM_START = 1; 65 const int64_t CARRY_NUM = 100000000; 66 const bool IS_SERIAL_NUMBER_FULL_INIT_VALUE = false; 67 const int64_t TIME_WAIT_TIME_OUT = 5; 68 const std::int32_t WAIT_ONE_TIME = 1000; 69 70 // type temeplate 71 const std::string USER_CONSTRATINTS_TEMPLATE = "UserConstraintsTemplate"; 72 const std::string TYPE_LIST = "TypeList"; 73 const std::string ACCOUNT_LIST = "AccountList"; 74 const std::string COUNT_ACCOUNT_NUM = "CountAccountNum"; 75 const std::string MAX_ALLOW_CREATE_ACCOUNT_ID = "MaxAllowCreateAccountID"; 76 const std::string SERIAL_NUMBER_NUM = "SerialNumber"; 77 const std::string IS_MULTI_OS_ACCOUNT_ENABLE = "IsMultiOsAccountEnable"; 78 const std::string IS_SERIAL_NUMBER_FULL = "isSerialNumberFull"; 79 const std::string CONSTANS_LITE = "constraints"; 80 const std::string IS_ALLOWED_CREATE_ADMIN = "IsAllowedCreateAdmin"; 81 82 // start type 83 const OS_ACCOUNT_SWITCH_MOD NOW_OS_ACCOUNT_SWITCH_MOD = OS_ACCOUNT_SWITCH_MOD::HOT_SWITCH; 84 }; // namespace Constants 85 } // namespace AccountSA 86 } // namespace OHOS 87 #endif // OS_ACCOUNT_INTERFACES_INNERKITS_OS_ACCOUNT_CONSTANT_H 88