diff options
author | Dianne Hackborn <hackbod@android.com> | 2011-07-14 10:56:31 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-07-14 10:56:31 -0700 |
commit | 6c21377ff7e857e88a110e12eda98a6c30cba740 (patch) | |
tree | c38afae9834e1a6399e37af63e70d11d3787f751 | |
parent | 5231e3d70d6af1c6245cce59152d6509745de2ba (diff) | |
parent | f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1 (diff) | |
download | packages_apps_settings-6c21377ff7e857e88a110e12eda98a6c30cba740.zip packages_apps_settings-6c21377ff7e857e88a110e12eda98a6c30cba740.tar.gz packages_apps_settings-6c21377ff7e857e88a110e12eda98a6c30cba740.tar.bz2 |
am f70f60c4: am 7d19d795: am b41b85dc: am c74500f4: Merge "Fix NPE due to missing ProcessItem.mPackageInfo"
* commit 'f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1':
Fix NPE due to missing ProcessItem.mPackageInfo
-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>(); |