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

Commit 47c1cf4b authored by Olawale Ogunwale's avatar Olawale Ogunwale Committed by Gerrit Code Review
Browse files

Merge "[ActivityManager] Fix ServiceRecord leakage"

parents 655ef081 40e259c3
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -2127,7 +2127,15 @@ public final class ActiveServices {
            }
        }

        // First clear app state from services.
        // Clean up any connections this application has to other services.
        for (int i = app.connections.size() - 1; i >= 0; i--) {
            ConnectionRecord r = app.connections.valueAt(i);
            removeConnectionLocked(r, app, null);
        }
        updateServiceConnectionActivitiesLocked(app);
        app.connections.clear();

        // Clear app state from services.
        for (int i = app.services.size() - 1; i >= 0; i--) {
            ServiceRecord sr = app.services.valueAt(i);
            synchronized (sr.stats.getBatteryStats()) {
@@ -2188,14 +2196,6 @@ public final class ActiveServices {
            }
        }

        // Clean up any connections this application has to other services.
        for (int i=app.connections.size()-1; i>=0; i--) {
            ConnectionRecord r = app.connections.valueAt(i);
            removeConnectionLocked(r, app, null);
        }
        updateServiceConnectionActivitiesLocked(app);
        app.connections.clear();

        ServiceMap smap = getServiceMap(app.userId);

        // Now do remaining service cleanup.