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
This commit is contained in:
Alejandro Nijamkin
2022-07-07 15:55:39 -07:00
parent 9b723322f1
commit 613af5311b

View File

@@ -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()
}
/**