diff options
author | Wale Ogunwale <ogunwale@google.com> | 2014-11-11 18:00:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-11 18:00:06 +0000 |
commit | 285970cfeae3b175699b038f51c0f9b012a95d0e (patch) | |
tree | eb3a5ba12f335fffca7112cd5dd9f6356f202770 /services | |
parent | a9b503aec2cd27eeb40fab8436c64b4c7de9cacf (diff) | |
parent | 98e70d0908eaf259ac21fc75b252be3c25d788c3 (diff) | |
download | frameworks_base-285970cfeae3b175699b038f51c0f9b012a95d0e.zip frameworks_base-285970cfeae3b175699b038f51c0f9b012a95d0e.tar.gz frameworks_base-285970cfeae3b175699b038f51c0f9b012a95d0e.tar.bz2 |
Merge "Fixed index out of bounds issue when removing windows." into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/wm/AppWindowToken.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index b2575e6..1086eb2 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -252,11 +252,17 @@ class AppWindowToken extends WindowToken { return false; } + @Override void removeAllWindows() { - for (int winNdx = allAppWindows.size() - 1; winNdx >= 0; --winNdx) { - WindowState win = allAppWindows.get(winNdx); - if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) Slog.w(WindowManagerService.TAG, - "removeAllWindows: removing win=" + win); + int winNdx; + while ((winNdx = allAppWindows.size()) > 0) { + WindowState win = allAppWindows.get(winNdx - 1); + if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) { + Slog.w(WindowManagerService.TAG, "removeAllWindows: removing win=" + win); + } + + // {@link WindowManagerService.removeWindowLocked} may remove multiple entries from + // {@link #allAppWindows} if the window to be removed has child windows. win.mService.removeWindowLocked(win.mSession, win); } } |