fix: fix thread for ces

Signed-off-by: liujiandong <liujiandong1@huawei.com>
This commit is contained in:
YOUR_NAME 2023-05-06 09:29:51 +08:00
parent 9f0dbddc75
commit 4c114c905a
2 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ void DeviceStateObserver::StartEventSubscriber(const std::shared_ptr<DeviceState
matchingSkills.AddEvent(CommonEventSupport::COMMON_EVENT_CHARGING);
matchingSkills.AddEvent(CommonEventSupport::COMMON_EVENT_DISCHARGING);
CommonEventSubscribeInfo subscriberInfo(matchingSkills);
subscriberInfo.SetThreadMode(EventFwk::CommonEventSubscribeInfo::COMMON);
subscriber_ = std::make_shared<DeviceStateEventSubscriber>(subscriberInfo);
subscriber_->SetEventHandler(deviceStateHandler);
subscriber_->InitEventMap();

View File

@ -131,6 +131,7 @@ bool NetworkSearchHandler::InitOperatorName()
EventFwk::MatchingSkills matchingSkills;
matchingSkills.AddEvent(CommonEventSupport::COMMON_EVENT_OPERATOR_CONFIG_CHANGED);
EventFwk::CommonEventSubscribeInfo subscriberInfo(matchingSkills);
subscriberInfo.SetThreadMode(EventFwk::CommonEventSubscribeInfo::COMMON);
operatorName_ = std::make_shared<OperatorName>(
subscriberInfo, nsm->GetNetworkSearchState(slotId_), nsm->GetSimManager(), networkSearchManager_, slotId_);
if (operatorName_ == nullptr) {