From b3847d8e925b74c117bba693c454a0cb8635e004 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Thu, 1 Sep 2016 13:22:39 -0700 Subject: [PATCH] Fixed indexOutOfBoundsException in WindowManager Problem was introduced in ag/1395371 where we were looking through the wrong list for the wallpaper. We need to look through the DisplayContent window list which is windowList and not the WindowToken list which is windows. Bug: 31234488 Change-Id: If8b3d4c00f268525132a0c452a0225c90c9f02b1 --- .../core/java/com/android/server/wm/WindowToken.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java index 6f4c1a4428296..b7bc672973537 100644 --- a/services/core/java/com/android/server/wm/WindowToken.java +++ b/services/core/java/com/android/server/wm/WindowToken.java @@ -631,8 +631,8 @@ class WindowToken { final int privateFlags = wallpaperTarget.mAttrs.privateFlags; if (((privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 || type == TYPE_KEYGUARD_SCRIM) && !mService.isKeyguardAnimatingIn()) { - insertionIndex = Math.min(windows.indexOf(wallpaperTarget), - findLowestWindowOnScreen(windows)); + insertionIndex = Math.min(windowList.indexOf(wallpaperTarget), + findLowestWindowOnScreen(windowList)); } } if (DEBUG_WALLPAPER_LIGHT || DEBUG_WINDOW_MOVEMENT @@ -651,10 +651,10 @@ class WindowToken { * @return The index in {@param windows} of the lowest window that is currently on screen and * not hidden by the policy. */ - private int findLowestWindowOnScreen(WindowList windows) { - final int size = windows.size(); + private int findLowestWindowOnScreen(WindowList windowList) { + final int size = windowList.size(); for (int index = 0; index < size; index++) { - final WindowState win = windows.get(index); + final WindowState win = windowList.get(index); if (win.isOnScreen()) { return index; }