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

Commit ababce19 authored by Péter Visontay's avatar Péter Visontay Committed by Android (Google) Code Review
Browse files

Merge "In WindowManager code, wrap Binder.restoreCallingIdentity() in finally{}."

parents 0648ae02 3556a3ba
Loading
Loading
Loading
Loading
+46 −44
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                    + " from " + fromToken + " to " + this);

            final long origId = Binder.clearCallingIdentity();

            try {
                // Transfer the starting window over to the new token.
                startingData = fromToken.startingData;
                startingSurface = fromToken.startingSurface;
@@ -1145,7 +1145,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                        UPDATE_FOCUS_WILL_PLACE_SURFACES, true /*updateInputWindows*/);
                getDisplayContent().setLayoutNeeded();
                mService.mWindowPlacerLocked.performSurfacePlacement();
            } finally {
                Binder.restoreCallingIdentity(origId);
            }
            return true;
        } else if (fromToken.startingData != null) {
            // The previous app was getting ready to show a
+90 −91
Original line number Diff line number Diff line
@@ -1849,6 +1849,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

        final long origId = Binder.clearCallingIdentity();

        try {
            disposeInputChannel();

            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Remove " + this
@@ -1886,7 +1887,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    // animation.
                    mAnimatingExit = true;
                    mReplacingRemoveRequested = true;
                Binder.restoreCallingIdentity(origId);
                    return;
                }

@@ -1905,8 +1905,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    // We need to catch tapping on the dead window to restart the app.
                    openInputChannel(null);
                    mService.mInputMonitor.updateInputWindowsLw(true /*force*/);

                Binder.restoreCallingIdentity(origId);
                    return;
                }

@@ -1940,7 +1938,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    if (mAppToken != null) {
                        mAppToken.updateReportedVisibilityLocked();
                    }
                Binder.restoreCallingIdentity(origId);
                    return;
                }
            }
@@ -1952,8 +1949,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                mService.mH.obtainMessage(SEND_NEW_CONFIGURATION, displayId).sendToTarget();
            }
            mService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/);
        } finally {
            Binder.restoreCallingIdentity(origId);
        }
    }

    private void setupWindowForRemoveOnExit() {
        mRemoveOnExit = true;