OSDN Git Service

Fix stupid bug.
authorDianne Hackborn <hackbod@google.com>
Mon, 1 May 2017 17:54:07 +0000 (10:54 -0700)
committerDianne Hackborn <hackbod@google.com>
Mon, 1 May 2017 17:54:27 +0000 (10:54 -0700)
Test: manual

Change-Id: I1e3bd86eb3e000111721bad82bebdfb491c2e5de

services/core/java/com/android/server/am/ActiveServices.java

index 5edf19a..e0fc531 100644 (file)
@@ -2808,7 +2808,7 @@ public final class ActiveServices {
     void removeUninstalledPackageLocked(String packageName, int userId) {
         ServiceMap smap = mServiceMap.get(userId);
         if (smap != null && smap.mActiveForegroundApps.size() > 0) {
-            for (int i = smap.mActiveForegroundApps.size(); i >= 0; i--) {
+            for (int i = smap.mActiveForegroundApps.size()-1; i >= 0; i--) {
                 ActiveForegroundApp aa = smap.mActiveForegroundApps.valueAt(i);
                 if (aa.mPackageName.equals(packageName)) {
                     smap.mActiveForegroundApps.removeAt(i);