summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorOlawale Ogunwale <ogunwale@google.com>2015-04-06 15:25:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-06 15:25:04 +0000
commit47c1cf4b35616059409a0674382c2318494e877b (patch)
treee7ca4596c908505b5a98810788bfce62dceb719f /services
parent655ef08144ec0b71a98b6b3a38e50c6b346ae467 (diff)
parent40e259c34078945ac298c7b20f1df4bef25c3453 (diff)
downloadframeworks_base-47c1cf4b35616059409a0674382c2318494e877b.zip
frameworks_base-47c1cf4b35616059409a0674382c2318494e877b.tar.gz
frameworks_base-47c1cf4b35616059409a0674382c2318494e877b.tar.bz2
Merge "[ActivityManager] Fix ServiceRecord leakage"
Diffstat (limited to 'services')
-rwxr-xr-xservices/core/java/com/android/server/am/ActiveServices.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 059dde1..a9d6a69 100755
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2127,8 +2127,16 @@ public final class ActiveServices {
}
}
- // First clear app state from services.
- for (int i=app.services.size()-1; i>=0; i--) {
+ // 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()) {
sr.stats.stopLaunchedLocked();
@@ -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.