Home
last modified time | relevance | path

Searched refs:mSwitchPreference (Results 1 – 25 of 25) sorted by relevance

/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/
DBluetoothStateSwitchPreferenceControllerTest.java51 private SwitchPreference mSwitchPreference; field in BluetoothStateSwitchPreferenceControllerTest
73 mSwitchPreference = new ClickableWhileDisabledSwitchPreference(mContext); in setUp()
76 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
101 assertThat(mSwitchPreference.isChecked()).isEqualTo( in onStart_initializesSwitchState()
109 mSwitchPreference.setChecked(false); in switchClicked_disabled_checksAndDisablesSwitch()
112 mSwitchPreference.performClick(); in switchClicked_disabled_checksAndDisablesSwitch()
114 assertThat(mSwitchPreference.isChecked()).isTrue(); in switchClicked_disabled_checksAndDisablesSwitch()
115 assertThat(mSwitchPreference.isEnabled()).isFalse(); in switchClicked_disabled_checksAndDisablesSwitch()
122 mSwitchPreference.setChecked(true); in switchClicked_enabled_unchecksAndDisablesSwitch()
125 mSwitchPreference.performClick(); in switchClicked_enabled_unchecksAndDisablesSwitch()
[all …]
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbDetailsPowerRoleController.java41 private SwitchPreference mSwitchPreference; field in UsbDetailsPowerRoleController
47 mSwitchPreference.setSummary(R.string.usb_switching_failed);
62 mSwitchPreference = new SwitchPreference(mPreferenceCategory.getContext()); in displayPreference()
63 mSwitchPreference.setTitle(R.string.usb_use_power_only); in displayPreference()
64 mSwitchPreference.setOnPreferenceClickListener(this); in displayPreference()
65 mPreferenceCategory.addPreference(mSwitchPreference); in displayPreference()
77 mSwitchPreference.setChecked(true); in refresh()
80 mSwitchPreference.setChecked(false); in refresh()
85 mSwitchPreference.setSummary(""); in refresh()
93 mSwitchPreference.setSummary(""); in refresh()
[all …]
DUsbDetailsTranscodeMtpController.java43 private SwitchPreference mSwitchPreference; field in UsbDetailsTranscodeMtpController
55 mSwitchPreference = new SwitchPreference(mPreferenceCategory.getContext()); in displayPreference()
56 mSwitchPreference.setTitle(R.string.usb_transcode_files); in displayPreference()
57 mSwitchPreference.setOnPreferenceClickListener(this); in displayPreference()
58 mSwitchPreference.setSummaryOn(R.string.usb_transcode_files_summary); in displayPreference()
59 mPreferenceCategory.addPreference(mSwitchPreference); in displayPreference()
70 mSwitchPreference.setChecked( in refresh()
79 Boolean.toString(mSwitchPreference.isChecked())); in onPreferenceClick()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/wifi/
DWifiTetheringHandlerTest.java55 private SwitchPreference mSwitchPreference; field in WifiTetheringHandlerTest
77 mSwitchPreference = new ColoredSwitchPreference(mContext); in setUp()
85 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
127 mSwitchPreference.setEnabled(true); in onTetherEnabling_shouldReturnSwitchStateDisabled()
132 assertThat(mSwitchPreference.isEnabled()).isFalse(); in onTetherEnabling_shouldReturnSwitchStateDisabled()
137 mSwitchPreference.setEnabled(false); in onTetherEnabled_shouldReturnSwitchStateEnabledAndOn()
138 mSwitchPreference.setChecked(false); in onTetherEnabled_shouldReturnSwitchStateEnabledAndOn()
143 assertThat(mSwitchPreference.isEnabled()).isTrue(); in onTetherEnabled_shouldReturnSwitchStateEnabledAndOn()
144 assertThat(mSwitchPreference.isChecked()).isTrue(); in onTetherEnabled_shouldReturnSwitchStateEnabledAndOn()
149 mSwitchPreference.setEnabled(false); in onTetherDisabled_shouldReturnSwitchStateEnabledAndOff()
[all …]
DWifiStateSwitchPreferenceControllerTest.java45 private SwitchPreference mSwitchPreference; field in WifiStateSwitchPreferenceControllerTest
62 mSwitchPreference = new ClickableWhileDisabledSwitchPreference(mContext); in setUp()
67 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
75 assertThat(mSwitchPreference.isChecked()).isFalse(); in onWifiStateChanged_disabled_setsSwitchUnchecked()
83 assertThat(mSwitchPreference.isChecked()).isTrue(); in onWifiStateChanged_enabled_setsSwitchChecked()
91 assertThat(mSwitchPreference.isChecked()).isTrue(); in onWifiStateChanged_enabling_setsSwitchChecked()
101 assertThat(mSwitchPreference.isEnabled()).isTrue(); in onPolicyChanged_enabled_setsSwitchEnabled()
111 assertThat(mSwitchPreference.isEnabled()).isFalse(); in onPolicyChanged_disabled_setsSwitchDisabled()
116 mSwitchPreference.setChecked(checked); in initializePreference()
117 mSwitchPreference.setEnabled(enabled); in initializePreference()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/location/
DLocationStateSwitchPreferenceControllerTest.java53 private SwitchPreference mSwitchPreference; field in LocationStateSwitchPreferenceControllerTest
73 mSwitchPreference = new ClickableWhileDisabledSwitchPreference(mContext); in setUp()
76 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
91 assertThat(mSwitchPreference.isChecked()).isTrue(); in onIntentReceived_updateUi()
98 mSwitchPreference.performClick(); in onPreferenceClicked_locationDisabled_shouldEnable()
100 assertThat(mSwitchPreference.isChecked()).isTrue(); in onPreferenceClicked_locationDisabled_shouldEnable()
108 mSwitchPreference.performClick(); in onPreferenceClicked_locationEnabled_shouldDisable()
110 assertThat(mSwitchPreference.isChecked()).isFalse(); in onPreferenceClicked_locationEnabled_shouldDisable()
121 assertThat(mSwitchPreference.isEnabled()).isTrue(); in onPolicyChanged_enabled_setsSwitchEnabled()
131 assertThat(mSwitchPreference.isEnabled()).isFalse(); in onPolicyChanged_disabled_setsSwitchDisabled()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/wifi/preferences/
DWifiWakeupTogglePreferenceControllerTest.java64 private SwitchPreference mSwitchPreference; field in WifiWakeupTogglePreferenceControllerTest
89 mSwitchPreference = new ColoredSwitchPreference(mContext); in setUp()
93 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
112 mSwitchPreference.performClick(); in handlePreferenceClicked_locationDisabled_launchFragment()
124 mSwitchPreference.performClick(); in handlePreferenceClicked_wifiWakeupEnabled_disablesWifiWakeup()
139 mSwitchPreference.performClick(); in handlePreferenceClicked_wifiScanningDisabled_showsDialog()
153 mSwitchPreference.performClick(); in handlePreferenceClicked_wifiScanningEnabled_wifiWakeupDisabled_enablesWifiWakeup()
166 mSwitchPreference.setChecked(false); in onCreate_wifiWakeupEnabled_wifiScanningEnabled_locationEnabled_isChecked()
169 assertThat(mSwitchPreference.isChecked()).isTrue(); in onCreate_wifiWakeupEnabled_wifiScanningEnabled_locationEnabled_isChecked()
178 mSwitchPreference.setChecked(true); in onCreate_wifiWakeupDisabled_wifiScanningEnabled_locationEnabled_isNotChecked()
[all …]
DCellularFallbackTogglePreferenceControllerTest.java44 private SwitchPreference mSwitchPreference; field in CellularFallbackTogglePreferenceControllerTest
59 mSwitchPreference = new SwitchPreference(mContext); in setUp()
62 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
70 mSwitchPreference.setChecked(true); in refreshUi_unchecked()
73 assertThat(mSwitchPreference.isChecked()).isFalse(); in refreshUi_unchecked()
80 mSwitchPreference.setChecked(false); in refreshUi_checked()
83 assertThat(mSwitchPreference.isChecked()).isTrue(); in refreshUi_checked()
91 mSwitchPreference.callChangeListener(false); in handlePreferenceChanged_toggleFalse_setsNull()
101 mSwitchPreference.callChangeListener(true); in handlePreferenceChanged_toggleTrue_setsEnabled()
/packages/apps/Settings/tests/robotests/src/com/android/settings/display/
DAmbientDisplayNotificationsPreferenceControllerTest.java58 private SwitchPreference mSwitchPreference; field in AmbientDisplayNotificationsPreferenceControllerTest
83 mController.updateState(mSwitchPreference); in updateState_enabled()
85 verify(mSwitchPreference).setChecked(true); in updateState_enabled()
92 mController.updateState(mSwitchPreference); in updateState_disabled()
94 verify(mSwitchPreference).setChecked(false); in updateState_disabled()
99 mController.onPreferenceChange(mSwitchPreference, true); in onPreferenceChange_enable()
107 mController.onPreferenceChange(mSwitchPreference, false); in onPreferenceChange_disable()
143 when(mSwitchPreference.getKey()).thenReturn( in handlePreferenceTreeClick_reportsEventForItsPreference()
146 mController.handlePreferenceTreeClick(mSwitchPreference); in handlePreferenceTreeClick_reportsEventForItsPreference()
153 when(mSwitchPreference.getKey()).thenReturn("some_other_key"); in handlePreferenceTreeClick_doesntReportEventForOtherPreferences()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/privacy/
DLocationTogglePreferenceControllerTest.java53 private CarUiTwoActionSwitchPreference mSwitchPreference; field in LocationTogglePreferenceControllerTest
76 mSwitchPreference = new CarUiTwoActionSwitchPreference(mContext); in setUp()
79 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
86 mSwitchPreference.performSecondaryActionClick(); in onPreferenceClicked_clickLocationEnabled_shouldDisableLocation()
89 assertThat(mSwitchPreference.isSecondaryActionChecked()).isFalse(); in onPreferenceClicked_clickLocationEnabled_shouldDisableLocation()
96 mSwitchPreference.performSecondaryActionClick(); in onPreferenceClicked_clickMicDisabled_shouldEnableLocation()
99 assertThat(mSwitchPreference.isSecondaryActionChecked()).isTrue(); in onPreferenceClicked_clickMicDisabled_shouldEnableLocation()
109 assertThat(mSwitchPreference.isSecondaryActionChecked()).isTrue(); in onListenerUpdate_locationDisabled_shouldUpdateChecked()
119 assertThat(mSwitchPreference.isSecondaryActionChecked()).isFalse(); in onListenerUpdate_locationEnabled_shouldUpdateChecked()
DMuteMicTogglePreferenceControllerTest.java54 private CarUiTwoActionSwitchPreference mSwitchPreference; field in MuteMicTogglePreferenceControllerTest
75 mSwitchPreference = new CarUiTwoActionSwitchPreference(mContext); in setUp()
79 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
104 mSwitchPreference.performSecondaryActionClick(); in onPreferenceClicked_clickMicEnabled_shouldSetPrivacySensor()
114 assertThat(mSwitchPreference.isSecondaryActionChecked()).isFalse(); in onPreferenceClicked_clickMicEnabled_shouldSetPrivacySensor()
121 mSwitchPreference.performSecondaryActionClick(); in onPreferenceClicked_clickMicDisabled_shouldClearPrivacySensor()
130 assertThat(mSwitchPreference.isSecondaryActionChecked()).isTrue(); in onPreferenceClicked_clickMicDisabled_shouldClearPrivacySensor()
140 assertThat(mSwitchPreference.isSecondaryActionChecked()).isTrue(); in onListenerUpdate_micDisabled_shouldUpdateChecked()
150 assertThat(mSwitchPreference.isSecondaryActionChecked()).isFalse(); in onListenerUpdate_micEnabled_shouldUpdateChecked()
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/tether/
DWifiTetherAutoOffPreferenceControllerTest.java46 private SwitchPreference mSwitchPreference; field in WifiTetherAutoOffPreferenceControllerTest
62 mSwitchPreference = new SwitchPreference(mContext); in setup()
83 mController.updateState(mSwitchPreference); in testUpdateState_settingsOn_toggleOn()
85 assertThat(mSwitchPreference.isChecked()).isTrue(); in testUpdateState_settingsOn_toggleOn()
92 mController.updateState(mSwitchPreference); in testUpdateState_settingsOff_toggleOff()
94 assertThat(mSwitchPreference.isChecked()).isFalse(); in testUpdateState_settingsOff_toggleOff()
99 mController.updateState(mSwitchPreference); in testUpdateState_toggleDefaultOn()
101 assertThat(mSwitchPreference.isChecked()).isTrue(); in testUpdateState_toggleDefaultOn()
/packages/apps/Settings/tests/unit/src/com/android/settings/network/telephony/gsm/
DAutoSelectPreferenceControllerTest.java69 private SwitchPreference mSwitchPreference; field in AutoSelectPreferenceControllerTest
90 mSwitchPreference = new SwitchPreference(mContext); in setUp()
93 mController.mSwitchPreference = mSwitchPreference; in setUp()
119 mController.updateState(mSwitchPreference); in updateState_isRoaming_enabled()
121 assertThat(mSwitchPreference.isEnabled()).isTrue(); in updateState_isRoaming_enabled()
129 mController.updateState(mSwitchPreference); in updateState_notRoamingWithAutoSelectOn_disabled()
131 assertThat(mSwitchPreference.isEnabled()).isFalse(); in updateState_notRoamingWithAutoSelectOn_disabled()
132 assertThat(mSwitchPreference.getSummary()).isEqualTo( in updateState_notRoamingWithAutoSelectOn_disabled()
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/accounts/
DAccountAutoSyncPreferenceControllerTest.java55 private SwitchPreference mSwitchPreference; field in AccountAutoSyncPreferenceControllerTest
64 mSwitchPreference = new SwitchPreference(application); in setUp()
66 AccountAutoSyncPreferenceController.class, mSwitchPreference); in setUp()
87 assertThat(mSwitchPreference.isChecked()).isTrue(); in refreshUi_masterSyncOn_preferenceShouldBeChecked()
97 assertThat(mSwitchPreference.isChecked()).isFalse(); in refreshUi_masterSyncOff_preferenceShouldNotBeChecked()
102 mSwitchPreference.performClick(); in onPreferenceClicked_shouldOpenDialog()
115 assertThat(mSwitchPreference.isChecked()).isFalse(); in onConfirm_shouldTogglePreference()
122 assertThat(mSwitchPreference.isChecked()).isTrue(); in onConfirm_shouldTogglePreference()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/applications/
DHideSystemSwitchPreferenceControllerTest.java45 private SwitchPreference mSwitchPreference; field in HideSystemSwitchPreferenceControllerTest
64 mSwitchPreference = new ColoredSwitchPreference(mContext); in setUp()
67 PreferenceControllerTestUtil.assignPreference(mPreferenceController, mSwitchPreference); in setUp()
82 assertThat(mSwitchPreference.isChecked()).isTrue(); in onStart_sharedPreferenceTrue_switchChecked()
92 assertThat(mSwitchPreference.isChecked()).isFalse(); in onStart_sharedPreferenceFalse_switchUnchecked()
102 mSwitchPreference.performClick(); in onPreferenceClicked_sharedPreferenceToggled()
106 mSwitchPreference.performClick(); in onPreferenceClicked_sharedPreferenceToggled()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DDataDuringCallsPreferenceControllerTest.java66 private SwitchPreference mSwitchPreference; field in DataDuringCallsPreferenceControllerTest
75 mSwitchPreference = new SwitchPreference(mContext); in setUp()
76 when(mPreferenceScreen.findPreference(PREF_KEY)).thenReturn(mSwitchPreference); in setUp()
99 assertThat(mSwitchPreference.isVisible()).isFalse(); in displayPreference_defaultForData_notAvailable()
109 assertThat(mSwitchPreference.isVisible()).isTrue(); in displayPreference_notDefaultForData_available()
121 assertThat(mSwitchPreference.isVisible()).isFalse(); in onSubscriptionsChanged_becomesDefaultForData_notAvailable()
133 assertThat(mSwitchPreference.isVisible()).isTrue(); in onSubscriptionsChanged_noLongerDefaultForData_available()
DUsbTetherPreferenceControllerTest.java51 private SwitchPreference mSwitchPreference; field in UsbTetherPreferenceControllerTest
62 mSwitchPreference = spy(SwitchPreference.class); in setUp()
63 ReflectionHelpers.setField(mController, "mPreference", mSwitchPreference); in setUp()
DBluetoothTetherPreferenceControllerTest.java50 private SwitchPreference mSwitchPreference; field in BluetoothTetherPreferenceControllerTest
59 mSwitchPreference = spy(SwitchPreference.class); in setUp()
64 ReflectionHelpers.setField(mController, "mPreference", mSwitchPreference); in setUp()
/packages/apps/Settings/src/com/android/settings/dream/
DStartNowPreferenceController.java50 mSwitchPreference.setChecked(false); in updateState()
51 mSwitchPreference.setEnabled(mBackend.getWhenToDreamSetting() != DreamBackend.NEVER); in updateState()
62 if (mSwitchPreference != null) { in setChecked()
63 mMetricsFeatureProvider.logClickedPreference(mSwitchPreference, in setChecked()
64 mSwitchPreference.getExtras().getInt(DashboardFragment.CATEGORY)); in setChecked()
/packages/apps/Settings/src/com/android/settings/network/telephony/gsm/
DAutoSelectPreferenceController.java74 SwitchPreference mSwitchPreference; field in AutoSelectPreferenceController
92 if (mSwitchPreference != null) { in updatePreference()
93 updateState(mSwitchPreference); in updatePreference()
118 mSwitchPreference = screen.findPreference(getPreferenceKey()); in displayPreference()
172 mSwitchPreference.setEnabled(false); in setAutomaticSelectionMode()
181 mSwitchPreference.setEnabled(true); in setAutomaticSelectionMode()
182 mSwitchPreference.setChecked( in setAutomaticSelectionMode()
/packages/apps/Settings/src/com/android/settings/widget/
DSettingsMainSwitchPreferenceController.java35 protected MainSwitchPreference mSwitchPreference; field in SettingsMainSwitchPreferenceController
46 mSwitchPreference = (MainSwitchPreference) pref; in displayPreference()
47 mSwitchPreference.addOnSwitchChangeListener(this); in displayPreference()
53 mSwitchPreference.setChecked(isChecked); in onSwitchChanged()
/packages/apps/Settings/tests/robotests/src/com/android/settings/accessibility/
DFloatingMenuFadePreferenceControllerTest.java61 private final SwitchPreference mSwitchPreference = new SwitchPreference(mContext); field in FloatingMenuFadePreferenceControllerTest
91 mController.updateState(mSwitchPreference); in updateState_keyFloatingMenuFadeDisabled_fadeIsDisabled()
93 assertThat(mSwitchPreference.isChecked()).isFalse(); in updateState_keyFloatingMenuFadeDisabled_fadeIsDisabled()
98 mController.onPreferenceChange(mSwitchPreference, Boolean.TRUE); in onPreferenceChange_floatingMenuFadeEnabled_keyFloatingMenuFadeIsOn()
107 mController.mPreference = mSwitchPreference; in onChange_floatingMenuFadeChangeToDisabled_preferenceDisabled()
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/managedomainurls/
DInstantAppWebActionPreferenceControllerTest.java50 private SwitchPreference mSwitchPreference; field in InstantAppWebActionPreferenceControllerTest
58 mSwitchPreference = new SwitchPreference(mContext); in setUp()
85 mController.onPreferenceChange(mSwitchPreference, true); in onPreferenceChange_enable()
93 mController.onPreferenceChange(mSwitchPreference, false); in onPreferenceChange_disable()
/packages/apps/Settings/src/com/android/settings/network/telephony/
DRoamingPreferenceController.java47 private RestrictedSwitchPreference mSwitchPreference; field in RoamingPreferenceController
74 updateState(mSwitchPreference); in onStart()
88 updateState(mSwitchPreference); in onStart()
102 mSwitchPreference = screen.findPreference(getPreferenceKey()); in displayPreference()
/packages/apps/Settings/src/com/android/settings/notification/
DBubbleNotificationPreferenceController.java61 if (mSwitchPreference != null) { in displayPreference()
62 mSettingObserver = new SettingObserver(mSwitchPreference); in displayPreference()