summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorVairavan Srinivasan <vairav@codeaurora.org>2010-12-23 13:51:48 -0800
committerDianne Hackborn <hackbod@google.com>2010-12-23 14:16:56 -0800
commita207ce2abafc653dd362f563f5eb46c2dea51460 (patch)
tree3047d8845261a1f07ad3a35fdfdbe33b57e4d16e /services
parent3ce86481cbde92e2cb6fe3a46cbedd8b2a5c4b48 (diff)
downloadframeworks_base-a207ce2abafc653dd362f563f5eb46c2dea51460.zip
frameworks_base-a207ce2abafc653dd362f563f5eb46c2dea51460.tar.gz
frameworks_base-a207ce2abafc653dd362f563f5eb46c2dea51460.tar.bz2
frameworks/base: Fix to release references in ActivityManagerService
ServiceRecord's bindings is a hashmap to keep track of all active bindings to the service. This is not cleared when the service is brought down by activity manager. This adds up the references to IntentBindRecords and its references to ServiceRecord. Fix is to clear the bindings. ServiceRecord's restarter is a reference to the service and is not cleared when the service is brought down by activity manager. This adds up the references to ServiceRecord. Fix is to set the reference to null when the service is brought down by activity manager. Change-Id: Ica448cd5f60192c8adb23209b5d0e2cf0c04e446
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 6db4559..8358ea9 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -9093,6 +9093,14 @@ public final class ActivityManagerService extends ActivityManagerNative
if (DEBUG_SERVICE) Slog.v(
TAG, "Removed service that is not running: " + r);
}
+
+ if (r.bindings.size() > 0) {
+ r.bindings.clear();
+ }
+
+ if (r.restarter instanceof ServiceRestarter) {
+ ((ServiceRestarter)r.restarter).setService(null);
+ }
}
ComponentName startServiceLocked(IApplicationThread caller,