/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/ |
D | BluetoothStateSwitchPreferenceControllerTest.java | 51 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/ |
D | UsbDetailsPowerRoleController.java | 41 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 …]
|
D | UsbDetailsTranscodeMtpController.java | 43 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/ |
D | WifiTetheringHandlerTest.java | 55 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 …]
|
D | WifiStateSwitchPreferenceControllerTest.java | 45 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/ |
D | LocationStateSwitchPreferenceControllerTest.java | 53 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/ |
D | WifiWakeupTogglePreferenceControllerTest.java | 64 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 …]
|
D | CellularFallbackTogglePreferenceControllerTest.java | 44 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/ |
D | AmbientDisplayNotificationsPreferenceControllerTest.java | 58 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/ |
D | LocationTogglePreferenceControllerTest.java | 53 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()
|
D | MuteMicTogglePreferenceControllerTest.java | 54 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/ |
D | WifiTetherAutoOffPreferenceControllerTest.java | 46 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/ |
D | AutoSelectPreferenceControllerTest.java | 69 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/ |
D | AccountAutoSyncPreferenceControllerTest.java | 55 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/ |
D | HideSystemSwitchPreferenceControllerTest.java | 45 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/ |
D | DataDuringCallsPreferenceControllerTest.java | 66 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()
|
D | UsbTetherPreferenceControllerTest.java | 51 private SwitchPreference mSwitchPreference; field in UsbTetherPreferenceControllerTest 62 mSwitchPreference = spy(SwitchPreference.class); in setUp() 63 ReflectionHelpers.setField(mController, "mPreference", mSwitchPreference); in setUp()
|
D | BluetoothTetherPreferenceControllerTest.java | 50 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/ |
D | StartNowPreferenceController.java | 50 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/ |
D | AutoSelectPreferenceController.java | 74 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/ |
D | SettingsMainSwitchPreferenceController.java | 35 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/ |
D | FloatingMenuFadePreferenceControllerTest.java | 61 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/ |
D | InstantAppWebActionPreferenceControllerTest.java | 50 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/ |
D | RoamingPreferenceController.java | 47 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/ |
D | BubbleNotificationPreferenceController.java | 61 if (mSwitchPreference != null) { in displayPreference() 62 mSettingObserver = new SettingObserver(mSwitchPreference); in displayPreference()
|