/base/notification/common_event_service/services/test/unittest/ |
H A D | common_event_freeze_unit_test.cpp | 268 // make eventRecord in HWTEST_F() 269 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); in HWTEST_F() local 270 eventRecord->commonEventData = commonEventData; in HWTEST_F() 271 eventRecord->publishInfo = publishInfo; in HWTEST_F() 272 eventRecord->resultTo = nullptr; in HWTEST_F() 273 eventRecord->state = OrderedEventRecord::IDLE; in HWTEST_F() 274 eventRecord->nextReceiver = 0; in HWTEST_F() 275 eventRecord->receivers.emplace_back(eventSubscriberRecord); in HWTEST_F() 276 eventRecord->deliveryState.emplace_back(OrderedEventRecord::PENDING); in HWTEST_F() 279 controlManager.NotifyUnorderedEvent(eventRecord); in HWTEST_F() 312 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local 355 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local 398 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local [all...] |
H A D | common_event_publish_ordered_event_unit_test.cpp | 339 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); in HWTEST_F() local 340 eventRecord->commonEventData = commonEventData; in HWTEST_F() 341 eventRecord->publishInfo = publishInfo; in HWTEST_F() 342 eventRecord->resultTo = nullptr; in HWTEST_F() 343 eventRecord->state = OrderedEventRecord::IDLE; in HWTEST_F() 344 eventRecord->nextReceiver = 0; in HWTEST_F() 346 bool result = commonEventControlManager->EnqueueOrderedRecord(eventRecord); in HWTEST_F() 379 * @tc.desc: Verify FinishReceiver return true because eventRecord state is received 388 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); in HWTEST_F() local 389 eventRecord in HWTEST_F() 412 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local 479 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local 512 std::shared_ptr<OrderedEventRecord> eventRecord = std::make_shared<OrderedEventRecord>(); HWTEST_F() local [all...] |
H A D | common_event_control_manager_test.cpp | 63 CommonEventRecord eventRecord;
in HWTEST_F() local 65 bool sticky = commonEventControlManager.PublishStickyCommonEvent(eventRecord, subscriberRecord);
in HWTEST_F() 72 * @tc.desc: test NotifyUnorderedEvent function and eventRecord is nullptr.
79 std::shared_ptr<OrderedEventRecord> eventRecord = nullptr;
in HWTEST_F() local 80 bool sticky = commonEventControlManager.NotifyUnorderedEvent(eventRecord);
in HWTEST_F() 206 CommonEventRecord eventRecord;
in HWTEST_F() local 208 eventRecord.commonEventData = commonEventData;
in HWTEST_F() 210 EXPECT_EQ(true, commonEventControlManager.CheckSubscriberPermission(subscriberRecord, eventRecord));
in HWTEST_F() 227 CommonEventRecord eventRecord;
in HWTEST_F() local 229 eventRecord in HWTEST_F() 249 CommonEventRecord eventRecord; HWTEST_F() local [all...] |
H A D | common_event_sticky_test.cpp | 397 CommonEventRecord eventRecord; in HWTEST_F() local 398 eventRecord.publishInfo = publishInfoPtr; in HWTEST_F() 399 eventRecord.commonEventData = dataPtr; in HWTEST_F() 400 int result = stickyManagerPtr->UpdateStickyEvent(eventRecord); in HWTEST_F() 459 CommonEventRecord eventRecord; in HWTEST_F() local 460 eventRecord.publishInfo = newPublishInfoPtr; in HWTEST_F() 461 eventRecord.commonEventData = newDataPtr; in HWTEST_F() 462 int result = stickyManagerPtr->UpdateStickyEvent(eventRecord); in HWTEST_F()
|
H A D | common_event_subscriber_manager_test.cpp | 566 CommonEventRecord eventRecord;
in HWTEST_F() local 567 commonEventSubscriberManager->InsertFrozenEvents(subscriberRecord, eventRecord);
in HWTEST_F() 583 CommonEventRecord eventRecord;
in HWTEST_F() local 584 commonEventSubscriberManager->InsertFrozenEvents(subscriberRecord, eventRecord);
in HWTEST_F()
|
/base/notification/common_event_service/services/include/ |
H A D | common_event_control_manager.h | 39 * @param eventRecord Indicates the event record. 43 bool PublishCommonEvent(const CommonEventRecord &eventRecord, 49 * @param eventRecord Indicates the event record. 54 const CommonEventRecord &eventRecord, const std::shared_ptr<EventSubscriberRecord> &subscriberRecord); 133 const CommonEventRecord &eventRecord, const std::shared_ptr<EventSubscriberRecord> &subscriberRecord = nullptr); 137 bool NotifyUnorderedEvent(std::shared_ptr<OrderedEventRecord> &eventRecord); 161 int8_t CheckPermission(const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord); 164 const CommonEventRecord &eventRecord); 167 const CommonEventRecord &eventRecord, const EventSubscriberRecord &subscriberRecord); 170 const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord); [all...] |
H A D | common_event_subscriber_manager.h | 105 * @param eventRecord Indicates the event record. 108 std::vector<SubscriberRecordPtr> GetSubscriberRecords(const CommonEventRecord &eventRecord); 148 * @param eventRecord Indicates the event record. 150 void InsertFrozenEvents(const SubscriberRecordPtr &eventListener, const CommonEventRecord &eventRecord); 171 * @param eventRecord Indicates the event record. 173 void InsertFrozenEventsMap(const SubscriberRecordPtr &eventListener, const CommonEventRecord &eventRecord); 222 void GetSubscriberRecordsByWantLocked(const CommonEventRecord &eventRecord,
|
H A D | common_event_sticky_manager.h | 54 * @param eventRecord Indicates the record of sticky common event. 57 int UpdateStickyEvent(const CommonEventRecord &eventRecord);
|
/base/notification/common_event_service/services/src/ |
H A D | common_event_control_manager.cpp | 49 const CommonEventRecord &eventRecord, const sptr<IRemoteObject> &commonEventListener) in PublishCommonEvent() 56 if (!eventRecord.publishInfo->IsOrdered()) { in PublishCommonEvent() 57 ret = ProcessUnorderedEvent(eventRecord); in PublishCommonEvent() 59 ret = ProcessOrderedEvent(eventRecord, commonEventListener); in PublishCommonEvent() 66 const CommonEventRecord &eventRecord, const std::shared_ptr<EventSubscriberRecord> &subscriberRecord) in PublishStickyCommonEvent() 75 return ProcessUnorderedEvent(eventRecord, subscriberRecord); in PublishStickyCommonEvent() 141 CommonEventRecord eventRecord = *vec; in PublishFrozenEventsInner() local 143 auto innerCallback = [weak, subscriberRecord, eventRecord]() { in PublishFrozenEventsInner() 149 control->NotifyFreezeEvents(subscriberRecord, eventRecord); in PublishFrozenEventsInner() 157 const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord) in NotifyFreezeEvents() 48 PublishCommonEvent( const CommonEventRecord &eventRecord, const sptr<IRemoteObject> &commonEventListener) PublishCommonEvent() argument 65 PublishStickyCommonEvent( const CommonEventRecord &eventRecord, const std::shared_ptr<EventSubscriberRecord> &subscriberRecord) PublishStickyCommonEvent() argument 156 NotifyFreezeEvents( const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord) NotifyFreezeEvents() argument 203 NotifyUnorderedEventLocked(std::shared_ptr<OrderedEventRecord> &eventRecord) NotifyUnorderedEventLocked() argument 254 NotifyUnorderedEvent(std::shared_ptr<OrderedEventRecord> &eventRecord) NotifyUnorderedEvent() argument 274 ProcessUnorderedEvent( const CommonEventRecord &eventRecord, const std::shared_ptr<EventSubscriberRecord> &subscriberRecord) ProcessUnorderedEvent() argument 354 ProcessOrderedEvent( const CommonEventRecord &eventRecord, const sptr<IRemoteObject> &commonEventListener) ProcessOrderedEvent() argument 766 CheckPermission( const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord) CheckPermission() argument 796 CheckSubscriberPermission( const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord) CheckSubscriberPermission() argument 849 CheckSubscriberRequiredPermission(const std::string &subscriberRequiredPermission, const CommonEventRecord &eventRecord, const EventSubscriberRecord &subscriberRecord) CheckSubscriberRequiredPermission() argument 879 CheckPublisherRequiredPermissions( const std::vector<std::string> &publisherRequiredPermissions, const EventSubscriberRecord &subscriberRecord, const CommonEventRecord &eventRecord) CheckPublisherRequiredPermissions() argument [all...] |
H A D | common_event_subscriber_manager.cpp | 122 const CommonEventRecord &eventRecord) in GetSubscriberRecords() 128 GetSubscriberRecordsByWantLocked(eventRecord, records); in GetSubscriberRecords() 405 void CommonEventSubscriberManager::GetSubscriberRecordsByWantLocked(const CommonEventRecord &eventRecord, in GetSubscriberRecordsByWantLocked() argument 412 auto recordsItem = eventSubscribers_.find(eventRecord.commonEventData->GetWant().GetAction()); in GetSubscriberRecordsByWantLocked() 416 bool isSystemApp = (eventRecord.eventRecordInfo.isSystemApp || eventRecord.eventRecordInfo.isSubsystem) && in GetSubscriberRecordsByWantLocked() 417 !eventRecord.eventRecordInfo.isProxy; in GetSubscriberRecordsByWantLocked() 418 auto bundleName = eventRecord.eventRecordInfo.bundleName; in GetSubscriberRecordsByWantLocked() 419 auto uid = eventRecord.eventRecordInfo.uid; in GetSubscriberRecordsByWantLocked() 420 auto specifiedSubscriberUids = eventRecord in GetSubscriberRecordsByWantLocked() 121 GetSubscriberRecords( const CommonEventRecord &eventRecord) GetSubscriberRecords() argument 552 InsertFrozenEvents( const SubscriberRecordPtr &subscriberRecord, const CommonEventRecord &eventRecord) InsertFrozenEvents() argument 635 InsertFrozenEventsMap( const SubscriberRecordPtr &subscriberRecord, const CommonEventRecord &eventRecord) InsertFrozenEventsMap() argument [all...] |
H A D | inner_common_event_manager.cpp | 261 CommonEventRecord eventRecord; in PublishCommonEvent() local 262 eventRecord.commonEventData = std::make_shared<CommonEventData>(data); in PublishCommonEvent() 263 eventRecord.publishInfo = std::make_shared<CommonEventPublishInfo>(publishInfo); in PublishCommonEvent() 264 eventRecord.recordTime = recordTime; in PublishCommonEvent() 265 eventRecord.eventRecordInfo.pid = pid; in PublishCommonEvent() 266 eventRecord.eventRecordInfo.uid = uid; in PublishCommonEvent() 267 eventRecord.eventRecordInfo.callerToken = callerToken; in PublishCommonEvent() 268 eventRecord.userId = user; in PublishCommonEvent() 269 eventRecord.eventRecordInfo.bundleName = bundleName; in PublishCommonEvent() 270 eventRecord in PublishCommonEvent() [all...] |
H A D | common_event_sticky_manager.cpp | 57 int CommonEventStickyManager::UpdateStickyEvent(const CommonEventRecord &eventRecord) in UpdateStickyEvent() argument 61 auto commonEventRecordPtr = std::make_shared<CommonEventRecord>(eventRecord); in UpdateStickyEvent()
|
/base/notification/common_event_service/services/test/unittest/common_event_control_manager_branch_test/ |
H A D | common_event_control_manager_branch_test.cpp | 95 CommonEventRecord eventRecord;
in HWTEST_F() local 98 eventRecord.publishInfo = publishInfo;
in HWTEST_F() 103 eventRecord.commonEventData = commonEventData;
in HWTEST_F() 108 EXPECT_EQ(false, commonEventControlManager.CheckSubscriberPermission(subscriberRecord, eventRecord));
in HWTEST_F() 127 CommonEventRecord eventRecord;
in HWTEST_F() local 129 eventRecord.commonEventData = commonEventData;
in HWTEST_F() 131 eventRecord.publishInfo = publishInfo;
in HWTEST_F() 134 EXPECT_EQ(true, commonEventControlManager.CheckSubscriberPermission(subscriberRecord, eventRecord));
in HWTEST_F() 153 CommonEventRecord eventRecord;
in HWTEST_F() local 155 eventRecord in HWTEST_F() 183 CommonEventRecord eventRecord; HWTEST_F() local 210 CommonEventRecord eventRecord; HWTEST_F() local 256 CommonEventRecord eventRecord; HWTEST_F() local 283 CommonEventRecord eventRecord; HWTEST_F() local [all...] |