From 613af5311b1bb69f7d23029922ecf0f9720ec10d Mon Sep 17 00:00:00 2001 From: Alejandro Nijamkin Date: Thu, 7 Jul 2022 15:55:39 -0700 Subject: [PATCH] Fixes bug where the camera app would launch below the lock-screen In ag/19119857, we accidentally removed the logic that would dismiss the non-secure "swipe" screen lock when the camera app would be launched by a double-tap on the power button. This CL fixes that. Test: manually verified the following: 1. With Screen Lock set to an insecure "Swipe", when the screen is locked, double-tapping the power button opens the camera app *on top of the lock-screen*. Hitting the back button when the camera app is in the foreground returns to the **unlocked** home screen 2. With Screen Lock set to a secure "Pattern", when the screen is locked, double-tapping the power button opens the camera app *on top of the lock-screen*. Hitting the back button when the camera app is in the foreground returns to the locked lock-screen 3. When unlocked and on the home screen, double-tapping the power button brings the camera app to the foreground. Hitting the back button returns to the home screen Bug: b/235403546, b/238277981 Change-Id: I39b7c8ce2b93d9e95c89ab5625870e6263f77b70 --- .../src/com/android/systemui/camera/CameraGestureHelper.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt index 4986fe85af196..99267e8ee1c9c 100644 --- a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt +++ b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt @@ -125,6 +125,13 @@ class CameraGestureHelper @Inject constructor( // launched from behind the lock-screen. activityStarter.startActivity(intent, false /* dismissShade */) } + + // Call this to make sure that the keyguard returns if the app that is being launched + // crashes after a timeout. + centralSurfaces.startLaunchTransitionTimeout() + // Call this to make sure the keyguard is ready to be dismissed once the next intent is + // handled by the OS (in our case it is the activity we started right above) + centralSurfaces.readyForKeyguardDone() } /**