1/* 2 * Copyright (c) 2024 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/** 17 * @addtogroup OH_CommonEvent 18 * @{ 19 * 20 * @brief Provides the APIs of common event service. 21 * 22 * @since 12 23 */ 24/** 25 * @file oh_commonevent_support.h 26 * 27 * @brief Declares the constants of system-defined common event. 28 * 29 * @library libohcommonevent.so 30 * @kit BasicServicesKit 31 * @syscap SystemCapability.Notification.CommonEvent 32 * @since 12 33 * @version 1.0 34 */ 35 36#ifndef OH_COMMONEVENT_SUPPORT_H 37#define OH_COMMONEVENT_SUPPORT_H 38 39#include <stdint.h> 40 41#ifdef __cplusplus 42extern "C" { 43#endif 44 45/** 46 * @brief This commonEvent means when the device is shutting down, note: turn off, not sleeping. 47 * 48 * @since 12 49 */ 50static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN"; 51 52/** 53 * @brief This commonEvent means when the charging state, level and so on about the battery. 54 * 55 * @since 12 56 */ 57static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED"; 58 59/** 60 * @brief This commonEvent means when the device in low battery state. 61 * 62 * @since 12 63 */ 64static const char* const COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW"; 65 66/** 67 * @brief This commonEvent means when the battery level is an ok state. 68 * 69 * @since 12 70 */ 71static const char* const COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY"; 72 73/** 74 * @brief This commonEvent means when the other power is connected to the device. 75 * 76 * @since 12 77 */ 78static const char* const COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED"; 79 80/** 81 * @brief This commonEvent means when the other power is removed from the device. 82 * 83 * @since 12 84 */ 85static const char* const COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED"; 86 87/** 88 * @brief This commonEvent means when the screen is turned off. 89 * 90 * @since 12 91 */ 92static const char* const COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF"; 93 94/** 95 * @brief This commonEvent means when the device is awakened and interactive. 96 * 97 * @since 12 98 */ 99static const char* const COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON"; 100 101/** 102 * @brief This commonEvent means when the thermal state level change 103 * 104 * @since 12 105 */ 106static const char* const COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED"; 107 108/** 109 * @brief This commonEvent means when the current time is changed. 110 * 111 * @since 12 112 */ 113static const char* const COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK"; 114 115/** 116 * @brief This commonEvent means when the time is set. 117 * 118 * @since 12 119 */ 120static const char* const COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED"; 121 122/** 123 * @brief This commonEvent means when the time zone is changed. 124 * 125 * @since 12 126 */ 127static const char* const COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED"; 128 129/** 130 * @brief This commonEvent means when a new application package is installed on the device. 131 * 132 * @since 12 133 */ 134static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED"; 135 136/** 137 * @brief This commonEvent means when an existing application package is removed from the device. 138 * 139 * @since 12 140 */ 141static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED"; 142 143/** 144 * @brief This commonEvent means when an installed application's add-on package is removed from the device. 145 * 146 * @since 12 147 */ 148static const char* const COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED"; 149 150/** 151 * @brief This commonEvent means when an existing application package is completely removed from the device. 152 * 153 * @since 12 154 */ 155static const char* const COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED"; 156 157/** 158 * @brief This commonEvent means when an existing application package has been changed. 159 * 160 * @since 12 161 */ 162static const char* const COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED"; 163 164/** 165 * @brief This commonEvent means the user has restarted a package, and all of its processes have been killed. 166 * 167 * @since 12 168 */ 169static const char* const COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED"; 170 171/** 172 * @brief This commonEvent means the user has cleared the package data. 173 * 174 * @since 12 175 */ 176static const char* const COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED"; 177 178/** 179 * @brief This commonEvent means the user has cleared the package cache. 180 * 181 * @since 12 182 */ 183static const char* const COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED"; 184 185/** 186 * @brief This commonEvent means the packages have been suspended. 187 * 188 * @since 12 189 */ 190static const char* const COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED"; 191 192/** 193 * @brief This commonEvent Sent to a package that has been suspended by the system. 194 * 195 * @since 12 196 */ 197static const char* const COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED"; 198 199/** 200 * @brief Sent to a package that has been un-suspended. 201 * 202 * @since 12 203 */ 204static const char* const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED"; 205 206/** 207 * @brief The current device's locale has changed. 208 * 209 * @since 12 210 */ 211static const char* const COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED"; 212 213/** 214 * @brief Indicates low memory condition notification acknowledged by user and package 215 * management should be started. 216 * 217 * @since 12 218 */ 219static const char* const COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE"; 220 221/** 222 * @brief Remind new user of that the service has been unlocked. 223 * 224 * @since 12 225 */ 226static const char* const COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED"; 227 228/** 229 * @brief Distributed account logout successfully. 230 * 231 * @since 12 232 */ 233static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT"; 234 235/** 236 * @brief Distributed account is invalid. 237 * 238 * @since 12 239 */ 240static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID = 241 "common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID"; 242 243/** 244 * @brief Distributed account logs off. 245 * 246 * @since 12 247 */ 248static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF"; 249 250/** 251 * @brief WIFI state. 252 * 253 * @since 12 254 */ 255static const char* const COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE"; 256 257/** 258 * @brief WIFI scan results. 259 * 260 * @since 12 261 */ 262static const char* const COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED"; 263 264/** 265 * @brief WIFI RSSI change. 266 * 267 * @since 12 268 */ 269static const char* const COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE"; 270 271/** 272 * @brief WIFI connect state. 273 * 274 * @since 12 275 */ 276static const char* const COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE"; 277 278/** 279 * @brief WIFI hotspot state. 280 * 281 * @since 12 282 */ 283static const char* const COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE"; 284 285/** 286 * @brief WIFI ap sta join. 287 * 288 * @since 12 289 */ 290static const char* const COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN"; 291 292/** 293 * @brief WIFI ap sta join. 294 * 295 * @since 12 296 */ 297static const char* const COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE"; 298 299/** 300 * @brief Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink. 301 * 302 * @since 12 303 */ 304static const char* const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE"; 305 306/** 307 * @brief Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P. 308 * 309 * @since 12 310 */ 311static const char* const COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE"; 312 313/** 314 * @brief Indicates that the Wi-Fi P2P state change. 315 * 316 * @since 12 317 */ 318static const char* const COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE"; 319 320/** 321 * @brief Indicates that the Wi-Fi P2P peers state change. 322 * 323 * @since 12 324 */ 325static const char* const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE"; 326 327/** 328 * @brief Indicates that the Wi-Fi P2P discovery state change. 329 * 330 * @since 12 331 */ 332static const char* const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED = 333 "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE"; 334 335/** 336 * @brief Indicates that the Wi-Fi P2P current device state change. 337 * 338 * @since 12 339 */ 340static const char* const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED = 341 "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE"; 342 343/** 344 * @brief Indicates that the Wi-Fi P2P group info is changed. 345 * 346 * @since 12 347 */ 348static const char* const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = "usual.event.wifi.p2p.GROUP_STATE_CHANGED"; 349 350/** 351 * @brief Nfc state change. 352 * 353 * @since 12 354 */ 355static const char* const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED"; 356 357/** 358 * @brief Nfc field on detected. 359 * 360 * @since 12 361 */ 362static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED"; 363 364/** 365 * @brief Nfc field off detected. 366 * 367 * @since 12 368 */ 369static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED"; 370 371/** 372 * @brief Sent when stop charging battery. 373 * 374 * @since 12 375 */ 376static const char* const COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING"; 377 378/** 379 * @brief Sent when start charging battery. 380 * 381 * @since 12 382 */ 383static const char* const COMMON_EVENT_CHARGING = "usual.event.CHARGING"; 384 385/** 386 * @brief Sent when device's idle mode changed 387 * 388 * @since 12 389 */ 390static const char* const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED"; 391 392/** 393 * @brief Sent when device's charge idle mode changed. 394 * 395 * @since 12 396 */ 397static const char* const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED = "usual.event.CHARGE_IDLE_MODE_CHANGED"; 398 399/** 400 * @brief Sent when device's power save mode changed 401 * 402 * @since 12 403 */ 404static const char* const COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED"; 405 406/** 407 * @brief The usb state change events. 408 * This is a protected common event that can only be sent by system. 409 * 410 * @since 12 411 */ 412static const char* const COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE"; 413 414/** 415 * @brief The usb port changed. 416 * This is a protected common event that can only be sent by system. 417 * 418 * @since 12 419 */ 420static const char* const COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED"; 421 422/** 423 * @brief The usb device attached. 424 * This is a protected common event that can only be sent by system. 425 * 426 * @since 12 427 */ 428static const char* const COMMON_EVENT_USB_DEVICE_ATTACHED = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED"; 429 430/** 431 * @brief The usb device detached. 432 * This is a protected common event that can only be sent by system. 433 * 434 * @since 12 435 */ 436static const char* const COMMON_EVENT_USB_DEVICE_DETACHED = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED"; 437 438/** 439 * @brief Indicates the common event Action indicating that the airplane mode status of the device changes. 440 * Users can register this event to listen to the change of the airplane mode status of the device. 441 * 442 * @since 12 443 */ 444static const char* const COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE"; 445 446/** 447 * @brief sent by the window manager service when the window mode is split. 448 * 449 * @since 12 450 */ 451static const char* const COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN"; 452 453/** 454 * @brief Indicate the result of quick fix apply. 455 * This common event can be triggered only by system. 456 * 457 * @since 12 458 */ 459static const char* const COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT"; 460 461/** 462 * @brief Indicate the result of quick fix revoke. 463 * This common event can be triggered only by system. 464 * 465 * @since 12 466 */ 467static const char* const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT = "usual.event.QUICK_FIX_REVOKE_RESULT"; 468 469/** 470 * @brief Indicate the action of a common event that the user information has been updated. 471 * This common event can be triggered only by system. 472 * 473 * @since 12 474 */ 475static const char* const COMMON_EVENT_USER_INFO_UPDATED = "usual.event.USER_INFO_UPDATED"; 476 477/** 478 * @brief Indicates the action of a common event that the phone SIM card state has changed. 479 * This is a protected common event that can only be sent by system. 480 * 481 * @since 12 482 */ 483static const char* const COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED"; 484 485/** 486 * @brief Indicates the action of a common event that the call state has been changed. 487 * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE 488 * permission. 489 * This is a protected common event that can only be sent by system. 490 * 491 * @since 12 492 */ 493static const char* const COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED"; 494 495/** 496 * @brief Indicates the action of a common event that the network state has been changed. 497 * This is a protected common event that can only be sent by system. 498 * 499 * @since 12 500 */ 501static const char* const COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED"; 502 503/** 504 * @brief Indicates the action of a common event that the signal info has been changed. 505 * This is a protected common event that can only be sent by system. 506 * 507 * @since 12 508 */ 509static const char* const COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED"; 510 511/** 512 * @brief This commonEvent means when the screen is unlocked. 513 * 514 * @since 12 515 */ 516static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED"; 517 518/** 519 * @brief This commonEvent means when the screen is locked. 520 * 521 * @since 12 522 */ 523static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED"; 524 525/** 526 * @brief This commonEvent means when the http proxy change. 527 * 528 * This is a protected common event that can only be sent by system. 529 * 530 * @since 12 531 */ 532static const char* const COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE"; 533 534/** 535 * @brief This commonEvent means when the network connectivityy change. 536 * 537 * This is a protected common event that can only be sent by system. 538 * 539 * @since 12 540 */ 541static const char* const COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE"; 542 543/** 544 * @brief This common event means that minors mode is enabled. 545 * This is a protected common event that can only be sent by system. 546 * 547 * @since 12 548 */ 549static const char* const COMMON_EVENT_MINORSMODE_ON = "usual.event.MINORSMODE_ON"; 550 551/** 552 * @brief This common event means that minors mode is disabled. 553 * This is a protected common event that can only be sent by system. 554 * 555 * @since 12 556 */ 557static const char* const COMMON_EVENT_MINORSMODE_OFF = "usual.event.MINORSMODE_OFF"; 558#ifdef __cplusplus 559} 560#endif 561#endif // OH_COMMONEVENT_SUPPORT_H 562/** @} */ 563