diff options
| author | Olawale Ogunwale <ogunwale@google.com> | 2015-04-06 15:44:31 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-06 15:44:31 +0000 |
| commit | 1d065987ebe5a3ac9480f7871b6fb69fca98ef85 (patch) | |
| tree | f6105410af5115b2c0278dc93b649a366402fb3c | |
| parent | adedb407c5cedaba123ea5f44f3d68fd98e8ee55 (diff) | |
| parent | 47c1cf4b35616059409a0674382c2318494e877b (diff) | |
| download | frameworks_base-1d065987ebe5a3ac9480f7871b6fb69fca98ef85.zip frameworks_base-1d065987ebe5a3ac9480f7871b6fb69fca98ef85.tar.gz frameworks_base-1d065987ebe5a3ac9480f7871b6fb69fca98ef85.tar.bz2 | |
am 47c1cf4b: Merge "[ActivityManager] Fix ServiceRecord leakage"
* commit '47c1cf4b35616059409a0674382c2318494e877b':
[ActivityManager] Fix ServiceRecord leakage
| -rwxr-xr-x | services/core/java/com/android/server/am/ActiveServices.java | 20 |
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. |
