use of androidx.preference.SwitchPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenModeAlarmsPreferenceControllerTest method updateState_AlarmsOnly.
@Test
public void updateState_AlarmsOnly() {
Settings.Global.putInt(mContentResolver, ZEN_MODE, ZEN_MODE_ALARMS);
final SwitchPreference mockPref = mock(SwitchPreference.class);
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
verify(mockPref).setChecked(true);
}
use of androidx.preference.SwitchPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenModeRemindersPreferenceControllerTest method updateState_AlarmsOnly.
@Test
public void updateState_AlarmsOnly() {
Settings.Global.putInt(mContentResolver, ZEN_MODE, ZEN_MODE_ALARMS);
final SwitchPreference mockPref = mock(SwitchPreference.class);
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
verify(mockPref).setChecked(false);
}
use of androidx.preference.SwitchPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenModeRepeatCallersPreferenceControllerTest method updateState_TotalSilence.
@Test
public void updateState_TotalSilence() {
Settings.Global.putInt(mContentResolver, ZEN_MODE, ZEN_MODE_NO_INTERRUPTIONS);
final SwitchPreference mockPref = mock(SwitchPreference.class);
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
verify(mockPref).setChecked(false);
}
use of androidx.preference.SwitchPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PowerButtonInstantLockPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mFeatureFactory = FakeFeatureFactory.setupForTest();
when(mFeatureFactory.securityFeatureProvider.getTrustAgentManager()).thenReturn(mTrustAgentManager);
mPreference = new SwitchPreference(mContext);
mController = new PowerButtonInstantLockPreferenceController(mContext, TEST_USER_ID, mLockPatternUtils);
}
use of androidx.preference.SwitchPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AutoSyncDataPreferenceControllerTest method autoSyncData_shouldNotBeSetOnCancel.
@Test
public void autoSyncData_shouldNotBeSetOnCancel() {
final Context context = RuntimeEnvironment.application;
final SwitchPreference preference = new SwitchPreference(context);
preference.setChecked(false);
mController = new AutoSyncDataPreferenceController(context, mFragment);
mConfirmSyncFragment.mPreference = preference;
mConfirmSyncFragment.mEnabling = true;
mConfirmSyncFragment.onClick(null, DialogInterface.BUTTON_NEGATIVE);
assertThat(preference.isChecked()).isFalse();
}
Aggregations