Improve camera launch time from double tap power

Wake the device up early when camera gesture is triggered and device is
going to sleep, this could speed up finishing going to sleep state and
prevent the display doing redundant turning off/on stuff when launching
camera.

Bug: 195788686
Bug: 251700246
Test: double tap power to trigger camera
Change-Id: I99355b870d0c13335d719364a45f66cba31abb86
(cherry picked from commit 0261007810)
Merged-In: I99355b870d0c13335d719364a45f66cba31abb86
Merged-In: I4533e0eecdc31861263e27af164b0a04b926e252
This commit is contained in:
Arthur Hung
2022-10-17 07:35:39 +00:00
parent fe8b17d49d
commit bd38ec6028

View File

@@ -4125,6 +4125,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mCameraGestureTriggered = true;
if (mRequestedOrSleepingDefaultDisplay) {
mCameraGestureTriggeredDuringGoingToSleep = true;
// Wake device up early to prevent display doing redundant turning off/on stuff.
wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromPowerKey,
PowerManager.WAKE_REASON_CAMERA_LAUNCH,
"android.policy:CAMERA_GESTURE_PREVENT_LOCK");
}
return true;
}
@@ -4656,11 +4660,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
mDefaultDisplayRotation.updateOrientationListener();
reportScreenStateToVrManager(false);
if (mCameraGestureTriggeredDuringGoingToSleep) {
wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromPowerKey,
PowerManager.WAKE_REASON_CAMERA_LAUNCH,
"com.android.systemui:CAMERA_GESTURE_PREVENT_LOCK");
}
}
}