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

Commit 9a5f05b2 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Clean up RemoteCallbackList when we're done with it.

When dispatching cancel callbacks for a pending intent,
AMS drops its reference to the list without cleaning it up.
This means that the enclosed callbacks (proxies) will stay
alive until the remote process dies. For some processes like
systemUI, this will happen rarely (if ever), and so sooner
or later we would run into proxy resource limits for such
processes.

Since at this point we're done with the RemoteCallbackList,
just clear it out.

Bug: 109701487
Test: builds, boots, callback list is cleaned out
Change-Id: Ia1a108045fb1fd12cbd94a7c516a9eab8ebca099
parent 1250cd14
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2207,6 +2207,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                    }
                }
                callbacks.finishBroadcast();
                // We have to clean up the RemoteCallbackList here, because otherwise it will
                // needlessly hold the enclosed callbacks until the remote process dies.
                callbacks.kill();
            } break;
            case UPDATE_TIME_ZONE: {
                synchronized (ActivityManagerService.this) {