!276 新增渠道改变公共事件

Merge pull request !276 from FangJinliang/pr_264
This commit is contained in:
openharmony_ci
2022-05-07 07:57:03 +00:00
committed by Gitee
4 changed files with 27 additions and 4 deletions
+11 -2
View File
@@ -1155,19 +1155,26 @@ const std::string CommonEventSupport::COMMON_EVENT_NITZ_TIMEZONE_CHANGED =
"usual.event.NITZ_TIMEZONE_CHANGED";
/**
* Indicate the action of a common event that a new sms wappush has been received by the device.
* Indicates the action of a common event that a new sms wappush has been received by the device.
* This is a protected common event that can only be sent by system.
*/
const std::string CommonEventSupport::COMMON_EVENT_SMS_WAPPUSH_RECEIVE_COMPLETED =
"usual.event.SMS_WAPPUSH_RECEIVE_COMPLETED";
/**
* Indicate the action of a common event that the operator config has been updated.
* Indicates the action of a common event that the operator config has been updated.
* This is a protected common event that can only be sent by system.
*/
const std::string CommonEventSupport::COMMON_EVENT_OPERATOR_CONFIG_CHANGED =
"usual.event.OPERATOR_CONFIG_CHANGED";
/**
* Indicates the action of a common event that the notification slot has been updated.
* This is a protected common event that can only be sent by system.
*/
const std::string CommonEventSupport::COMMON_EVENT_SLOT_CHANGE =
"usual.event.SLOT_CHANGE";
/**
* Only for test case.
*/
@@ -1332,6 +1339,8 @@ void CommonEventSupport::Init()
commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_OPERATOR_CONFIG_CHANGED);
commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SLOT_CHANGE);
return;
}
+8 -2
View File
@@ -1055,17 +1055,23 @@ public:
static const std::string COMMON_EVENT_NITZ_TIMEZONE_CHANGED;
/**
* Indicate the action of a common event that a new sms wappush has been received by the device.
* Indicates the action of a common event that a new sms wappush has been received by the device.
* This is a protected common event that can only be sent by system.
*/
static const std::string COMMON_EVENT_SMS_WAPPUSH_RECEIVE_COMPLETED;
/**
* Indicate the action of a common event that the operator config has been updated.
* Indicates the action of a common event that the operator config has been updated.
* This is a protected common event that can only be sent by system.
*/
static const std::string COMMON_EVENT_OPERATOR_CONFIG_CHANGED;
/**
* Indicates the action of a common event that the notification slot has been updated.
* This is a protected common event that can only be sent by system.
*/
static const std::string COMMON_EVENT_SLOT_CHANGE;
/**
* Only for test case.
*/
@@ -482,6 +482,11 @@ napi_value SupportInit(napi_env env, napi_value exports)
EventFwk::CommonEventSupport::COMMON_EVENT_OPERATOR_CONFIG_CHANGED,
"COMMON_EVENT_OPERATOR_CONFIG_CHANGED");
SetNamedPropertyByStr(env,
obj,
EventFwk::CommonEventSupport::COMMON_EVENT_SLOT_CHANGE,
"COMMON_EVENT_SLOT_CHANGE");
napi_property_descriptor exportFuncs[] = {DECLARE_NAPI_PROPERTY("Support", obj)};
napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs);
@@ -221,6 +221,9 @@ static const std::unordered_map<std::string, std::pair<PermissionState, std::vec
},
{CommonEventSupport::COMMON_EVENT_SPLIT_SCREEN,
{PermissionState::DEFAULT, {"ohos.permission.RECEIVER_SPLIT_SCREEN"}}
},
{CommonEventSupport::COMMON_EVENT_SLOT_CHANGE,
{PermissionState::DEFAULT, {"ohos.permission.NOTIFICATION_CONTROLLER"}}
}
};