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

Commit 5a81df5c authored by Fan Zhang's avatar Fan Zhang Committed by Automerger Merge Worker
Browse files

Merge "Add configuration possibilities for Emergency SOS" am: ee4ed803

parents 06f6d964 ee4ed803
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3625,6 +3625,12 @@
         experience while the device is non-interactive. -->
    <bool name="config_emergencyGestureEnabled">true</bool>

    <!-- Default value for Use Emergency SOS in Settings false = disabled, true = enabled -->
    <bool name="config_defaultEmergencyGestureEnabled">true</bool>

    <!-- Default value for Use Play countdown alarm in Settings false = disabled, true = enabled -->
    <bool name="config_defaultEmergencyGestureSoundEnabled">false</bool>

    <!-- Allow the gesture power + volume up to change the ringer mode while the device
         is interactive. -->
    <bool name="config_volumeHushGestureEnabled">true</bool>
+2 −0
Original line number Diff line number Diff line
@@ -3001,6 +3001,8 @@
  <java-symbol type="integer" name="config_cameraLiftTriggerSensorType" />
  <java-symbol type="string" name="config_cameraLiftTriggerSensorStringType" />
  <java-symbol type="bool" name="config_emergencyGestureEnabled" />
  <java-symbol type="bool" name="config_defaultEmergencyGestureEnabled" />
  <java-symbol type="bool" name="config_defaultEmergencyGestureSoundEnabled" />
  <java-symbol type="bool" name="config_volumeHushGestureEnabled" />

  <java-symbol type="drawable" name="platlogo_m" />
+7 −1
Original line number Diff line number Diff line
@@ -466,7 +466,8 @@ public class GestureLauncherService extends SystemService {
    public static boolean isEmergencyGestureSettingEnabled(Context context, int userId) {
        return isEmergencyGestureEnabled(context.getResources())
                && Settings.Secure.getIntForUser(context.getContentResolver(),
                Settings.Secure.EMERGENCY_GESTURE_ENABLED, 1, userId) != 0;
                Settings.Secure.EMERGENCY_GESTURE_ENABLED,
                isDefaultEmergencyGestureEnabled(context.getResources()) ? 1 : 0, userId) != 0;
    }

    /**
@@ -513,6 +514,11 @@ public class GestureLauncherService extends SystemService {
        return resources.getBoolean(com.android.internal.R.bool.config_emergencyGestureEnabled);
    }

    private static boolean isDefaultEmergencyGestureEnabled(Resources resources) {
        return resources.getBoolean(
                com.android.internal.R.bool.config_defaultEmergencyGestureEnabled);
    }

    /**
     * Whether GestureLauncherService should be enabled according to system properties.
     */