diff --git a/interfaces/innerkits/nativetoken/include/nativetoken.h b/interfaces/innerkits/nativetoken/include/nativetoken.h index d256589538076de295231ed900d9fa5403b88064..66b7e63aebf4d904fabab761bc65569e4401bae1 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -9,7 +9,7 @@ * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and + * See the License for the specific language governing ACCESSTOKENs and * limitations under the License. */ @@ -32,23 +32,23 @@ extern "C" { #endif -#define MAX_PROCESS_NAME_LEN 256 +const int MAX_PROCESS_NAME_LEN = 256; #define TOKEN_ID_CFG_FILE_PATH "/data/service/el0/access_token/nativetoken.json" #define TOKEN_ID_CFG_DIR_PATH "/data/service/el0/access_token" -#define TOKEN_NATIVE_TYPE 1 -#define DEFAULT_AT_VERSION 1 +const int TOKEN_NATIVE_TYPE = 1; +const int DEFAULT_AT_VERSION = 1; #define TRANSFER_KEY_WORDS "NativeTokenInfo" -#define MAX_JSON_FILE_LEN 102400 -#define MAX_DCAPS_NUM 32 -#define MAX_DCAP_LEN 1024 -#define MAX_PARAMTER_LEN 128 +const int MAX_JSON_FILE_LEN = 102400; +const int MAX_DCAPS_NUM = 32; +const int MAX_DCAP_LEN = 1024; +const int MAX_PARAMTER_LEN = 128; #define SYSTEM_PROP_NATIVE_RECEPTOR "rw.nativetoken.receptor.startup" -#define PATH_MAX_LEN 4096 -#define MAX_RETRY_TIMES 1000 +const int PATH_MAX_LEN = 4096; +const int MAX_RETRY_TIMES = 1000; #define TOKEN_RANDOM_MASK ((1 << 20) - 1) -#define ATRET_FAILED 1 -#define ATRET_SUCCESS 0 +const int ATRET_FAILED = 1; +const int ATRET_SUCCESS = 0; #define DCAPS_KEY_NAME "dcaps" #define TOKENID_KEY_NAME "tokenId" @@ -57,11 +57,11 @@ extern "C" { #define VERSION_KEY_NAME "version" #define PROCESS_KEY_NAME "processName" -#define SYSTEM_CORE 3 -#define SYSTEM_BASIC 2 -#define NORMAL 1 +const int SYSTEM_CORE = 3; +const int SYSTEM_BASIC = 2; +const int NORMAL = 1; -#define INVALID_TOKEN_ID 0 +const int INVALID_TOKEN_ID = 0; typedef unsigned int NativeAtId; typedef unsigned int NativeAtAttr;