/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/wifi/tether/ |
D | WifiTetherSwitchBarController.java | 45 private final SwitchWidgetController mSwitchBar; field in WifiTetherSwitchBarController 57 mSwitchBar.setChecked(false); 68 mSwitchBar = switchBar; in WifiTetherSwitchBarController() 73 mSwitchBar.setChecked(mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED); in WifiTetherSwitchBarController() 74 mSwitchBar.setListener(this); in WifiTetherSwitchBarController() 81 mSwitchBar.startListening(); in onStart() 88 mSwitchBar.stopListening(); in onStop() 103 mSwitchBar.setEnabled(false); in stopTether() 108 mSwitchBar.setEnabled(false); in startTether() 128 mSwitchBar.setEnabled(false); in handleWifiApStateChanged() [all …]
|
/packages/apps/Settings/src/com/android/settings/wifi/tether/ |
D | WifiTetherSwitchBarController.java | 45 private final SwitchWidgetController mSwitchBar; field in WifiTetherSwitchBarController 57 mSwitchBar.setChecked(false); 68 mSwitchBar = switchBar; in WifiTetherSwitchBarController() 73 mSwitchBar.setChecked(mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED); in WifiTetherSwitchBarController() 74 mSwitchBar.setListener(this); in WifiTetherSwitchBarController() 81 mSwitchBar.startListening(); in onStart() 88 mSwitchBar.stopListening(); in onStop() 103 mSwitchBar.setEnabled(false); in stopTether() 108 mSwitchBar.setEnabled(false); in startTether() 128 mSwitchBar.setEnabled(false); in handleWifiApStateChanged() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/telephony/ |
D | MobileNetworkSwitchControllerTest.java | 68 private SwitchBar mSwitchBar; field in MobileNetworkSwitchControllerTest 93 mSwitchBar = new SwitchBar(mContext); in setUp() 95 when(mLayoutPreference.findViewById(R.id.switch_bar)).thenReturn(mSwitchBar); in setUp() 107 assertThat(mSwitchBar.isShowing()).isFalse(); in isAvailable_pSIM_isNotAvailable() 115 assertThat(mSwitchBar.isShowing()).isTrue(); in displayPreference_oneEnabledSubscription_switchBarNotHidden() 123 assertThat(mSwitchBar.isShowing()).isTrue(); in displayPreference_oneDisabledSubscription_switchBarNotHidden() 130 assertThat(mSwitchBar.isShowing()).isTrue(); in displayPreference_subscriptionEnabled_switchIsOn() 131 assertThat(mSwitchBar.isChecked()).isTrue(); in displayPreference_subscriptionEnabled_switchIsOn() 138 assertThat(mSwitchBar.isShowing()).isTrue(); in displayPreference_subscriptionDisabled_switchIsOff() 139 assertThat(mSwitchBar.isChecked()).isFalse(); in displayPreference_subscriptionDisabled_switchIsOff() [all …]
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/widget/ |
D | SwitchBarController.java | 29 private final SwitchBar mSwitchBar; field in SwitchBarController 32 mSwitchBar = switchBar; in SwitchBarController() 37 mSwitchBar.show(); in setupView() 42 mSwitchBar.hide(); in teardownView() 47 mSwitchBar.setTextViewLabelAndBackground(isChecked); in updateTitle() 52 mSwitchBar.addOnSwitchChangeListener(this); in startListening() 57 mSwitchBar.removeOnSwitchChangeListener(this); in stopListening() 62 mSwitchBar.setChecked(checked); in setChecked() 67 return mSwitchBar.isChecked(); in isChecked() 72 mSwitchBar.setEnabled(enabled); in setEnabled() [all …]
|
/packages/apps/Settings/src/com/android/settings/widget/ |
D | SwitchBarController.java | 29 private final SwitchBar mSwitchBar; field in SwitchBarController 32 mSwitchBar = switchBar; in SwitchBarController() 37 mSwitchBar.show(); in setupView() 42 mSwitchBar.hide(); in teardownView() 47 mSwitchBar.setTextViewLabelAndBackground(isChecked); in updateTitle() 52 mSwitchBar.addOnSwitchChangeListener(this); in startListening() 57 mSwitchBar.removeOnSwitchChangeListener(this); in stopListening() 62 mSwitchBar.setChecked(checked); in setChecked() 67 return mSwitchBar.isChecked(); in isChecked() 72 mSwitchBar.setEnabled(enabled); in setEnabled() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/gamedriver/ |
D | GameDriverGlobalSwitchBarControllerTest.java | 45 private SwitchBar mSwitchBar; field in GameDriverGlobalSwitchBarControllerTest 67 mContext, new SwitchBarController(mSwitchBar)); in constructor_gameDriverOn_shouldCheckSwitchBar() 69 verify(mSwitchBar).setChecked(true); in constructor_gameDriverOn_shouldCheckSwitchBar() 76 mContext, new SwitchBarController(mSwitchBar)); in constructor_gameDriverOff_shouldUncheckSwitchBar() 78 verify(mSwitchBar).setChecked(false); in constructor_gameDriverOff_shouldUncheckSwitchBar() 85 mContext, new SwitchBarController(mSwitchBar)); in constructor_developmentSettingsEnabled_shouldEnableSwitchBar() 87 verify(mSwitchBar).setEnabled(true); in constructor_developmentSettingsEnabled_shouldEnableSwitchBar() 94 mContext, new SwitchBarController(mSwitchBar)); in constructor_developmentSettingsDisabled_shouldDisableSwitchBar() 96 verify(mSwitchBar).setEnabled(false); in constructor_developmentSettingsDisabled_shouldDisableSwitchBar() 102 mContext, new SwitchBarController(mSwitchBar)); in onStart_shouldStartListeningAndRegister() [all …]
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/nfc/ |
D | AndroidBeam.java | 49 private SwitchBar mSwitchBar; field in AndroidBeam 103 mSwitchBar = activity.getSwitchBar(); in onActivityCreated() 105 mSwitchBar.hide(); in onActivityCreated() 107 mSwitchBar.setChecked(!mBeamDisallowedByBase && mNfcAdapter.isNdefPushEnabled()); in onActivityCreated() 108 mSwitchBar.addOnSwitchChangeListener(this); in onActivityCreated() 109 mSwitchBar.setEnabled(!mBeamDisallowedByBase); in onActivityCreated() 110 mSwitchBar.show(); in onActivityCreated() 123 mSwitchBar.removeOnSwitchChangeListener(this); in onDestroyView() 124 mSwitchBar.hide(); in onDestroyView() 131 mSwitchBar.setEnabled(false); in onSwitchChanged() [all …]
|
/packages/apps/Settings/src/com/android/settings/nfc/ |
D | AndroidBeam.java | 49 private SwitchBar mSwitchBar; field in AndroidBeam 103 mSwitchBar = activity.getSwitchBar(); in onActivityCreated() 105 mSwitchBar.hide(); in onActivityCreated() 107 mSwitchBar.setChecked(!mBeamDisallowedByBase && mNfcAdapter.isNdefPushEnabled()); in onActivityCreated() 108 mSwitchBar.addOnSwitchChangeListener(this); in onActivityCreated() 109 mSwitchBar.setEnabled(!mBeamDisallowedByBase); in onActivityCreated() 110 mSwitchBar.show(); in onActivityCreated() 123 mSwitchBar.removeOnSwitchChangeListener(this); in onDestroyView() 124 mSwitchBar.hide(); in onDestroyView() 131 mSwitchBar.setEnabled(false); in onSwitchChanged() [all …]
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/network/telephony/ |
D | MobileNetworkSwitchController.java | 47 private SwitchBar mSwitchBar; field in MobileNetworkSwitchController 79 mSwitchBar = pref.findViewById(R.id.switch_bar); in displayPreference() 80 mSwitchBar.setSwitchBarText(R.string.mobile_network_use_sim_on, in displayPreference() 83 mSwitchBar.addOnSwitchChangeListener((switchView, isChecked) -> { in displayPreference() 86 mSwitchBar.setChecked(!isChecked); in displayPreference() 93 if (mSwitchBar == null) { in update() 99 mSwitchBar.hide(); in update() 105 mSwitchBar.show(); in update() 106 mSwitchBar.setChecked(mSubscriptionManager.isSubscriptionEnabled(mSubId)); in update() 111 mSwitchBar.hide(); in update()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/backup/ |
D | ToggleBackupSettingFragment.java | 44 protected SwitchBar mSwitchBar; field in ToggleBackupSettingFragment 81 mSwitchBar = activity.getSwitchBar(); in onViewCreated() 82 mToggleSwitch = mSwitchBar.getSwitch(); in onViewCreated() 96 mSwitchBar.setCheckedInternal(backupEnabled); in onViewCreated() 99 mSwitchBar.setEnabled(false); in onViewCreated() 109 mSwitchBar.hide(); in onDestroyView() 130 mSwitchBar.setCheckedInternal(true); in onActivityCreated() 135 mSwitchBar.show(); in onActivityCreated() 154 mSwitchBar.setCheckedInternal(false); in onClick() 159 mSwitchBar.setCheckedInternal(true); in onClick() [all …]
|
/packages/apps/Settings/src/com/android/settings/backup/ |
D | ToggleBackupSettingFragment.java | 44 protected SwitchBar mSwitchBar; field in ToggleBackupSettingFragment 81 mSwitchBar = activity.getSwitchBar(); in onViewCreated() 82 mToggleSwitch = mSwitchBar.getSwitch(); in onViewCreated() 96 mSwitchBar.setCheckedInternal(backupEnabled); in onViewCreated() 99 mSwitchBar.setEnabled(false); in onViewCreated() 109 mSwitchBar.hide(); in onDestroyView() 130 mSwitchBar.setCheckedInternal(true); in onActivityCreated() 135 mSwitchBar.show(); in onActivityCreated() 154 mSwitchBar.setCheckedInternal(false); in onClick() 159 mSwitchBar.setCheckedInternal(true); in onClick() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/ |
D | DevelopmentSwitchBarControllerTest.java | 57 private SwitchBar mSwitchBar; field in DevelopmentSwitchBarControllerTest 66 mSwitchBar = new SwitchBar(context); in setUp() 78 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_v2_isMonkeyRun_shouldNotRegisterListener() 81 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_v2_isMonkeyRun_shouldNotRegisterListener() 93 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_isNotMonkeyRun_shouldRegisterAndRemoveListener() 96 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_isNotMonkeyRun_shouldRegisterAndRemoveListener() 109 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_v2_isNotMonkeyRun_shouldRegisterAndRemoveListener() 112 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_v2_isNotMonkeyRun_shouldRegisterAndRemoveListener() 124 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in buildController_unavailable_shouldDisableSwitchBar() 127 assertThat(mSwitchBar.isEnabled()).isFalse(); in buildController_unavailable_shouldDisableSwitchBar()
|
/packages/apps/Settings/src/com/android/settings/location/ |
D | LocationSwitchBarController.java | 30 private final SwitchBar mSwitchBar; field in LocationSwitchBarController 37 mSwitchBar = switchBar; in LocationSwitchBarController() 38 mSwitch = mSwitchBar.getSwitch(); in LocationSwitchBarController() 48 mSwitchBar.addOnSwitchChangeListener(this); in onStart() 56 mSwitchBar.removeOnSwitchChangeListener(this); in onStop() 75 mSwitchBar.setDisabledByAdmin(admin); in onLocationModeChanged() 77 mSwitchBar.setEnabled(!restricted); in onLocationModeChanged() 83 mSwitchBar.removeOnSwitchChangeListener(this); in onLocationModeChanged() 87 mSwitchBar.addOnSwitchChangeListener(this); in onLocationModeChanged()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/location/ |
D | LocationSwitchBarController.java | 30 private final SwitchBar mSwitchBar; field in LocationSwitchBarController 37 mSwitchBar = switchBar; in LocationSwitchBarController() 38 mSwitch = mSwitchBar.getSwitch(); in LocationSwitchBarController() 48 mSwitchBar.addOnSwitchChangeListener(this); in onStart() 56 mSwitchBar.removeOnSwitchChangeListener(this); in onStop() 75 mSwitchBar.setDisabledByAdmin(admin); in onLocationModeChanged() 77 mSwitchBar.setEnabled(!restricted); in onLocationModeChanged() 83 mSwitchBar.removeOnSwitchChangeListener(this); in onLocationModeChanged() 87 mSwitchBar.addOnSwitchChangeListener(this); in onLocationModeChanged()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/users/ |
D | MultiUserSwitchBarController.java | 41 final SwitchWidgetController mSwitchBar; field in MultiUserSwitchBarController 51 mSwitchBar = switchBar; in MultiUserSwitchBarController() 54 mSwitchBar.setChecked(mUserCapabilities.mUserSwitcherEnabled); in MultiUserSwitchBarController() 56 Settings.Global.USER_SWITCHER_ENABLED, mSwitchBar.isChecked() ? 1 : 0); in MultiUserSwitchBarController() 59 mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal in MultiUserSwitchBarController() 63 mSwitchBar.setEnabled(!mUserCapabilities.mDisallowSwitchUser in MultiUserSwitchBarController() 66 mSwitchBar.setListener(this); in MultiUserSwitchBarController() 71 mSwitchBar.startListening(); in onStart() 76 mSwitchBar.stopListening(); in onStop()
|
/packages/apps/Settings/src/com/android/settings/users/ |
D | MultiUserSwitchBarController.java | 41 final SwitchWidgetController mSwitchBar; field in MultiUserSwitchBarController 51 mSwitchBar = switchBar; in MultiUserSwitchBarController() 54 mSwitchBar.setChecked(mUserCapabilities.mUserSwitcherEnabled); in MultiUserSwitchBarController() 56 Settings.Global.USER_SWITCHER_ENABLED, mSwitchBar.isChecked() ? 1 : 0); in MultiUserSwitchBarController() 59 mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal in MultiUserSwitchBarController() 63 mSwitchBar.setEnabled(!mUserCapabilities.mDisallowSwitchUser in MultiUserSwitchBarController() 66 mSwitchBar.setListener(this); in MultiUserSwitchBarController() 71 mSwitchBar.startListening(); in onStart() 76 mSwitchBar.stopListening(); in onStop()
|
/packages/apps/Settings/src/com/android/settings/network/telephony/ |
D | MobileNetworkSwitchController.java | 47 private SwitchBar mSwitchBar; field in MobileNetworkSwitchController 79 mSwitchBar = pref.findViewById(R.id.switch_bar); in displayPreference() 80 mSwitchBar.setSwitchBarText(R.string.mobile_network_use_sim_on, in displayPreference() 83 mSwitchBar.addOnSwitchChangeListener((switchView, isChecked) -> { in displayPreference() 88 mSwitchBar.setChecked(!isChecked); in displayPreference() 95 if (mSwitchBar == null) { in update() 110 mSwitchBar.hide(); in update() 112 mSwitchBar.show(); in update() 115 mSwitchBar.setChecked(mSubscriptionManager.isActiveSubId(mSubId)); in update()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/tether/ |
D | WifiTetherSwitchBarControllerTest.java | 58 private SwitchBar mSwitchBar; field in WifiTetherSwitchBarControllerTest 66 mSwitchBar = new SwitchBar(mContext); in setUp() 74 new SwitchBarController(mSwitchBar)); in setUp() 84 assertThat(mSwitchBar.isChecked()).isFalse(); in startTether_fail_resetSwitchBar() 85 assertThat(mSwitchBar.isEnabled()).isTrue(); in startTether_fail_resetSwitchBar() 90 assertThat(mSwitchBar.isEnabled()).isTrue(); in onDataSaverChanged_setsEnabledCorrectly() 95 assertThat(mSwitchBar.isEnabled()).isFalse(); in onDataSaverChanged_setsEnabledCorrectly() 100 assertThat(mSwitchBar.isEnabled()).isTrue(); in onDataSaverChanged_setsEnabledCorrectly()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/notification/ |
D | ZenAutomaticRuleSwitchPreferenceController.java | 39 private SwitchBar mSwitchBar; field in ZenAutomaticRuleSwitchPreferenceController 60 mSwitchBar = pref.findViewById(R.id.switch_bar); in displayPreference() 62 if (mSwitchBar != null) { in displayPreference() 63 mSwitchBar.setSwitchBarText(R.string.zen_mode_use_automatic_rule, in displayPreference() 71 mSwitchBar.addOnSwitchChangeListener(this); in displayPreference() 75 mSwitchBar.show(); in displayPreference() 86 mSwitchBar.setChecked(mRule.isEnabled()); in updateState()
|
/packages/apps/Settings/src/com/android/settings/notification/ |
D | ZenAutomaticRuleSwitchPreferenceController.java | 39 private SwitchBar mSwitchBar; field in ZenAutomaticRuleSwitchPreferenceController 60 mSwitchBar = pref.findViewById(R.id.switch_bar); in displayPreference() 62 if (mSwitchBar != null) { in displayPreference() 63 mSwitchBar.setSwitchBarText(R.string.zen_mode_use_automatic_rule, in displayPreference() 71 mSwitchBar.addOnSwitchChangeListener(this); in displayPreference() 75 mSwitchBar.show(); in displayPreference() 86 mSwitchBar.setChecked(mRule.isEnabled()); in updateState()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/location/ |
D | LocationSwitchBarControllerTest.java | 48 private SwitchBar mSwitchBar; field in LocationSwitchBarControllerTest 63 ReflectionHelpers.setField(mSwitchBar, "mSwitch", mSwitch); in setUp() 66 mController = spy(new LocationSwitchBarController(mContext, mSwitchBar, mLifecycle)); in setUp() 74 verify(mSwitchBar).addOnSwitchChangeListener(mController); in onStart_shouldAddOnSwitchChangeListener() 82 verify(mSwitchBar).removeOnSwitchChangeListener(mController); in onStop_shouldRemoveOnSwitchChangeListener() 108 verify(mSwitchBar).setDisabledByAdmin(admin); in onLocationModeChanged_hasEnforcedAdmin_shouldDisableSwitchByAdmin() 118 verify(mSwitchBar).setEnabled(false); in onLocationModeChanged_Restricted_shouldDisableSwitch() 128 verify(mSwitchBar).setEnabled(true); in onLocationModeChanged_notRestricted_shouldEnableSwitch()
|
/packages/apps/Settings/src/com/android/settings/development/ |
D | DevelopmentSwitchBarController.java | 31 private final SwitchBar mSwitchBar; field in DevelopmentSwitchBarController 37 mSwitchBar = switchBar; in DevelopmentSwitchBarController() 44 mSwitchBar.setEnabled(false); in DevelopmentSwitchBarController() 52 mSwitchBar.setChecked(developmentEnabledState); in onStart() 53 mSwitchBar.addOnSwitchChangeListener(mSettings); in onStart() 58 mSwitchBar.removeOnSwitchChangeListener(mSettings); in onStop()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/development/ |
D | DevelopmentSwitchBarController.java | 31 private final SwitchBar mSwitchBar; field in DevelopmentSwitchBarController 37 mSwitchBar = switchBar; in DevelopmentSwitchBarController() 44 mSwitchBar.setEnabled(false); in DevelopmentSwitchBarController() 52 mSwitchBar.setChecked(developmentEnabledState); in onStart() 53 mSwitchBar.addOnSwitchChangeListener(mSettings); in onStart() 58 mSwitchBar.removeOnSwitchChangeListener(mSettings); in onStop()
|
/packages/apps/Settings/src/com/android/settings/accessibility/ |
D | ToggleFeaturePreferenceFragment.java | 35 protected SwitchBar mSwitchBar; field in ToggleFeaturePreferenceFragment 59 mSwitchBar = activity.getSwitchBar(); in onViewCreated() 60 updateSwitchBarText(mSwitchBar); in onViewCreated() 61 mToggleSwitch = mSwitchBar.getSwitch(); in onViewCreated() 106 mSwitchBar.show(); in installActionBarToggleSwitch() 113 mSwitchBar.hide(); in removeActionBarToggleSwitch() 127 mSwitchBar.setCheckedInternal(enabled); in onProcessArguments()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accessibility/ |
D | ToggleFeaturePreferenceFragment.java | 35 protected SwitchBar mSwitchBar; field in ToggleFeaturePreferenceFragment 59 mSwitchBar = activity.getSwitchBar(); in onViewCreated() 60 updateSwitchBarText(mSwitchBar); in onViewCreated() 61 mToggleSwitch = mSwitchBar.getSwitch(); in onViewCreated() 106 mSwitchBar.show(); in installActionBarToggleSwitch() 113 mSwitchBar.hide(); in removeActionBarToggleSwitch() 127 mSwitchBar.setCheckedInternal(enabled); in onProcessArguments()
|