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



#####################################################

#     below is the format of defining event         #

#####################################################

#domain: domain name.  [Only one domain name can be defined at the top]

#

#author: the author name who defined this event.

#date: the date when this event was defined, format is YYYY-MM-DD.

#logged: source file which refer to this event.

#usage: the usage of this event.

#//Define event name and event properties.

#@EVENT_NAME: the event definition part begin.

#  // __BASE is used for defining the basic info of the event.

#  // "type" optional values are: FAULT, STATISTICS, SECURITY, BEHAVIOR.

#  // "level" optional values are: CRITICAL, MINOR.

#  // "tag" set tags with may used by subscriber of this event, multiple tags divided by space.

#  // "desc" full description of this event.

#  @PARAMETER: {type: parameter type, arrsize: array length(optional), desc: parameter description}.

#  // follow the __BASE block, each line defines a parameter of this event.

#  // "type" optional values are: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING.

#  // "arrsize" of the parameter is an array, set a non-zero value.

#  // "desc" full description of this parameter.



#####################################################

#   Example of some hiviewdfx events definition     #

#####################################################



domain: WINDOWMANAGER



NO_FOCUS_WINDOW:

  __BASE: {type: FAULT, level: CRITICAL, desc: The event is not consumed}

  PID: {type: INT32, desc: session pid}

  UID: {type: INT32, desc: session uid}

  PACKAGE_NAME: {type: STRING, desc: package name}

  PROCESS_NAME: {type: STRING, desc: process name}

  MSG: {type: STRING, desc: windowmanager event message}



WINDOW_ANIMATION_ABNORMAL:

  __BASE: {type: FAULT, level: MINOR, desc: animationCallback is more than animation task}

  PID: {type: INT32, desc: app pid}

  UID: {type: INT32, desc: app uid}

  PACKAGE_NAME: {type: STRING, desc: ability name}

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

  MSG: {type: STRING, desc: windowmanager event message}



ANIMATION_CALLBACK_TIMEOUT:

  __BASE: {type: FAULT, level: MINOR, desc: animationCallback is time out}

  PID: {type: INT32, desc: app pid}

  UID: {type: INT32, desc: app uid}

  PACKAGE_NAME: {type: STRING, desc: ability name}

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

  MSG: {type: STRING, desc: windowmanager event message}



WINDOW_LIFE_CYCLE_EXCEPTION:

  __BASE: {type: FAULT, level: CRITICAL, desc: The window life cycle is abnormal}

  PID: {type: INT32, desc: session pid}

  UID: {type: INT32, desc: session uid}

  MSG: {type: STRING, desc: windowmanager event message}



WINDOW_STATE_ERROR:

  __BASE: {type: FAULT, level: CRITICAL, desc: The window attach state and session state mismatch}

  TYPE: {type: STRING, desc: error type}

  PID: {type: INT32, desc: app pid}

  PERSISTENT_ID: {type: INT32, desc: window id}

  FRAME_NODE_ID: {type: INT32, desc: error frame node id}

  RS_NODE_ID: {type: INT32, desc: error rs node id}

  DISPLAY_ID: {type: INT32, desc: display id}

  WINDOW_NAME: {type: STRING, desc: window name}

  ATTACH_STATE: {type: BOOL, desc: attach_state}

  SESSION_STATE: {type: UINT32, desc: session_state}



WINDOW_BOOT_ANIMATION_DONE:

  __BASE: {type: BEHAVIOR, level: CRITICAL, desc: Boot animation done}

  MSG: {type: STRING, desc: windowmanager event message}



WINDOW_EXCEPTION_DETECTION:

  __BASE: {type: FAULT, level: MINOR, desc: The event is window change begin}

  DETECTION_TYPE: {type: INT32, desc: detection type}

  PID: {type: INT32, desc: pid}

  MSG: {type: STRING, desc: detects abnormal information}



UIEXTENSION_EXCEPTION:

  __BASE: {type: FAULT, level: CRITICAL, desc: UIExtension encountered an exception}

  EXCEPTION_TYPE: {type: INT32, desc: exception type}

  PID: {type: INT32, desc: pid}

  PERSISTENTID: {type: INT32, desc: persistentId}

  MSG: {type: STRING, desc: uiextension abnormal information}



EVENT_DISPATCH_EXCEPTION:

  __BASE: {type: FAULT, level: CRITICAL, desc: Event dispatch encountered an exception}

  EXCEPTION_TYPE: {type: INT32, desc: exception type}

  PID: {type: INT32, desc: pid}

  MSG: {type: STRING, desc: event dispatch abnormal information}



SHOW_WINDOW_TIME:

  __BASE: {type: STATISTIC, level: MINOR, desc: Sow window time performance}

  MSG: {type: STRING, desc: windowmanager event message}



GET_SNAPSHOT_TIME:
  __BASE: {type: STATISTIC, level: MINOR, desc: Get snapshot time performance}
  MSG: {type: STRING, desc: windowmanager event message}

