Do not keep MediaSession Tokens for Notification accounting
In some cases we're tracking 50+ MediaSession.Tokens being retained. Since Tokens contain strong binder links, they can retain big resources on the other side of the link.
The code inside MediaSessionBasedFilter doesn't actually need to hold tokens at all - it just tests for equality between tokens. As such, we can only retain their identifiers and let Tokens themselves be deallocated if necessary.
Bug: 261882243
Test: atest MediaSessionBasedFilterTest, verified Media behaviour on device
Change-Id: I65fc3b47ad87cd6b90a814ef217b2ec1c90cac29
1 file changed