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

Skip to content
Commit 77097800 authored by shawnlin's avatar shawnlin
Browse files

Fix the background of lockscreen showing the art work of removed media notification

StatusBar inflates notification views by AsyncTask(AsyncInflationTask), and the notification entry will be added to mNotificationData only after the inflation is completed.
It makes a timing issue for media notification if following conditions are met:
1. There already exists one none-media notification which is posted by the same app as the incoming media notification.
2. Any notification posted and its inflation is completed before the media notification and then triggers the findAndUpdateMediaNotifications().

In such case, the media notification entry hasn't been added to mNotificationData yet so we can't find any notification with media controller in this list.
Then we look up MediaSessionManager and try to find any MediaController that has the same package name with any notification in mNotificationData list.
It will then find a MediaController which should belong to the media notification, but then be assigned to the none-media notification since both have the same package name.

We now move the if (medianotification != null) {} block outside the
controller to make sure the correct media notification is set after its
inflation is completed.

Test: runtest systemui
Test: manual - open chrome : 1)download a file 2)play any youtube video 3)screen off then on device
Fixes: 75988950

Change-Id: Ic7f341cd0b0cf675807d2127e61cbb651f9dff75
parent d4115f50
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment