# Copyright (c) 2022-2024 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

#

#     http://www.apache.org/licenses/LICENSE-2.0

#

# 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

# limitations under the License.



domain: ACCESS_TOKEN



ACCESSTOKEN_SERVICE_START:

  __BASE: {type: STATISTIC, level: CRITICAL, tag: usability, desc: service startup}

  PID: {type: INT32, desc: access token service pid}

  HAP_SIZE: {type: UINT32, desc: hap token size}

  NATIVE_SIZE: {type: UINT32, desc: native token size}

  PERM_DEFINITION_SIZE: {type: UINT32, desc: permission definition size}

  DLP_PERMISSION_SIZE: {type: UINT32, desc: dlp permission size}

  PARSE_CONFIG_FLAG: {type: UINT32, desc: parse config policy file value flag}



ACCESSTOKEN_SERVICE_START_ERROR:

  __BASE: {type: FAULT, level: CRITICAL, desc: service startup error}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  ERROR_MSG: {type: STRING, desc: error reason}



PERMISSION_VERIFY_REPORT:

  __BASE: {type: SECURITY, level: CRITICAL, desc: permission verification error}

  CODE: {type: INT32, desc: error code}

  CALLER_TOKENID: {type: UINT32, desc: caller token id}

  PERMISSION_NAME: {type: STRING, desc: permission name}

  INTERFACE: {type: STRING, desc: interface information}



PERMISSION_CHECK:

  __BASE: {type: FAULT, level: CRITICAL, desc: permission check error}

  CODE: {type: INT32, desc: error code}

  CALLER_TOKENID: {type: UINT32, desc: caller token id}

  PERMISSION_NAME: {type: STRING, desc: permission name}

  ERROR_REASON: {type: STRING, desc: error reason}



PERMISSION_CHECK_EVENT:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: permission check event}

  CODE: {type: INT32, desc: event code}

  CALLER_TOKENID: {type: UINT32, desc: caller token id}

  PERMISSION_NAME: {type: STRING, desc: permission name}

  FLAG: {type: INT32, desc: permission flag}

  PERMISSION_GRANT_TYPE: {type: INT32, desc: grant type}

  PID_INFO: {type: INT32, desc: access token service pid}

  REASON: {type: STRING, desc: check report reason}



PERMISSION_SYNC:

  __BASE: {type: FAULT, level: CRITICAL, tag: usability, desc: permission sync error}

  CODE: {type: INT32, desc: error code}

  REMOTE_ID: {type: STRING, desc: remote id}

  REASON: {type: STRING, desc: error reason}



ADD_HAP:

  __BASE: {type: STATISTIC, level: MINOR, tag: usability, desc: add a hap to device}

  SCENE_CODE: {type: INT32, desc: scene code}

  TOKENID: {type: UINT32, desc: token id}

  ORI_TOKENID: {type: UINT32, desc: original token id}

  TOKENIDEX: {type: UINT64, desc: token id ex}

  USERID: {type: INT32, desc: user id}

  BUNDLENAME: {type: STRING, desc: bundle name}

  INSTINDEX: {type: INT32, desc: inst index}

  DLP_TYPE: {type: UINT32, desc: dlp type}

  IS_RESTORE: {type: BOOL, desc: is restore scene}

  PERM_INFO: {type: STRING, desc: request permission list}

  ACL_INFO: {type: STRING, desc: acl permission list}

  PREAUTH_INFO: {type: STRING, desc: preauth permission list}

  EXTEND_INFO: {type: STRING, desc: extend permission map}

  DURATION: {type: UINT64, desc: time required for installing an application}

  ERROR_CODE: {type: INT32, desc: error code}



DEL_HAP:

  __BASE: {type: STATISTIC, level: MINOR, tag: usability, desc: delete a hap from device}

  TOKENID: {type: UINT32, desc: tokenID}

  USERID: {type: INT32, desc: user id}

  BUNDLENAME: {type: STRING, desc: bundle name}

  INSTINDEX: {type: INT32, desc: inst index}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  DURATION: {type: INT64, desc: duration}



PERM_DIALOG_STATUS_INFO:

  __BASE: {type: STATISTIC, level: MINOR, desc: status information of permission dialog}

  USERID: {type: INT32, desc: user id}

  PERMISSION_NAME: {type: STRING, desc: permission name}

  TOGGLE_STATUS: {type: UINT32, desc: toggle status of permission dialog}



