Move APPLY_RAMPING_RINGER from Global to System
This configuration should be user-scoped.
Bug: 184165158
Test: AccessibilitySettingsTest
RingVibrationPreferenceFragmentTest
VibrateForCallsPreferenceControllerTest
VibrateForCallsPreferenceFragmentTest
Change-Id: I7b8684fb1cf03d41872a700fd8732c76422e37c3
This commit is contained in:
@@ -146,16 +146,16 @@ public class AccessibilitySettingsTest {
|
||||
@Test
|
||||
@Config(shadows = {ShadowDeviceConfig.class})
|
||||
public void isRampingRingerEnabled_settingsFlagOn_Enabled() {
|
||||
Settings.Global.putInt(
|
||||
mContext.getContentResolver(), Settings.Global.APPLY_RAMPING_RINGER, ON);
|
||||
Settings.System.putInt(
|
||||
mContext.getContentResolver(), Settings.System.APPLY_RAMPING_RINGER, ON);
|
||||
assertThat(AccessibilitySettings.isRampingRingerEnabled(mContext)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = {ShadowDeviceConfig.class})
|
||||
public void isRampingRingerEnabled_settingsFlagOff_Disabled() {
|
||||
Settings.Global.putInt(
|
||||
mContext.getContentResolver(), Settings.Global.APPLY_RAMPING_RINGER, OFF);
|
||||
Settings.System.putInt(
|
||||
mContext.getContentResolver(), Settings.System.APPLY_RAMPING_RINGER, OFF);
|
||||
assertThat(AccessibilitySettings.isRampingRingerEnabled(mContext)).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,17 +50,17 @@ public class RingVibrationPreferenceFragmentTest {
|
||||
@Config(shadows = {ShadowDeviceConfig.class})
|
||||
public void getVibrationEnabledSetting_rampingRingerEnabled_returnApplyRampingRinger() {
|
||||
// Turn on both flags to enable ramping ringer.
|
||||
Settings.Global.putInt(
|
||||
mContext.getContentResolver(), Settings.Global.APPLY_RAMPING_RINGER, 1 /* ON */);
|
||||
Settings.System.putInt(
|
||||
mContext.getContentResolver(), Settings.System.APPLY_RAMPING_RINGER, 1 /* ON */);
|
||||
assertThat(mFragment.getVibrationEnabledSetting()).isEqualTo(
|
||||
Settings.Global.APPLY_RAMPING_RINGER);
|
||||
Settings.System.APPLY_RAMPING_RINGER);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getVibrationEnabledSetting_rampingRingerDisabled_returnVibrationWhenRinging() {
|
||||
// Turn off Settings.Global.APPLY_RAMPING_RINGER to disable ramping ringer.
|
||||
Settings.Global.putInt(
|
||||
mContext.getContentResolver(), Settings.Global.APPLY_RAMPING_RINGER, 0 /* OFF */);
|
||||
// Turn off Settings.System.APPLY_RAMPING_RINGER to disable ramping ringer.
|
||||
Settings.System.putInt(
|
||||
mContext.getContentResolver(), Settings.System.APPLY_RAMPING_RINGER, 0 /* OFF */);
|
||||
assertThat(mFragment.getVibrationEnabledSetting()).isEqualTo(
|
||||
Settings.System.VIBRATE_WHEN_RINGING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user