OSDN Git Service

Added display null check to ActivityStackSupervisor.getNextFocusableStackLocked
authorWale Ogunwale <ogunwale@google.com>
Thu, 24 May 2018 07:32:23 +0000 (00:32 -0700)
committerWale Ogunwale <ogunwale@google.com>
Thu, 24 May 2018 07:32:23 +0000 (00:32 -0700)
Don't try to process display that is already removed from the system

Change-Id: Idaef23ecf33a45970fc61e1a7fb56206c1a1deea
Fixes: 79779143
Test: manual

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

index afad0b1..7310fab 100644 (file)
@@ -2554,6 +2554,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
             final int displayId = mTmpOrderedDisplayIds.get(i);
             // If a display is registered in WM, it must also be available in AM.
             final ActivityDisplay display = getActivityDisplayOrCreateLocked(displayId);
+            if (display == null) {
+                // Looks like the display no longer exists in the system...
+                continue;
+            }
             for (int j = display.getChildCount() - 1; j >= 0; --j) {
                 final ActivityStack stack = display.getChildAt(j);
                 if (ignoreCurrent && stack == currentFocus) {