1c7afe287Sopenharmony_ci/*
2c7afe287Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3c7afe287Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c7afe287Sopenharmony_ci * you may not use this file except in compliance with the License.
5c7afe287Sopenharmony_ci * You may obtain a copy of the License at
6c7afe287Sopenharmony_ci *
7c7afe287Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c7afe287Sopenharmony_ci *
9c7afe287Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c7afe287Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c7afe287Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c7afe287Sopenharmony_ci * See the License for the specific language governing permissions and
13c7afe287Sopenharmony_ci * limitations under the License.
14c7afe287Sopenharmony_ci */
15c7afe287Sopenharmony_ci
16c7afe287Sopenharmony_ci#ifndef OHOS_CLOUD_OAID_SERVICE_DEFINE_H
17c7afe287Sopenharmony_ci#define OHOS_CLOUD_OAID_SERVICE_DEFINE_H
18c7afe287Sopenharmony_ci
19c7afe287Sopenharmony_ci#include <string>
20c7afe287Sopenharmony_ci
21c7afe287Sopenharmony_cinamespace OHOS {
22c7afe287Sopenharmony_cinamespace Cloud {
23c7afe287Sopenharmony_ci/* The package management API define */
24c7afe287Sopenharmony_cistatic const int32_t OHOS_API_VERSION = 10;
25c7afe287Sopenharmony_ci
26c7afe287Sopenharmony_ci/* getOAID permission define */
27c7afe287Sopenharmony_cistatic const std::string OAID_TRACKING_CONSENT_PERMISSION = "ohos.permission.APP_TRACKING_CONSENT";
28c7afe287Sopenharmony_ci
29c7afe287Sopenharmony_ci/* The system component ID of the OAID is 6101. */
30c7afe287Sopenharmony_cistatic const int32_t OAID_SYSTME_ID = 6101;
31c7afe287Sopenharmony_ci
32c7afe287Sopenharmony_ci/* communication settings define */
33c7afe287Sopenharmony_cistatic constexpr uint32_t KVSTORE_CONNECT_RETRY_COUNT = 5;
34c7afe287Sopenharmony_cistatic constexpr uint32_t KVSTORE_CONNECT_RETRY_DELAY_TIME = 3000;  // Unit: ms
35c7afe287Sopenharmony_cistatic const int8_t CONNECT_TIME_OUT = 3;                           // The connection timeout is 3s.
36c7afe287Sopenharmony_ci
37c7afe287Sopenharmony_ci/* not system app error code */
38c7afe287Sopenharmony_cistatic const int32_t OAID_ERROR_CODE_NOT_SYSTEM_APP = 202;
39c7afe287Sopenharmony_ci/* not in trust list error code */
40c7afe287Sopenharmony_cistatic const int32_t OAID_ERROR_NOT_IN_TRUST_LIST = 17300002;
41c7afe287Sopenharmony_ci
42c7afe287Sopenharmony_cistatic const std::string OAID_ALLZERO_STR = "00000000-0000-0000-0000-000000000000";
43c7afe287Sopenharmony_ci
44c7afe287Sopenharmony_ci/* database define */
45c7afe287Sopenharmony_cistatic const std::string OAID_DATA_BASE_DIR = "/data/service/el1/public/database/";
46c7afe287Sopenharmony_cistatic const std::string OAID_DATA_BASE_APP_ID = "oaid_service_manager";
47c7afe287Sopenharmony_cistatic const std::string OAID_DATA_BASE_STORE_ID = "oaidservice";
48c7afe287Sopenharmony_cistatic const std::string OAID_KVSTORE_KEY = "oaid_key";
49c7afe287Sopenharmony_cistatic const std::string OAID_TRUSTLIST_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config.json";
50c7afe287Sopenharmony_cistatic const std::string OAID_TRUSTLIST_EXTENSION_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config_ext.json";
51c7afe287Sopenharmony_ci
52c7afe287Sopenharmony_ci/* oaid check define */
53c7afe287Sopenharmony_ciconst std::string OAID_UPDATE = "/data/service/el1/public/database/oaid_service_manager/update_check.json";
54c7afe287Sopenharmony_ci
55c7afe287Sopenharmony_ci/* oaid service 按需停空闲等待时间。单位(ms) */
56c7afe287Sopenharmony_cistatic constexpr int32_t DELAY_TIME = 290000;
57c7afe287Sopenharmony_cistatic const std::string TASK_ID = "unload";
58c7afe287Sopenharmony_cistatic const int32_t HA_UID = 7508;
59c7afe287Sopenharmony_ci}  // namespace Cloud
60c7afe287Sopenharmony_ci}  // namespace OHOS
61c7afe287Sopenharmony_ci#endif  // OHOS_CLOUD_OAID_SERVICE_DEFINE_H