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

Commit e27372d1 authored by Emilie Roberts's avatar Emilie Roberts
Browse files

Allow rapid request/release of pointer capture

This removes a check for if pointer capture is already enabled when a
call to request/release it is made. This attempt to de-duplicate the
call can prevent a 2nd call from reaching the underlying implementation
if it is made too quickly.

In b/217714520, Minecraft: EDU was calling View.requestPointerCapture()
followed by View.releasePointerCapture() in quick succession, causing
the mouse cursor to disappear due to this check.

Test: manually test Minecraft: EDU. Enter a world, then return to the
main menu
Test: atest PointerCaptureTest
Bug: 217714520

Change-Id: I78c6c6f90409ca5e46e2680cc5fbb3c5ee17dc17
parent 8c13b43b
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -5032,9 +5032,6 @@ public final class ViewRootImpl implements ViewParent,
    }

    void requestPointerCapture(boolean enabled) {
        if (mPointerCapture == enabled) {
            return;
        }
        final IBinder inputToken = getInputToken();
        if (inputToken == null) {
            Log.e(mTag, "No input channel to request Pointer Capture.");