Merge "Keeps power key intercepted during a panic gesture" into sc-dev

This commit is contained in:
Arthur Hung
2021-07-28 02:26:51 +00:00
committed by Android (Google) Code Review

View File

@@ -3844,9 +3844,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
mCameraGestureTriggered = false;
final MutableBoolean outLaunched = new MutableBoolean(false);
mGestureLauncherService.interceptPowerKeyDown(event, interactive, outLaunched);
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) {