diff options
author | Dianne Hackborn <hackbod@android.com> | 2011-07-14 09:18:01 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-07-14 09:18:01 -0700 |
commit | f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1 (patch) | |
tree | 5ab1925c8f2f83410cf614c7b917eee605e88825 /src/com | |
parent | 25bd33e1cfb753ff0a118e6c84f6e23163713b69 (diff) | |
parent | 7d19d795c8d7a5692879523d8179a8a46226bbbc (diff) | |
download | packages_apps_settings-f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1.zip packages_apps_settings-f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1.tar.gz packages_apps_settings-f70f60c4dcfa576ea4ca9eda88eb1f258d1b38f1.tar.bz2 |
am 7d19d795: am b41b85dc: am c74500f4: Merge "Fix NPE due to missing ProcessItem.mPackageInfo"
* commit '7d19d795c8d7a5692879523d8179a8a46226bbbc':
Fix NPE due to missing ProcessItem.mPackageInfo
Diffstat (limited to 'src/com')
-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>(); |