Create settings key for panic button (emergency sos) sound.

This setting will control enable/disable sound when user uses
panic button in case user wants to take discreet actions during
panic/distress moments.

Bug: 161394591
Test: manually reflashed device
Change-Id: I5e6a9e3e1d6604d6f7224b4e532b13b4d4079a14
This commit is contained in:
Fan Zhang
2020-08-13 15:53:24 -07:00
parent 4d6bfce237
commit 692d692b6b
5 changed files with 13 additions and 0 deletions

View File

@@ -8315,6 +8315,13 @@ public final class Settings {
*/
public static final String PANIC_GESTURE_ENABLED = "panic_gesture_enabled";
/**
* Whether the panic button (emergency sos) sound should be enabled.
*
* @hide
*/
public static final String PANIC_SOUND_ENABLED = "panic_sound_enabled";
/**
* Whether the camera launch gesture to double tap the power button when the screen is off
* should be disabled.

View File

@@ -211,6 +211,7 @@ message SecureSettingsProto {
message EmergencyResponse {
optional SettingProto panic_gesture_enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto panic_sound_enabled = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional EmergencyResponse emergency_response = 83;

View File

@@ -173,5 +173,6 @@ public class SecureSettings {
Settings.Secure.TAPS_APP_TO_EXIT,
Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED,
Settings.Secure.PANIC_GESTURE_ENABLED,
Settings.Secure.PANIC_SOUND_ENABLED,
};
}

View File

@@ -260,5 +260,6 @@ public class SecureSettingsValidators {
VALIDATORS.put(Secure.TAPS_APP_TO_EXIT, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.PANIC_GESTURE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.PANIC_SOUND_ENABLED, BOOLEAN_VALIDATOR);
}
}

View File

@@ -2028,6 +2028,9 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Secure.PANIC_GESTURE_ENABLED,
SecureSettingsProto.EmergencyResponse.PANIC_GESTURE_ENABLED);
dumpSetting(s, p,
Settings.Secure.PANIC_SOUND_ENABLED,
SecureSettingsProto.EmergencyResponse.PANIC_SOUND_ENABLED);
p.end(emergencyResponseToken);
dumpSetting(s, p,