diff options
-rw-r--r-- | src/com/android/settings/applications/RunningState.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/settings/applications/RunningState.java b/src/com/android/settings/applications/RunningState.java index e7e3af4..8ca17a5 100644 --- a/src/com/android/settings/applications/RunningState.java +++ b/src/com/android/settings/applications/RunningState.java @@ -776,6 +776,7 @@ public class RunningState { } // Look for services and their primary processes that no longer exist... + ArrayList<Integer> uidToDelete = null; for (int i=0; i<mServiceProcessesByName.size(); i++) { HashMap<String, ProcessItem> procs = mServiceProcessesByName.valueAt(i); Iterator<ProcessItem> pit = procs.values().iterator(); @@ -792,7 +793,10 @@ public class RunningState { changed = true; pit.remove(); if (procs.size() == 0) { - mServiceProcessesByName.remove(mServiceProcessesByName.keyAt(i)); + if (uidToDelete == null) { + uidToDelete = new ArrayList<Integer>(); + } + uidToDelete.add(mServiceProcessesByName.keyAt(i)); } if (pi.mPid != 0) { mServiceProcessesByPid.remove(pi.mPid); @@ -810,6 +814,13 @@ public class RunningState { } } + if (uidToDelete != null) { + for (int i = 0; i < uidToDelete.size(); i++) { + int uid = uidToDelete.get(i); + mServiceProcessesByName.remove(uid); + } + } + if (changed) { // First determine an order for the services. ArrayList<ProcessItem> sortedProcesses = new ArrayList<ProcessItem>(); |