Merge "Add configuration possibilities for Emergency SOS"

This commit is contained in:
Fan Zhang
2022-11-15 22:52:17 +00:00
committed by Gerrit Code Review
3 changed files with 15 additions and 1 deletions

View File

@@ -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>

View File

@@ -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" />

View File

@@ -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.
*/