use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class ZenModePrioritySendersPreferenceControllerTest method clickSameOptionMultipleTimes.
@Test
public void clickSameOptionMultipleTimes() {
// GIVEN current priority message senders are ANY
when(mZenBackend.getPriorityMessageSenders()).thenReturn(PRIORITY_SENDERS_ANY);
// WHEN user clicks the any senders option multiple times again
RadioButtonPreference anySenders = getButton(KEY_ANY);
anySenders.onClick();
anySenders.onClick();
anySenders.onClick();
// THEN no senders are saved because this setting is already in effect
verify(mZenBackend, never()).saveSenders(PRIORITY_CATEGORY_MESSAGES, PRIORITY_SENDERS_ANY);
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class ZenModePrioritySendersPreferenceControllerTest method clickNoSenders.
@Test
public void clickNoSenders() {
// GIVEN current priority message senders are ANY
when(mZenBackend.getPriorityMessageSenders()).thenReturn(PRIORITY_SENDERS_ANY);
// WHEN user clicks the no senders option
RadioButtonPreference noSenders = getButton(KEY_NONE);
noSenders.onClick();
// THEN no senders gets saved as priority senders for messages
verify(mZenBackend).saveSenders(PRIORITY_CATEGORY_MESSAGES, ZenModeBackend.SOURCE_NONE);
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class OneHandedActionPullDownPrefControllerTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mUtils = new OneHandedSettingsUtils(mContext);
mController = new OneHandedActionPullDownPrefController(mContext, KEY);
mPreference = new RadioButtonPreference(mContext);
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class OneHandedActionShowNotificationPrefControllerTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mUtils = new OneHandedSettingsUtils(mContext);
mController = new OneHandedActionShowNotificationPrefController(mContext, KEY);
mPreference = new RadioButtonPreference(mContext);
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class PreventRingingGesturePreferenceControllerTest method testRadioButtonClicked_vibrate.
@Test
public void testRadioButtonClicked_vibrate() {
RadioButtonPreference rbPref = new RadioButtonPreference(mContext);
rbPref.setKey(PreventRingingGesturePreferenceController.KEY_VIBRATE);
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE, Settings.Secure.VOLUME_HUSH_OFF);
mController.onRadioButtonClicked(rbPref);
assertThat(Settings.Secure.VOLUME_HUSH_VIBRATE).isEqualTo(Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE, Settings.Secure.VOLUME_HUSH_OFF));
}
Aggregations