1 /* 2 * Copyright (c) 2025 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 ACCESSTOKEN_HISYSEVENT_COMMON_H 17 #define ACCESSTOKEN_HISYSEVENT_COMMON_H 18 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 typedef enum SceneCode { 25 SA_PUBLISH_FAILED, 26 EVENTRUNNER_CREATE_ERROR, 27 INIT_HAP_TOKENINFO_ERROR, 28 INIT_NATIVE_TOKENINFO_ERROR, 29 INIT_PERM_DEF_JSON_ERROR, 30 TOKENID_NOT_EQUAL, 31 } SceneCode; 32 33 typedef enum UpdatePermStatusErrorCode { 34 GRANT_TEMP_PERMISSION_FAILED = 0, 35 DLP_CHECK_FAILED = 1, 36 UPDATE_PERMISSION_STATUS_FAILED = 2, 37 } UpdatePermStatusErrorCode; 38 39 typedef enum CommonSceneCode { 40 AT_COMMON_START = 0, 41 AT_COMMON_FINISH = 1, 42 } CommonSceneCode; 43 44 typedef enum AddHapSceneCode { 45 INSTALL_START = 0, 46 TOKEN_ID_CHANGE, 47 INIT, 48 MAP, 49 INSTALL_FINISH, 50 } AddHapSceneCode; 51 52 typedef enum AccessTokenDbSceneCode { 53 AT_DB_INSERT_RESTORE = 1001, 54 AT_DB_DELETE_RESTORE = 1002, 55 AT_DB_UPDATE_RESTORE = 1003, 56 AT_DB_QUERY_RESTORE = 1004, 57 AT_DB_COMMIT_RESTORE = 1005, 58 } AccessTokenDbSceneCode; 59 60 typedef enum AccessTokenExceptionSceneCode { 61 // 0~0xFFF reserved for ipc code of access token manager 62 63 // 0x1000~0x1FFF reserved for native token 64 NATIVE_TOKEN_INIT = 0x1000, 65 CHECK_PROCESS_INFO, 66 ADD_NODE, 67 UPDATE_NODE 68 } AccessTokenExceptionSceneCode; 69 70 typedef enum AccessTokenExceptionErrorCode { 71 // 0~1 reserved for ATRET_SUCCESS and ATRET_FAILED 72 LOCK_FILE_FAILED = 2, 73 MALLOC_FAILED, 74 GET_FILE_BUFF_FAILED, 75 GET_TOKEN_LIST_FAILED, 76 CLEAR_CREATE_FILE_FAILED, 77 PROCESS_NAME_INVALID, 78 DCAPS_INVALID, 79 PERMS_INVALID, 80 ACLS_INVALID, 81 ACL_GREATER_THAN_PERMS, 82 APL_INVALID, 83 CREATE_NATIVETOKEN_ID_FAILED, 84 STRCPY_FAILED, 85 CREATE_ARRAY_FAILED, 86 SAVE_CONTENT_TO_CFG_FAILED, 87 } AccessTokenExceptionErrorCode; 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 #endif // ACCESSTOKEN_HISYSEVENT_COMMON_H 94