Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18165782 authored by Uday Kiran jandhyala's avatar Uday Kiran jandhyala Committed by Steve Kondik
Browse files

AppWindowToken: Handling IndexOutOfBoundsException

Though elements are added/removed in ArrayList in synchronized blocks,
there are corner cases where an IndexOutOfBoundsException is thrown

CRs-Fixed: 754779

Change-Id: I99b97aad5f2c297c9e41b160f9c70bfdf451e250
parent 3f3a614a
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -254,10 +254,14 @@ class AppWindowToken extends WindowToken {

    void removeAllWindows() {
        for (int winNdx = allAppWindows.size() - 1; winNdx >= 0; --winNdx) {
            try {
                WindowState win = allAppWindows.get(winNdx);
                if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) Slog.w(WindowManagerService.TAG,
                        "removeAllWindows: removing win=" + win);
                win.mService.removeWindowLocked(win.mSession, win);
            } catch (IndexOutOfBoundsException e) {
                Slog.e(WindowManagerService.TAG, "Error while removing window : " + e);
            }
        }
    }