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

Commit 8875a3c8 authored by Jieli Zhong's avatar Jieli Zhong Committed by Mattias Nilsson
Browse files

Add configuration possibilities for Emergency SOS

Add default values for Emergency SOS and Play countdown alarm.

Test: Manual
Bug: 256876746
Change-Id: Id534e1cf657266ae11a7055b5197cb05a3513412
parent 1c4bb0ec
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3573,6 +3573,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
@@ -2968,6 +2968,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.
     */