PRIVACY_WINDOW_SNAPSHOT_FAIL:
  __BASE: {type: FAULT, level: MINOR, desc: Privacy window snapshot failed}
  BUNDLE_NAME: {type: STRING, desc: bundle name}
  ABILITY_NAME: {type: STRING, desc: ability name}
  WINDOW_ID: {type: INT32, desc: window id}
  WINDOW_TYPE: {type: INT32, desc: window type}
  WINDOW_MODE: {type: INT32, desc: window mode}
  POS_X: {type: INT32, desc: window x position}
  POS_Y: {type: INT32, desc: window y position}
  WIDTH: {type: INT32, desc: window width}
  HEIGHT: {type: INT32, desc: window height}
  ERROR_CODE: {type: INT32, desc: error code}
  ERROR_MSG: {type: STRING, desc: error message}

WM_REPORT_BACK_KEYEVENT:
  __BASE: {type: STATISTIC, level: MINOR, desc: The back button is triggered}
  MSG: {type: STRING, desc: windowmanager event message}


WM_REPORT_WINDOW_OPACITY_ZERO:

  __BASE: {type: STATISTIC, level: MINOR, desc: The window background is transparent}

  MSG: {type: STRING, desc: windowmanager event message}



WM_REPORT_WINDOW_CREATE:

  __BASE: {type: STATISTIC, level: MINOR, desc: The window is created}

  MSG: {type: STRING, desc: windowmanager event message}



WM_REPORT_WINDOW_SHOW:

  __BASE: {type: STATISTIC, level: MINOR, desc: The window is shown}

  MSG: {type: STRING, desc: windowmanager event message}



WM_REPORT_WINDOW_HIDE:

  __BASE: {type: STATISTIC, level: MINOR, desc: The window is hidden}

  MSG: {type: STRING, desc: windowmanager event message}



WM_REPORT_WINDOW_DESTORY:

  __BASE: {type: STATISTIC, level: MINOR, desc: The window is destroied}

  MSG: {type: STRING, desc: windowmanager event message}



WM_REPORT_HIDE_NAVIGATIONBAR:

  __BASE: {type: STATISTIC, level: MINOR, desc: The navigation bar is hidden}

  MSG: {type: STRING, desc: windowmanager event message}



FOCUS_WINDOW:

  __BASE: {type: BEHAVIOR, level: MINOR, tag: PowerStats, desc: Window focus changed}

  PID: {type: INT32, desc: app pid}

  UID: {type: INT32, desc: app uid}

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

  WINDOW_TYPE: {type: UINT32, desc: window type}



WINDOW_STATUS_CHANGE:

  __BASE: {type: BEHAVIOR, level: MINOR, tag: PowerStats, desc: Window status changed}

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

  WINDOW_MODE: {type: STRING, desc: window mode}



APPLICATION_BLOCK_INPUT:

  __BASE: {type: FAULT, level: CRITICAL, desc: The event is not consumed}

  EVENT_ID: {type: INT32, desc: eventId}

  PID: {type: INT32, desc: pid}

  BUNDLE_NAME: {type: STRING, desc: bundleName}

  PERSISTENT_ID: { type: INT32, desc: persistentId}

  MSG: {type: STRING, desc: event not consumed}



START_WINDOW:

  __BASE: {type: BEHAVIOR, level: CRITICAL, desc: The event is application startup request window}

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

  WINDOW_NAME: {type: STRING, desc: window name}



NOTIFY_FOLD_STATE_CHANGE:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: notify fold status change}

  CURRENT_FOLD_STATUS: {type: INT32, desc: current fold status}

  NEXT_FOLD_STATUS: {type: INT32, desc: next fold status}

  SENSOR_POSTURE: {type: FLOAT, desc: sensor posture status}



FOLD_STATE_CHANGE_BEGIN:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: fold status change begin}

  POWER_OFF_SCREEN: {type: INT32, desc: power off screen id}

  POWER_ON_SCREEN: {type: INT32, desc: power on screen id}



CONTAINER_START_BEGIN:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: The event is container startup begin}

  MISSION_ID: {type: INT32, desc: mission id}

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

  TIMESTAMP: {type: INT64, desc: timestamp}



EXTEND_DISPLAY_PLUG_IN_AND_OUT:

  __BASE: {type: BEHAVIOR, level: CRITICAL, desc: Records the insertion and removal events of the extended display, preserve: true}

  PLUG_IN_AND_OUT: {type: UINT32, desc: display plug in and out}

  DISPLAY_CONNECT_NUM: {type: INT32, desc: Number of connected displays}

  DISPLAY_INUSED_NUM: {type: INT32, desc: Number of inUsed displays}

  EXTENSION_DISPLAY_MODE_STATUS: {type: UINT32, desc: extension display mode status}

  MAIN_DISPLAY_ID: {type: UINT32, desc: Current main display ID}



VH_MODE:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: notify VH_MODE}

  MODE: {type: INT32, desc: VH MODE after rotation}



THROW_SLIP:

  __BASE: {type: BEHAVIOR, level: MINOR, desc: Window throw slip}

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

  START_SIDE: {type: INT32, desc: Start side of throw slip 1 B side 2 C side}

  START_WINDOW_MODE: {type: INT32, desc: Start window mode of throw slip 0 float 1 fullscreen 2 waterfall mode}

  THROW_MODE: {type: INT32, desc: Throw slip mode 0 move drag 2 button in titlebar menu 3 three fingers gesture 4 four fingers 5 five fingers}