Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccc8f533 authored by Danesh M's avatar Danesh M Committed by Danesh M
Browse files

Ensure camera is launched if doing screen off gesture

Currently it launches whatever the right affordance is set to, which is
incorrect. Ensure screen off gesture always launches camera.

CYNGNOS-2556

Change-Id: I251d37ccc85d014ff46714b222b9074b2092f6e1
(cherry picked from commit 2e0fcdff)
parent 483dbfb9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
    public static final String CAMERA_LAUNCH_SOURCE_AFFORDANCE = "lockscreen_affordance";
    public static final String CAMERA_LAUNCH_SOURCE_WIGGLE = "wiggle_gesture";
    public static final String CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = "power_double_tap";
    public static final String CAMERA_LAUNCH_SOURCE_SCREEN_GESTURE = "screen_gesture";

    public static final String EXTRA_CAMERA_LAUNCH_SOURCE
            = "com.android.systemui.camera_launch_source";
@@ -569,8 +570,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL

    public void launchCamera(String source) {
        final Intent intent;
        if (source.equals(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) || !mShortcutHelper
                .isTargetCustom(LockscreenShortcutsHelper.Shortcuts.RIGHT_SHORTCUT)) {
        if (source.equals(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) ||
                source.equals(CAMERA_LAUNCH_SOURCE_SCREEN_GESTURE) ||
                !mShortcutHelper.isTargetCustom(LockscreenShortcutsHelper.Shortcuts.RIGHT_SHORTCUT)) {
            intent = getCameraIntent();
        } else {
            intent = mShortcutHelper.getIntent(LockscreenShortcutsHelper.Shortcuts.RIGHT_SHORTCUT);
+2 −0
Original line number Diff line number Diff line
@@ -2783,6 +2783,8 @@ public class NotificationPanelView extends PanelView implements
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP;
        } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE) {
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_WIGGLE;
        } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_SCREEN_GESTURE) {
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_SCREEN_GESTURE;
        } else {

            // Default.