Last update: July 2022
interceptPowerKeyDown
)PhoneWindowManager
has a lot of logic to detect all manner of power button multi-presses and gestures, it also checks with GestureLauncherService
, which is also offered the chance to intercept the power keyGestureLauncherService
is responsible for the camera timeout, and if it detects one, it forwards it to the StatusBarManagerService (which hands it off to SystemUI)onCameraLaunchDetected
in CentralSurfacesCommandQueueCallbacks.java looks at the keyguard state and determinesSECURE_CAMERA_INTENT
, then - in order to show the resolver, the lockscreen "bouncer" (authentication method) is first presentedCameraGestureHelper encapsulate this logic. Roughly:
CameraIntents.getInsecureCameraIntent()
, defined to be MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA
.CameraIntents.getInsecureCameraIntent()
or CameraIntents.getSecureCameraIntent()
, which are MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA
and MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE
, respectivelyconfig_cameraGesturePackage
is nonempty, this will be treated as a package name to be added to the insecure camera intent, constraining the invocation to that single app and typically preventing implicit intent resolution. This package must be on the device or the camera gesture will no longer work properly