Prevent memory leak due to duplicate permission callbacks
A memory leak was identified in PermissionListenerMultiplexer due to how
it handled PermissionChangeCallback listeners. The issue stemmed from
the use of a MutableList, which allowed the same listener to be added
multiple times for a given UID. This problem was particularly evident
when the systems lifecycle management caused a sequence of calls, such
as a checkForUidUpdate followed by onActive, leading to repeated
registrations of the same listener. Since the corresponding onInactive
call only removed one instance, a buildup of duplicate listeners would
occur over time.
Fix: 430236904
FLAG: EXEMPT bug fix
Test: presubmit
Relnote: fix memory leak
Change-Id: I73bda34bdc3fa88086382c4c32e6b9206cef7fd8
1 file changed