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

Commit a4138166 authored by Jonathan Solnit's avatar Jonathan Solnit
Browse files

Add camera lift trigger to GestureLauncherService

Add registration for the camera lift trigger sensor and handling for its
events to GestureLauncherService

Test: Confirmed camera launches on lift gesture if setting is enabled
(and other pieces are in place)
Change-Id: Ibfad2040409d86af2d019e2ce97ab546bef9ba78
parent be5808f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,7 @@ public class StatusBarManager {


    public static final int CAMERA_LAUNCH_SOURCE_WIGGLE = 0;
    public static final int CAMERA_LAUNCH_SOURCE_WIGGLE = 0;
    public static final int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = 1;
    public static final int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = 1;
    public static final int CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = 2;


    private Context mContext;
    private Context mContext;
    private IStatusBarService mService;
    private IStatusBarService mService;
+6 −0
Original line number Original line Diff line number Diff line
@@ -2933,4 +2933,10 @@
    <!-- Volume level of in-call notification tone playback,
    <!-- Volume level of in-call notification tone playback,
         relative to the overall voice call stream volume [0..100] -->
         relative to the overall voice call stream volume [0..100] -->
    <integer name="config_inCallNotificationVolumeRelative">67</integer>
    <integer name="config_inCallNotificationVolumeRelative">67</integer>

    <!-- The OEM specified sensor type for the lift trigger to launch the camera app. -->
    <integer name="config_cameraLiftTriggerSensorType">-1</integer>
    <!-- The OEM specified sensor string type for the gesture to launch camera app, this value
        must match the value of config_cameraLiftTriggerSensorType in OEM's HAL -->
    <string translatable="false" name="config_cameraLiftTriggerSensorStringType"></string>
</resources>
</resources>
+2 −0
Original line number Original line Diff line number Diff line
@@ -2518,6 +2518,8 @@
  <java-symbol type="integer" name="config_cameraLaunchGestureSensorType" />
  <java-symbol type="integer" name="config_cameraLaunchGestureSensorType" />
  <java-symbol type="string" name="config_cameraLaunchGestureSensorStringType" />
  <java-symbol type="string" name="config_cameraLaunchGestureSensorStringType" />
  <java-symbol type="bool" name="config_cameraDoubleTapPowerGestureEnabled" />
  <java-symbol type="bool" name="config_cameraDoubleTapPowerGestureEnabled" />
  <java-symbol type="integer" name="config_cameraLiftTriggerSensorType" />
  <java-symbol type="string" name="config_cameraLiftTriggerSensorStringType" />


  <java-symbol type="drawable" name="platlogo_m" />
  <java-symbol type="drawable" name="platlogo_m" />


+1 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,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_AFFORDANCE = "lockscreen_affordance";
    public static final String CAMERA_LAUNCH_SOURCE_WIGGLE = "wiggle_gesture";
    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_POWER_DOUBLE_TAP = "power_double_tap";
    public static final String CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = "lift_to_launch_ml";


    public static final String EXTRA_CAMERA_LAUNCH_SOURCE
    public static final String EXTRA_CAMERA_LAUNCH_SOURCE
            = "com.android.systemui.camera_launch_source";
            = "com.android.systemui.camera_launch_source";
+2 −0
Original line number Original line Diff line number Diff line
@@ -2363,6 +2363,8 @@ public class NotificationPanelView extends PanelView implements
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP;
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP;
        } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE) {
        } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE) {
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_WIGGLE;
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_WIGGLE;
        } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER) {
            mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER;
        } else {
        } else {


            // Default.
            // Default.
Loading