use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class ZenModePrioritySendersPreferenceControllerTest method clickContactsSenders.
@Test
public void clickContactsSenders() {
// GIVEN current priority message senders are ANY
when(mZenBackend.getPriorityMessageSenders()).thenReturn(PRIORITY_SENDERS_ANY);
// WHEN user clicks the contacts only option
RadioButtonPreference contactsRb = getButton(KEY_CONTACTS);
contactsRb.onClick();
// THEN contacts gets saved as priority senders for messages
verify(mZenBackend).saveSenders(PRIORITY_CATEGORY_MESSAGES, PRIORITY_SENDERS_CONTACTS);
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class ZenModePrioritySendersPreferenceControllerTest method clickAnySenders.
@Test
public void clickAnySenders() {
// GIVEN current priority message senders are STARRED
when(mZenBackend.getPriorityMessageSenders()).thenReturn(PRIORITY_SENDERS_STARRED);
// WHEN user clicks the any senders option
RadioButtonPreference allSendersRb = getButton(KEY_ANY);
allSendersRb.onClick();
// THEN any senders gets saved as priority senders for messages
verify(mZenBackend).saveSenders(PRIORITY_CATEGORY_MESSAGES, PRIORITY_SENDERS_ANY);
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class WebViewAppPickerTest method testEnabledPackageShowsEmptySummary.
@Test
public void testEnabledPackageShowsEmptySummary() {
DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mContext, mContext.getPackageManager(), createApplicationInfo(PACKAGE_NAME), null);
RadioButtonPreference preference = mock(RadioButtonPreference.class);
mPicker.bindPreference(preference, PACKAGE_NAME, webviewAppInfo, null);
mPicker.bindPreferenceExtra(preference, PACKAGE_NAME, webviewAppInfo, null, null);
verify(preference, never()).setSummary(any());
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class PreventRingingGesturePreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mResources = mock(Resources.class);
when(mContext.getResources()).thenReturn(mResources);
when(mResources.getBoolean(com.android.internal.R.bool.config_volumeHushGestureEnabled)).thenReturn(true);
mController = new PreventRingingGesturePreferenceController(mContext, null);
mController.mPreferenceCategory = new PreferenceCategory(mContext);
mController.mVibratePref = new RadioButtonPreference(mContext);
mController.mMutePref = new RadioButtonPreference(mContext);
}
use of com.android.settingslib.widget.RadioButtonPreference in project android_packages_apps_Settings by omnirom.
the class PreventRingingGesturePreferenceControllerTest method testRadioButtonClicked_mute.
@Test
public void testRadioButtonClicked_mute() {
RadioButtonPreference rbPref = new RadioButtonPreference(mContext);
rbPref.setKey(PreventRingingGesturePreferenceController.KEY_MUTE);
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE, Settings.Secure.VOLUME_HUSH_OFF);
mController.onRadioButtonClicked(rbPref);
assertThat(Settings.Secure.VOLUME_HUSH_MUTE).isEqualTo(Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE, Settings.Secure.VOLUME_HUSH_OFF));
}
Aggregations