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

Skip to content
Commit 9192b727 authored by Jernej Virag's avatar Jernej Virag
Browse files

Prevent Media notification spam from spiking SystemUI memory use

If an app spams Media Notifications it can lead to massive increase to memory use, since the waiting loadMediaData jobs will be waiting on the background executor looper to be processed. This is especially problematic if there are other tasks taking the thread.

This CL:
- Moves media actions code to MediaActions.kt so it can be reused in new MediaDataLoader class
- Duplicates `loadMediaData` and `loadMediaDataForResumption` calls in `MediaDataLoader`
- Implements logic which cancels in-flight media data load requests for same sbn/key if an update comes in.

Bug: 358350077
Flag: com.android.systemui.media_load_metadata_via_media_data_loader
Test: atest LegacyMediaDataManagerImplTest MediaDataLoaderTest + device testing
Change-Id: Ic29b6954c4cd3489751fafc1c8a8b92a7a2016de
parent 9ed5d65d
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