GRANT_TEMP_PERMISSION:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: grant temp permission}

  TOKENID: {type: UINT32, desc: tokenID}

  BUNDLENAME: {type: STRING, desc: bundle name}

  PERMISSION_NAME: {type: STRING, desc: permission name}



UPDATE_PERMISSION:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: grant or revoke permission}

  TOKENID: {type: UINT32, desc: tokenID}

  PERMISSION_NAME: {type: STRING, desc: permission name}

  PERMISSION_FLAG: {type: UINT32, desc: permission flag}

  GRANTED_FLAG: {type: BOOL, desc: grant or revoke}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  USERID: {type: INT32, desc: user id}

  BUNDLENAME: {type: STRING, desc: bundle name}

  INSTINDEX: {type: INT32, desc: inst index}



UPDATE_HAP:

  __BASE: {type: STATISTIC, level: MINOR, tag: usability, desc: update hap to device}

  TOKENID: {type: UINT32, desc: token id}

  USERID: {type: INT32, desc: user id}

  BUNDLENAME: {type: STRING, desc: bundle name}

  INSTINDEX: {type: INT32, desc: inst index}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  TOKENIDEX: {type: UINT64, desc: tokenIDEx}

  PERM_INFO: {type: STRING, desc: perm info}

  ACL_INFO: {type: STRING, desc: acl info}

  PREAUTH_INFO: {type: STRING, desc: pre-auth info}

  EXTEND_INFO: {type: STRING, desc: extend info}

  DURATION: {type: INT64, desc: duration}



CLEAR_USER_PERMISSION_STATE:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: clear user permission state}

  TOKENID: {type: UINT32, desc: tokenid to be cleared}

  TOKENID_LEN: {type: UINT32, desc: amount of realated sandbox app accesstoken}



SET_PERMISSION_DIALOG_CAP:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: set permission dialog capability}

  TOKENID: {type: UINT32, desc: token id}

  USERID: {type: INT32, desc: user id}

  BUNDLENAME: {type: STRING, desc: bundle name}

  INSTINDEX: {type: INT32, desc: inst index}

  ENABLE: {type: BOOL, desc: enable or disable}



REQUEST_PERMISSIONS_FROM_USER:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: request permissions from user}

  BUNDLENAME: {type: STRING, desc: bundle name}

  UIEXTENSION_FLAG: {type: BOOL, desc: uiextension flag}

  SCENE_CODE: {type: INT32, desc: scene code}

  TOKENID: {type: UINT32, desc: tokenID}

  EXTRA_INFO: {type: STRING, desc: extra info}



REQ_PERM_FROM_USER_ERROR:

  __BASE: {type: FAULT, level: CRITICAL, desc: failed to request permission from user}

  ERROR_CODE: {type: INT32, desc: error code}

  SELF_TOKENID: {type: UINT32, desc: self tokenID}

  CONTEXT_TOKENID: {type: UINT32, desc: context tokenID}

  INNER_CODE: {type: INT32, desc: inner code}

  BUNDLENAME: {type: STRING, desc: bundle name}

  SCENE_CODE: {type: INT32, desc: scene code}



UPDATE_PERMISSION_STATUS_ERROR:

  __BASE: {type: FAULT, level: CRITICAL, desc: failed to grant or revoke permission}

  ERROR_CODE: {type: INT32, desc: error code}

  TOKENID: {type: UINT32, desc: tokenID}

  PERM: {type: STRING, desc: permission name}

  BUNDLE_NAME: {type: STRING, desc: bundle name}

  INT_VAL1: {type: INT32, desc: hap dlp type/return value}

  INT_VAL2: {type: INT32, desc: permission dlp mode/update permission flag}

  NEED_KILL: {type: BOOL, desc: need kill hap}



VERIFY_ACCESS_TOKEN_EVENT:

  __BASE: {type: STATISTIC, level: CRITICAL, desc: verify access token event}

  EVENT_CODE: {type: INT32, desc: event code}

  SELF_TOKENID: {type: UINT32, desc: self tokenID}

  CONTEXT_TOKENID: {type: UINT32, desc: context tokenID}



ACCESSTOKEN_EXCEPTION:

  __BASE: {type: FAULT, level: CRITICAL, desc: accesstoken exception}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  ERROR_MSG: {type: STRING, desc: error reason}



DATABASE_EXCEPTION:

  __BASE: {type: FAULT, level: CRITICAL, desc: database exception}

  SCENE_CODE: {type: INT32, desc: scene code}

  ERROR_CODE: {type: INT32, desc: error code}

  TABLE_NAME: {type: STRING, desc: table name}