Fix race condition using notification pipeline
It turns out that NotifPipeline returns a pointer to allNotifs field in
NotifCollection when getAllNotifs() is called. This list can be modified
by main thread which updates the list being sent to background. This
leads to a race condition.
This CL creates a list of StatusbarNotification being added from
notification entry returned from getAllNotifs() in main thread. So we
make sure the list of notifications being sent to background thread
should not get modified by main thread.
When notification entry is updated, sbn is being reset. Storing all
statusbar notifications ensures they don't get updated by main thread
when they are being accessed by background thread.
Flag: com.android.systemui.notification_media_manager_background_execution
Bug: 336612071
Test: atest NotificationMediaManagerTest
Change-Id: I84a7270b8f8367267ea0e870c0f615dfdffcf345
1 file changed