Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d47640c authored by Kshitij Gupta's avatar Kshitij Gupta
Browse files

NotificationMemoryLogger: Drop usages of runBlocking

- Previously, notificationPipeline.allNotifs.toList() had to be
  accessed on the main thread. While this is a completely synchronous
  call, runBlocking was used to switch threads and access allNotifs.
- Given this is synchronous, we can instead use thread-safe
  alternatives for the underlying Collection.
- allNotifs is a getter in NotifCollection, which returns
  mReadOnlyNotificationSet - which derives values from
  mNotificationSet.
- NotifCollection.mNotificationSet is now a ConcurrentHashMap for
  thread-safe access, and the main thread assertion is removed,
  allowing access via a background thread.
- Lastly, getAllNotificationsOnMainThread() is appropriately renamed to
  getAllNotifications()

Bug: 423462317
Flag: com.android.systemui.do_not_use_run_blocking
Test: atest NotificationMemoryLoggerTest
Change-Id: I3400ec5276fbe37d5799e97dbcf6c90e468c40c2
parent aeda457c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment