mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-22 22:49:54 +00:00
校验事件发布方
Signed-off-by: LY <liuyong235@huawei.com>
This commit is contained in:
parent
a41e526047
commit
5c6d18489b
@ -59,6 +59,8 @@ private:
|
||||
|
||||
std::shared_ptr<I18nServiceSubscriber> subscriber = nullptr;
|
||||
static const int RETRY;
|
||||
static const int32_t OS_ACCOUNT_UID;
|
||||
static const std::string OS_ACCOUNT_PERMISSION;
|
||||
};
|
||||
} // namespace I18n
|
||||
} // namespace Global
|
||||
|
@ -26,6 +26,8 @@ namespace OHOS {
|
||||
namespace Global {
|
||||
namespace I18n {
|
||||
const int I18nServiceEvent::RETRY = 3;
|
||||
const int32_t I18nServiceEvent::OS_ACCOUNT_UID = 3058;
|
||||
const std::string I18nServiceEvent::OS_ACCOUNT_PERMISSION = "ohos.permission.MANAGE_LOCAL_ACCOUNTS";
|
||||
|
||||
I18nServiceEvent::I18nServiceEvent()
|
||||
{
|
||||
@ -53,6 +55,8 @@ void I18nServiceEvent::SubscriberEvent()
|
||||
matchingSkills.AddEvent(EventFwk::CommonEventSupport::COMMON_EVENT_USER_ADDED);
|
||||
matchingSkills.AddEvent(EventFwk::CommonEventSupport::COMMON_EVENT_USER_REMOVED);
|
||||
EventFwk::CommonEventSubscribeInfo subscribeInfo(matchingSkills);
|
||||
subscribeInfo.SetPublisherUid(OS_ACCOUNT_UID);
|
||||
subscribeInfo.SetPermission(OS_ACCOUNT_PERMISSION);
|
||||
subscriber = std::make_shared<I18nServiceSubscriber>(subscribeInfo, *this);
|
||||
|
||||
int32_t retry = RETRY;
|
||||
|
Loading…
Reference in New Issue
Block a user