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 OHOS_CLOUD_OAID_SERVICE_DEFINE_H 17 #define OHOS_CLOUD_OAID_SERVICE_DEFINE_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace Cloud { 23 /* The package management API define */ 24 static const int32_t OHOS_API_VERSION = 10; 25 26 /* getOAID permission define */ 27 static const std::string OAID_TRACKING_CONSENT_PERMISSION = "ohos.permission.APP_TRACKING_CONSENT"; 28 29 /* The system component ID of the OAID is 6101. */ 30 static const int32_t OAID_SYSTME_ID = 6101; 31 32 /* communication settings define */ 33 static constexpr uint32_t KVSTORE_CONNECT_RETRY_COUNT = 5; 34 static constexpr uint32_t KVSTORE_CONNECT_RETRY_DELAY_TIME = 3000; // Unit: ms 35 static const int8_t CONNECT_TIME_OUT = 3; // The connection timeout is 3s. 36 37 /* not system app error code */ 38 static const int32_t OAID_ERROR_CODE_NOT_SYSTEM_APP = 202; 39 /* not in trust list error code */ 40 static const int32_t OAID_ERROR_NOT_IN_TRUST_LIST = 17300002; 41 42 static const std::string OAID_ALLZERO_STR = "00000000-0000-0000-0000-000000000000"; 43 44 /* refresh allow get oaid */ 45 static const int32_t GET_ALLOW_OAID_CODE = 1; 46 47 /* NOTIFY OAID CHANGE */ 48 static const int32_t NOTIFY_RESET_OAID_CODE = 2; 49 50 static const int32_t NOTIFY_GET_OAID_CODE = 3; 51 52 static const int32_t DEFAULT_TIMEOUT_MS = 2000; 53 54 /* database define */ 55 static const std::string OAID_DATA_BASE_DIR = "/data/service/el1/public/database/"; 56 static const std::string OAID_DATA_BASE_APP_ID = "oaid_service_manager"; 57 static const std::string OAID_DATA_BASE_STORE_ID = "oaidservice"; 58 static const std::string OAID_UNDER_AGE_STORE_ID = "underAgeInfo"; 59 static const std::string OAID_KVSTORE_KEY = "oaid_key"; 60 static const std::string ALLOW_GET_OAID_KEY = "ALLOW_GET_OAID_KEY"; 61 static const std::string LAST_UPDATE_TIME_KEY = "ALLOW_GET_OAID_UPDATE_KEY"; 62 static const std::string OAID_TRUSTLIST_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config.json"; 63 static const std::string OAID_TRUSTLIST_EXTENSION_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config_ext.json"; 64 65 /* oaid check define */ 66 const std::string OAID_UPDATE = "/data/service/el1/public/database/oaid_service_manager/update_check.json"; 67 68 /* oaid service 按需停空闲等待时间。单位(ms) */ 69 static constexpr int32_t DELAY_TIME = 290000; 70 static const std::string TASK_ID = "unload"; 71 static const int32_t HA_UID = 7508; 72 static const int32_t EXPIRATION_TIME = 6 * 60 * 60 * 1000; 73 static const int32_t CODE_ALLOW_GET_OAID = 1; 74 } // namespace Cloud 75 } // namespace OHOS 76 #endif // OHOS_CLOUD_OAID_SERVICE_DEFINE_H