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

Commit 46657620 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in notifyFocusChanged"

parents 5ee3cb87 63e4053f
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1761,12 +1761,15 @@ public class InputManagerService extends IInputManager.Stub

    // Native callback
    private void notifyFocusChanged(IBinder oldToken, IBinder newToken) {
        if (mFocusedWindow != null) {
            if (mFocusedWindow.asBinder() == newToken) {
            Log.w(TAG, "notifyFocusChanged called with unchanged mFocusedWindow=" + mFocusedWindow);
                Slog.w(TAG, "notifyFocusChanged called with unchanged mFocusedWindow="
                        + mFocusedWindow);
                return;
            }

            setPointerCapture(false);
        }

        mFocusedWindow = IWindow.Stub.asInterface(newToken);
    }