mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-23 14:50:20 +00:00
!1247 【CES】新增CES ndk接口
Merge pull request !1247 from wangsen1994/developer_ces_ndk_0820
This commit is contained in:
commit
bdc8cd09bd
@ -71,3 +71,23 @@ ohos_ndk_library("libtime_service_ndk") {
|
||||
system_capability = "SystemCapability.MiscServices.Time"
|
||||
system_capability_headers = [ "BasicServicesKit/time_service.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_headers("ohcommonevent_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/BasicServicesKit/"
|
||||
sources = [
|
||||
"./commonevent/oh_commonevent.h",
|
||||
"./commonevent/oh_commonevent_support.h",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libcommonevent_ndk") {
|
||||
output_name = "ohcommonevent"
|
||||
output_extension = "so"
|
||||
ndk_description_file = "./commonevent/libcommonevent.ndk.json"
|
||||
min_compact_version = "12"
|
||||
system_capability = "SystemCapability.Notification.CommonEvent"
|
||||
system_capability_headers = [
|
||||
"BasicServicesKit/commonevent/oh_commonevent.h",
|
||||
"BasicServicesKit/commonevent/oh_commonevent_support.h",
|
||||
]
|
||||
}
|
||||
|
98
BasicServicesKit/commonevent/libcommonevent.ndk.json
Normal file
98
BasicServicesKit/commonevent/libcommonevent.ndk.json
Normal file
@ -0,0 +1,98 @@
|
||||
[
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_CreateSubscribeInfo"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_SetPublisherPermission"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_SetPublisherBundleName"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_DestroySubscribeInfo"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_CreateSubscriber"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_DestroySubscriber"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_Subscribe"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_UnSubscribe"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetEventFromRcvData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetCodeFromRcvData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetDataStrFromRcvData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetBundleNameFromRcvData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetParametersFromRcvData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_HasKeyInParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetIntFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetIntArrayFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetLongFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetLongArrayFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetBoolFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetBoolArrayFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetCharFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetCharArrayFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetDoubleFromParameters"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name":"OH_CommonEvent_GetDoubleArrayFromParameters"
|
||||
}
|
||||
]
|
370
BasicServicesKit/commonevent/oh_commonevent.h
Normal file
370
BasicServicesKit/commonevent/oh_commonevent.h
Normal file
@ -0,0 +1,370 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup OH_CommonEvent
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the APIs of common event service.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
/**
|
||||
* @file oh_commonevent.h
|
||||
*
|
||||
* @brief Declares the APIs to subscribe and unsubscribe common event, and so on.
|
||||
*
|
||||
* @library libohcommonevent.so
|
||||
* @kit BasicServicesKit
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef OH_COMMONEVENT_H
|
||||
#define OH_COMMONEVENT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Defines error codes.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum CommonEvent_ErrCode {
|
||||
/** @error Execution successful. */
|
||||
COMMONEVENT_ERR_OK = 0,
|
||||
|
||||
/** @error permission verification failed. */
|
||||
COMMONEVENT_ERR_PERMISSION_ERROR = 201,
|
||||
|
||||
/** @error invalid input parameter. */
|
||||
COMMONEVENT_ERR_INVALID_PARAMETER = 401,
|
||||
|
||||
/** @error IPC request failed to send. */
|
||||
COMMONEVENT_ERR_SENDING_REQUEST_FAILED = 1500007,
|
||||
|
||||
/** @error Common event service not init. */
|
||||
COMMONEVENT_ERR_INIT_UNDONE = 1500008,
|
||||
|
||||
/** @error The subscriber number exceed system specification */
|
||||
COMMONEVENT_ERR_SUBSCRIBER_NUM_EXCEEDED = 1500010,
|
||||
|
||||
/** @error A memory allocation error occurs. */
|
||||
COMMONEVENT_ERR_ALLOC_MEMORY_FAILED = 1500011,
|
||||
} CommonEvent_ErrCode;
|
||||
|
||||
/**
|
||||
* @brief the information of the subscriber
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct CommonEvent_SubscribeInfo CommonEvent_SubscribeInfo;
|
||||
|
||||
/**
|
||||
* @brief the subscriber of common event
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef void CommonEvent_Subscriber;
|
||||
|
||||
/**
|
||||
* @brief the data of the commonEvent callback
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct CommonEvent_RcvData CommonEvent_RcvData;
|
||||
|
||||
/**
|
||||
* @brief The description of the parameters in a common event callback data.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef void CommonEvent_Parameters;
|
||||
|
||||
/**
|
||||
* @brief Common event callback.
|
||||
*
|
||||
* @param data common event callback data.
|
||||
* @since 12
|
||||
*/
|
||||
typedef void (*CommonEvent_ReceiveCallback)(const CommonEvent_RcvData *data);
|
||||
|
||||
/**
|
||||
* @brief Create subscribe information.
|
||||
*
|
||||
* @param events Indicates the subscribed events.
|
||||
* @param eventsNum Indicates the subscribed events of number.
|
||||
* @return Returns the CommonEvent_SubscribeInfo, if allocate memory failed, returns null.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_SubscribeInfo* OH_CommonEvent_CreateSubscribeInfo(const char* events[], int32_t eventsNum);
|
||||
|
||||
/**
|
||||
* @brief Set the subscribe information of permission.
|
||||
*
|
||||
* @param info Indicates the subscribed events.
|
||||
* @param permission Indicates the subscribed events of number.
|
||||
* @return Returns the error code.
|
||||
* Returns {@link COMMONEVENT_ERR_OK} if the operation is successful.
|
||||
* Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_ErrCode OH_CommonEvent_SetPublisherPermission(CommonEvent_SubscribeInfo* info, const char* permission);
|
||||
|
||||
/**
|
||||
* @brief Set the subscribe information of bundleName.
|
||||
*
|
||||
* @param info Indicates the subscribed events.
|
||||
* @param bundleName Indicates the subscribed events of number.
|
||||
* @return Returns the error code.
|
||||
* Returns {@link COMMONEVENT_ERR_OK} if the operation is successful.
|
||||
* Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_ErrCode OH_CommonEvent_SetPublisherBundleName(CommonEvent_SubscribeInfo* info, const char* bundleName);
|
||||
|
||||
/**
|
||||
* @brief Destroy the subscribe information.
|
||||
*
|
||||
* @param info Indicates the subscribe info.
|
||||
* @since 12
|
||||
*/
|
||||
void OH_CommonEvent_DestroySubscribeInfo(CommonEvent_SubscribeInfo* info);
|
||||
|
||||
/**
|
||||
* @brief Create a subscriber.
|
||||
*
|
||||
* @param info Indicates the created subscribe Info.
|
||||
* @param callback Indicates the received common event callback.
|
||||
* @return Returns the CommonEvent_Subscriber, if allocate memory failed, returns null.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_Subscriber* OH_CommonEvent_CreateSubscriber(const CommonEvent_SubscribeInfo* info,
|
||||
CommonEvent_ReceiveCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Destory the subscriber.
|
||||
*
|
||||
* @param subscriber Indicates the created subscriber.
|
||||
* @since 12
|
||||
*/
|
||||
void OH_CommonEvent_DestroySubscriber(CommonEvent_Subscriber* subscriber);
|
||||
|
||||
/**
|
||||
* @brief Subscribe event by a subscriber.
|
||||
*
|
||||
* @param subscriber Indicates the subscriber.
|
||||
* @return Returns the error code.
|
||||
* Returns {@link COMMONEVENT_ERR_OK} if the operation is successful.
|
||||
* Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER } if the input parameter is invalid.
|
||||
* Returns {@link COMMONEVENT_ERR_SENDING_REQUEST_FAILED } if IPC request failed to send.
|
||||
* Returns {@link COMMONEVENT_ERR_INIT_UNDONE } if ces not init done.
|
||||
* Returns {@link COMMONEVENT_ERR_SUBSCRIBER_NUM_EXCEEDED } if the subscriber number is exceeded.
|
||||
* Returns {@link COMMONEVENT_ERR_ALLOC_MEMORY_FAILED } if a memory allocation error occurs.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_ErrCode OH_CommonEvent_Subscribe(const CommonEvent_Subscriber* subscriber);
|
||||
|
||||
/**
|
||||
* @brief Unsubscribe event by a subscriber.
|
||||
*
|
||||
* @param subscriber Indicates the subscriber.
|
||||
* @return Returns the error code.
|
||||
* Returns {@link COMMONEVENT_ERR_OK} if the operation is successful.
|
||||
* Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER } if the input parameter is invalid.
|
||||
* Returns {@link COMMONEVENT_ERR_SENDING_REQUEST_FAILED } if IPC request failed to send.
|
||||
* Returns {@link COMMONEVENT_ERR_INIT_UNDONE } if ces not init done.
|
||||
* @since 12
|
||||
*/
|
||||
CommonEvent_ErrCode OH_CommonEvent_UnSubscribe(const CommonEvent_Subscriber* subscriber);
|
||||
|
||||
/**
|
||||
* @brief Get event name from callback data.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @return Returns the event name.
|
||||
* @since 12
|
||||
*/
|
||||
const char* OH_CommonEvent_GetEventFromRcvData(const CommonEvent_RcvData* rcvData);
|
||||
|
||||
/**
|
||||
* @brief Get event result code from callback data.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @return Returns the event of result code, default is 0.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetCodeFromRcvData(const CommonEvent_RcvData* rcvData);
|
||||
|
||||
/**
|
||||
* @brief Get event result data from callback data.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @return Returns the event of result data, default is null.
|
||||
* @since 12
|
||||
*/
|
||||
const char* OH_CommonEvent_GetDataStrFromRcvData(const CommonEvent_RcvData* rcvData);
|
||||
|
||||
/**
|
||||
* @brief Get event bundlename from callback data.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @return Returns the event of bundlename, default is null.
|
||||
* @since 12
|
||||
*/
|
||||
const char* OH_CommonEvent_GetBundleNameFromRcvData(const CommonEvent_RcvData* rcvData);
|
||||
|
||||
/**
|
||||
* @brief Get event parameters data from callback data.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @return Returns the event of parameters data, default is null.
|
||||
* @since 12
|
||||
*/
|
||||
const CommonEvent_Parameters* OH_CommonEvent_GetParametersFromRcvData(const CommonEvent_RcvData* rcvData);
|
||||
|
||||
/**
|
||||
* @brief Check whether the parameters contains a key.
|
||||
*
|
||||
* @param rcvData Indicates the event of callback data.
|
||||
* @param key Indicates the key of parameter.
|
||||
* @return Returns the result of check, true means it contains.
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_CommonEvent_HasKeyInParameters(const CommonEvent_Parameters* para, const char* key);
|
||||
|
||||
/**
|
||||
* @brief Get int data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param defaultValue Indicates default return value.
|
||||
* @return Returns the int data of the key in the parameters.
|
||||
* @since 12
|
||||
*/
|
||||
int OH_CommonEvent_GetIntFromParameters(const CommonEvent_Parameters* para, const char* key, const int defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Get int array data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param array Indicates the int array.
|
||||
* @return Returns the length of the array.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetIntArrayFromParameters(const CommonEvent_Parameters* para, const char* key, int** array);
|
||||
|
||||
/**
|
||||
* @brief Get long data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param defaultValue Indicates default return value.
|
||||
* @return Returns the long data of the key in the parameters.
|
||||
* @since 12
|
||||
*/
|
||||
long OH_CommonEvent_GetLongFromParameters(const CommonEvent_Parameters* para, const char* key, const long defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Get long array data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param array Indicates the long array.
|
||||
* @return Returns the length of the array.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetLongArrayFromParameters(const CommonEvent_Parameters* para, const char* key, long** array);
|
||||
|
||||
/**
|
||||
* @brief Get bool data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param defaultValue Indicates default return value.
|
||||
* @return Returns the bool data of the key in the parameters.
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_CommonEvent_GetBoolFromParameters(const CommonEvent_Parameters* para, const char* key, const bool defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Get bool array data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param array Indicates the bool array.
|
||||
* @return Returns the length of the array.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetBoolArrayFromParameters(const CommonEvent_Parameters* para, const char* key, bool** array);
|
||||
|
||||
/**
|
||||
* @brief Get char data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param defaultValue Indicates default return value.
|
||||
* @return Returns the char data of the key in the parameters.
|
||||
* @since 12
|
||||
*/
|
||||
char OH_CommonEvent_GetCharFromParameters(const CommonEvent_Parameters* para, const char* key, const char defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Get char array data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param array Indicates the char array.
|
||||
* @return Returns the length of the array.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetCharArrayFromParameters(const CommonEvent_Parameters* para, const char* key, char** array);
|
||||
|
||||
/**
|
||||
* @brief Get double data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param defaultValue Indicates default return value.
|
||||
* @return Returns the double data of the key in the parameters.
|
||||
* @since 12
|
||||
*/
|
||||
double OH_CommonEvent_GetDoubleFromParameters(const CommonEvent_Parameters* para, const char* key,
|
||||
const double defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Get double array data from parameters data by key.
|
||||
*
|
||||
* @param rcvData Indicates the event of parameters data.
|
||||
* @param key Indicates the key of parameters data.
|
||||
* @param array Indicates the double array.
|
||||
* @return Returns the length of the array, default is 0.
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_CommonEvent_GetDoubleArrayFromParameters(const CommonEvent_Parameters* para, const char* key,
|
||||
double** array);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // OH_COMMONEVENT_H
|
||||
/** @} */
|
528
BasicServicesKit/commonevent/oh_commonevent_support.h
Normal file
528
BasicServicesKit/commonevent/oh_commonevent_support.h
Normal file
@ -0,0 +1,528 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup OH_CommonEvent
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the APIs of common event service.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
/**
|
||||
* @file oh_commonevent_support.h
|
||||
*
|
||||
* @brief Declares the constants of system-defined common event.
|
||||
*
|
||||
* @library libohcommonevent.so
|
||||
* @kit BasicServicesKit
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef OH_COMMONEVENT_SUPPORT_H
|
||||
#define OH_COMMONEVENT_SUPPORT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the device is shutting down, note: turn off, not sleeping.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the charging state, level and so on about the battery.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the device in low battery state..
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the battery level is an ok state.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the other power is connected to the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the other power is removed from the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the screen is turned off.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the device is awakened and interactive.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the thermal state level change
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the current time is changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the time is set.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the time zone is changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when a new application package is installed on the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when an existing application package is removed from the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when an existing application package is removed from the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when an existing application package is completely removed from the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when an existing application package has been changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means the user has restarted a package, and all of its processes have been killed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means the user has cleared the package data.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means the user has cleared the package cache.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means the packages have been suspended.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent Sent to a package that has been suspended by the system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED";
|
||||
|
||||
/**
|
||||
* @brief Sent to a package that has been un-suspended.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED";
|
||||
|
||||
/**
|
||||
* @brief The current device's locale has changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Indicates low memory condition notification acknowledged by user and package
|
||||
* management should be started.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE";
|
||||
|
||||
/**
|
||||
* @brief Remind new user of that the service has been unlocked.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED";
|
||||
|
||||
/**
|
||||
* @brief Distributed account logout successfully.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT";
|
||||
|
||||
/**
|
||||
* @brief Distributed account is invalid.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID =
|
||||
"common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID";
|
||||
|
||||
/**
|
||||
* @brief Distributed account logs off.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF";
|
||||
|
||||
/**
|
||||
* @brief WIFI state.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE";
|
||||
|
||||
/**
|
||||
* @brief WIFI scan results.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED";
|
||||
|
||||
/**
|
||||
* @brief WIFI RSSI change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE";
|
||||
|
||||
/**
|
||||
* @brief WIFI connect state.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE";
|
||||
|
||||
/**
|
||||
* @brief WIFI hotspot state.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE";
|
||||
|
||||
/**
|
||||
* @brief WIFI ap sta join.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN";
|
||||
|
||||
/**
|
||||
* @brief WIFI ap sta join.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE";
|
||||
|
||||
/**
|
||||
* @brief Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates that the Wi-Fi P2P state change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates that the Wi-Fi P2P peers state change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates that the Wi-Fi P2P discovery state change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
|
||||
"usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates that the Wi-Fi P2P current device state change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
|
||||
"usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE";
|
||||
|
||||
/**
|
||||
* @brief Indicates that the Wi-Fi P2P group info is changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = "usual.event.wifi.p2p.GROUP_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Nfc state change.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Nfc field on detected.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED";
|
||||
|
||||
/**
|
||||
* @brief Nfc field off detected.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED";
|
||||
|
||||
/**
|
||||
* @brief Sent when stop charging battery.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING";
|
||||
|
||||
/**
|
||||
* @brief Sent when start charging battery.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_CHARGING = "usual.event.CHARGING";
|
||||
|
||||
/**
|
||||
* @brief Sent when device's idle mode changed
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Sent when device's charge idle mode changed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED = "usual.event.CHARGE_IDLE_MODE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Sent when device's power save mode changed
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief The usb state change events.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE";
|
||||
|
||||
/**
|
||||
* @brief The usb port changed.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief The usb device attached.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USB_DEVICE_ATTACHED = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED";
|
||||
|
||||
/**
|
||||
* @brief The usb device detached.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USB_DEVICE_DETACHED = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED";
|
||||
|
||||
/**
|
||||
* @brief Indicates the common event Action indicating that the airplane mode status of the device changes.
|
||||
* Users can register this event to listen to the change of the airplane mode status of the device.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE";
|
||||
|
||||
/**
|
||||
* @brief sent by the window manager service when the window mode is split.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN";
|
||||
|
||||
/**
|
||||
* @brief Indicate the result of quick fix apply.
|
||||
* This common event can be triggered only by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT";
|
||||
|
||||
/**
|
||||
* @brief Indicate the result of quick fix revoke.
|
||||
* This common event can be triggered only by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT = "usual.event.QUICK_FIX_REVOKE_RESULT";
|
||||
|
||||
/**
|
||||
* @brief Indicate the action of a common event that the user information has been updated.
|
||||
* This common event can be triggered only by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_USER_INFO_UPDATED = "usual.event.USER_INFO_UPDATED";
|
||||
|
||||
/**
|
||||
* @brief Indicates the action of a common event that the phone SIM card state has changed.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Indicates the action of a common event that the call state has been changed.
|
||||
* To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE
|
||||
* permission.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Indicates the action of a common event that the network state has been changed.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief Indicates the action of a common event that the signal info has been changed.
|
||||
* This is a protected common event that can only be sent by system.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the screen is unlocked.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED";
|
||||
|
||||
/**
|
||||
* @brief This commonEvent means when the screen is locked.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED";
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // OH_COMMONEVENT_SUPPORT_H
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user