Assigned
Status Update
Comments
py...@squareup.com <py...@squareup.com> #2
Also confirmed issue persists on 4.4.
ra...@google.com <ra...@google.com> #3
There are a lot of expensive accessories I've purchased or been gifted that quit workin with android 4.2. Android devs need to get on this. 3 broken versions and numerous minor updates and it hasn't even been triaged yet. Completely unprofessional.
ad...@google.com <ad...@google.com>
py...@squareup.com <py...@squareup.com> #4
We are loyal to Android as and they treat us like this.. I have a google device and yet it still is not fixed.
Description
Android Version
Android 14 and Android 15: the leak still exists on latest master / main of AOSP.
Root cause
AccountManager$AmsTask$Response
is a binder stub (extendsIAccountManagerResponse.Stub
) and as such it will often be retained long after the associated AmsTask and activity are destroyed, as by design stubs are retained until the other side gets GCed.AccountManager$AmsTask$Response
has a strongthis$1
reference toAccountManager$11
AccountManager$11
is an anonymous subclass ofAccountManager$AmsTask
which has amActivity
reference to a destroyed activity.How to fix
Make
AccountManager$AmsTask$Response
a static inner class with an explicit nullable reference toAccountManager$AmsTask
.Leak Trace
This leak is hard to reproduce systematically as one needs to have the other process hold its GC. Still, it's very real, it's easy to fix, and looks like it has existed since the introduction of AccountManager in 2009.