Fix duplicate bitmaps.
onNotificationPosted callback can be called multiple times from the app
to update the notification in system UI before onNotificationRemoved() is
called. Prior code assumed, notification objet would not change and as
Set does not allow duplicates it will ignore the update.
Changes in this commit fixes the above assumption and while we are at
it, does shallow copy so there are no addtional references to Bitmap.
Verified the changes with media playback and checking system_server
memory.
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerNotifyMediaFGSTypeTest.java
Flag: com.android.media.flags.enable_notifying_activity_manager_with_media_session_status_change
BUG: 403303336
Change-Id: I3d5d4f6d976731da55ff125e19f22020ec987af6
Signed-off-by:  Pradeep Sawlani <sawlani@google.com>
Pradeep Sawlani <sawlani@google.com>
Loading
Please register or sign in to comment
