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

Commit 5fceebd5 authored by Arthur Hung's avatar Arthur Hung
Browse files

Keeps power key intercepted during a panic gesture

The GestureLauncherService is used to detect camera and sos emergency
gesture by multi-pressing power, if it intercept power key, we should
return the intercept state that could prevent the following detector
processing the power key cause unexpected single tap.

Bug: 194522413
Test: keep pressing power to see if screen would turn off.
Test: atest GestureLauncherServiceTest
Change-Id: I3db7390df720f24f9b312946b1d8e01d672e6ef3
parent 8e31f85e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3844,9 +3844,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
        mCameraGestureTriggered = false;
        final MutableBoolean outLaunched = new MutableBoolean(false);
        final boolean intercept =
                mGestureLauncherService.interceptPowerKeyDown(event, interactive, outLaunched);
        if (!outLaunched.value) {
            return false;
            // If GestureLauncherService intercepted the power key, but didn't launch camera app,
            // we should still return the intercept result. This prevents the single key gesture
            // detector from processing the power key later on.
            return intercept;
        }
        mCameraGestureTriggered = true;
        if (mRequestedOrSleepingDefaultDisplay) {