• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /* database define */
45 static const std::string OAID_DATA_BASE_DIR = "/data/service/el1/public/database/";
46 static const std::string OAID_DATA_BASE_APP_ID = "oaid_service_manager";
47 static const std::string OAID_DATA_BASE_STORE_ID = "oaidservice";
48 static const std::string OAID_KVSTORE_KEY = "oaid_key";
49 static const std::string OAID_TRUSTLIST_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config.json";
50 static const std::string OAID_TRUSTLIST_EXTENSION_CONFIG_PATH = "/etc/advertising/oaid/oaid_service_config_ext.json";
51 
52 /* oaid check define */
53 const std::string OAID_UPDATE = "/data/service/el1/public/database/oaid_service_manager/update_check.json";
54 
55 /* oaid service 按需停空闲等待时间。单位(ms) */
56 static constexpr int32_t DELAY_TIME = 290000;
57 static const std::string TASK_ID = "unload";
58 static const int32_t HA_UID = 7508;
59 }  // namespace Cloud
60 }  // namespace OHOS
61 #endif  // OHOS_CLOUD_OAID_SERVICE_DEFINE_H