Rename panic button in framework settings.

Renamed panic to "emergency" or "emergency gesture" to
avoid speculation once source code is accessible to
parties without full context.

The settings string and file names still use the word "panic". This
will be updated in a follow-up CL

Bug: 169946710
Test: rebuild
Change-Id: Ic1a3181145ca2b64ab6ef2a2989224395fa9a6f8
This commit is contained in:
Fan Zhang
2020-10-23 15:48:01 -07:00
parent 45435fdb1d
commit 6fef72aae4
4 changed files with 8 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ public class PanicGesturePreferenceController extends GesturePreferenceControlle
private static final String PREF_KEY_VIDEO = "panic_button_screen_video"; private static final String PREF_KEY_VIDEO = "panic_button_screen_video";
private static final String SECURE_KEY = Settings.Secure.PANIC_GESTURE_ENABLED; private static final String SECURE_KEY = Settings.Secure.EMERGENCY_GESTURE_ENABLED;
public PanicGesturePreferenceController(Context context, String key) { public PanicGesturePreferenceController(Context context, String key) {
super(context, key); super(context, key);

View File

@@ -34,7 +34,7 @@ public class PanicGestureSoundPreferenceController extends TogglePreferenceContr
@VisibleForTesting @VisibleForTesting
static final int OFF = 0; static final int OFF = 0;
private static final String SECURE_KEY = Settings.Secure.PANIC_SOUND_ENABLED; private static final String SECURE_KEY = Settings.Secure.EMERGENCY_GESTURE_SOUND_ENABLED;
public PanicGestureSoundPreferenceController(Context context, String key) { public PanicGestureSoundPreferenceController(Context context, String key) {
super(context, key); super(context, key);

View File

@@ -113,7 +113,7 @@ public class PanicGesturePreferenceControllerTest {
@Test @Test
public void isChecked_configIsNotSet_shouldReturnTrue() { public void isChecked_configIsNotSet_shouldReturnTrue() {
// Set the setting to be enabled. // Set the setting to be enabled.
Settings.Secure.putInt(mContentResolver, Settings.Secure.PANIC_GESTURE_ENABLED, ON); Settings.Secure.putInt(mContentResolver, Settings.Secure.EMERGENCY_GESTURE_ENABLED, ON);
mController = new PanicGesturePreferenceController(mContext, PREF_KEY); mController = new PanicGesturePreferenceController(mContext, PREF_KEY);
assertThat(mController.isChecked()).isTrue(); assertThat(mController.isChecked()).isTrue();
@@ -122,7 +122,7 @@ public class PanicGesturePreferenceControllerTest {
@Test @Test
public void isChecked_configIsSet_shouldReturnFalse() { public void isChecked_configIsSet_shouldReturnFalse() {
// Set the setting to be disabled. // Set the setting to be disabled.
Settings.Secure.putInt(mContentResolver, Settings.Secure.PANIC_GESTURE_ENABLED, OFF); Settings.Secure.putInt(mContentResolver, Settings.Secure.EMERGENCY_GESTURE_ENABLED, OFF);
mController = new PanicGesturePreferenceController(mContext, PREF_KEY); mController = new PanicGesturePreferenceController(mContext, PREF_KEY);
assertThat(mController.isChecked()).isFalse(); assertThat(mController.isChecked()).isFalse();

View File

@@ -78,7 +78,8 @@ public class PanicGestureSoundPreferenceControllerTest {
@Test @Test
public void isChecked_configIsSet_shouldReturnTrue() { public void isChecked_configIsSet_shouldReturnTrue() {
// Set the setting to be enabled. // Set the setting to be enabled.
Settings.Secure.putInt(mContentResolver, Settings.Secure.PANIC_SOUND_ENABLED, ON); Settings.Secure.putInt(mContentResolver, Settings.Secure.EMERGENCY_GESTURE_SOUND_ENABLED,
ON);
assertThat(mController.isChecked()).isTrue(); assertThat(mController.isChecked()).isTrue();
} }
@@ -86,7 +87,8 @@ public class PanicGestureSoundPreferenceControllerTest {
@Test @Test
public void isChecked_configIsSetToFalse_shouldReturnFalse() { public void isChecked_configIsSetToFalse_shouldReturnFalse() {
// Set the setting to be disabled. // Set the setting to be disabled.
Settings.Secure.putInt(mContentResolver, Settings.Secure.PANIC_SOUND_ENABLED, OFF); Settings.Secure.putInt(mContentResolver, Settings.Secure.EMERGENCY_GESTURE_SOUND_ENABLED,
OFF);
assertThat(mController.isChecked()).isFalse(); assertThat(mController.isChecked()).isFalse();
} }