/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/tether/ |
D | WifiTetherSwitchBarControllerTest.java | 70 private SettingsMainSwitchBar mSwitchBar; field in WifiTetherSwitchBarControllerTest 75 mSwitchBar = new SettingsMainSwitchBar(mContext); in setUp() 82 mController = new WifiTetherSwitchBarController(mContext, mSwitchBar); in setUp() 130 assertThat(mSwitchBar.isChecked()).isFalse(); in startTether_fail_resetSwitchBar() 131 assertThat(mSwitchBar.isEnabled()).isTrue(); in startTether_fail_resetSwitchBar() 136 assertThat(mSwitchBar.isEnabled()).isTrue(); in onDataSaverChanged_setsEnabledCorrectly() 141 assertThat(mSwitchBar.isEnabled()).isFalse(); in onDataSaverChanged_setsEnabledCorrectly() 146 assertThat(mSwitchBar.isEnabled()).isTrue(); in onDataSaverChanged_setsEnabledCorrectly() 176 mSwitchBar.setEnabled(false); in handleWifiApStateChanged_stateIsEnabling_notEnabledSwitchBar() 180 assertThat(mSwitchBar.isEnabled()).isFalse(); in handleWifiApStateChanged_stateIsEnabling_notEnabledSwitchBar() [all …]
|
/packages/apps/Settings/src/com/android/settings/location/ |
D | LocationSwitchBarController.java | 35 private final SettingsMainSwitchBar mSwitchBar; field in LocationSwitchBarController 41 mSwitchBar = switchBar; in LocationSwitchBarController() 51 mSwitchBar.addOnSwitchChangeListener(this); in onStart() 59 mSwitchBar.removeOnSwitchChangeListener(this); in onStop() 78 mSwitchBar.setDisabledByAdmin(admin); in onLocationModeChanged() 82 mSwitchBar.setDisabledByAdmin(enforcedAdmin); in onLocationModeChanged() 84 mSwitchBar.setEnabled(true); in onLocationModeChanged() 87 if (enabled != mSwitchBar.isChecked()) { in onLocationModeChanged() 90 mSwitchBar.removeOnSwitchChangeListener(this); in onLocationModeChanged() 92 mSwitchBar.setChecked(enabled); in onLocationModeChanged() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/location/ |
D | LocationSwitchBarControllerTest.java | 49 private SettingsMainSwitchBar mSwitchBar; field in LocationSwitchBarControllerTest 64 ReflectionHelpers.setField(mSwitchBar, "mSwitch", mSwitch); in setUp() 67 mController = spy(new LocationSwitchBarController(mContext, mSwitchBar, mLifecycle)); in setUp() 75 verify(mSwitchBar).addOnSwitchChangeListener(mController); in onStart_shouldAddOnSwitchChangeListener() 83 verify(mSwitchBar).removeOnSwitchChangeListener(mController); in onStop_shouldRemoveOnSwitchChangeListener() 109 verify(mSwitchBar).setDisabledByAdmin(admin); in onLocationModeChanged_hasEnforcedAdmin_shouldDisableSwitchByAdmin() 121 verify(mSwitchBar).setDisabledByAdmin(admin); in onLocationModeChanged_Restricted_shouldDisableSwitchByAdmin() 131 verify(mSwitchBar).setEnabled(true); in onLocationModeChanged_Restricted_shouldDisableSwitch() 141 verify(mSwitchBar).setEnabled(true); in onLocationModeChanged_notRestricted_shouldEnableSwitch() 148 when(mSwitchBar.isChecked()).thenReturn(false); in onLocationModeChanged_locationOn_shouldCheckSwitch() [all …]
|
D | LocationSettingsTest.java | 48 private SettingsMainSwitchBar mSwitchBar; field in LocationSettingsTest 63 when(mActivity.getSwitchBar()).thenReturn(mSwitchBar); in setUp() 70 verify(mSwitchBar).show(); in onActivityCreated_shouldShowSwitchBar()
|
/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() 57 mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal in MultiUserSwitchBarController() 62 mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal in MultiUserSwitchBarController() 66 mSwitchBar.setEnabled(mUserCapabilities.mIsMain); in MultiUserSwitchBarController() 68 mSwitchBar.setListener(this); in MultiUserSwitchBarController() 73 mSwitchBar.startListening(); in onStart() 78 mSwitchBar.stopListening(); in onStop()
|
/packages/apps/Settings/src/com/android/settings/backup/ |
D | ToggleBackupSettingFragment.java | 43 protected SettingsMainSwitchBar mSwitchBar; field in ToggleBackupSettingFragment 79 mSwitchBar = activity.getSwitchBar(); in onViewCreated() 93 mSwitchBar.setCheckedInternal(backupEnabled); in onViewCreated() 96 mSwitchBar.setEnabled(false); in onViewCreated() 105 mSwitchBar.setOnBeforeCheckedChangeListener(null); in onDestroyView() 106 mSwitchBar.hide(); in onDestroyView() 115 mSwitchBar.setOnBeforeCheckedChangeListener( in onActivityCreated() 126 mSwitchBar.setCheckedInternal(true); in onActivityCreated() 131 mSwitchBar.show(); in onActivityCreated() 150 mSwitchBar.setCheckedInternal(false); in onClick() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/ |
D | DevelopmentSwitchBarControllerTest.java | 58 private SettingsMainSwitchBar mSwitchBar; field in DevelopmentSwitchBarControllerTest 67 mSwitchBar = new SettingsMainSwitchBar(context); in setUp() 79 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_v2_isMonkeyRun_shouldNotRegisterListener() 82 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_v2_isMonkeyRun_shouldNotRegisterListener() 94 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_isNotMonkeyRun_shouldRegisterAndRemoveListener() 97 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_isNotMonkeyRun_shouldRegisterAndRemoveListener() 110 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in runThroughLifecycle_v2_isNotMonkeyRun_shouldRegisterAndRemoveListener() 113 ReflectionHelpers.getField(mSwitchBar, "mSwitchChangeListeners"); in runThroughLifecycle_v2_isNotMonkeyRun_shouldRegisterAndRemoveListener() 126 new DevelopmentSwitchBarController(mSettings, mSwitchBar, in buildController_unavailable_shouldDisableSwitchBar() 129 assertThat(mSwitchBar.isEnabled()).isFalse(); in buildController_unavailable_shouldDisableSwitchBar()
|
/packages/apps/Settings/src/com/android/settings/wifi/tether/ |
D | WifiTetherSwitchBarController.java | 56 private final SettingsMainSwitchBar mSwitchBar; field in WifiTetherSwitchBarController 79 mSwitchBar = switchBar; in WifiTetherSwitchBarController() 84 mSwitchBar.setChecked(mWifiManager.getWifiApState() == WIFI_AP_STATE_ENABLED); in WifiTetherSwitchBarController() 91 mSwitchBar.addOnSwitchChangeListener(this); in onStart() 118 mSwitchBar.setEnabled(false); in stopTether() 125 mSwitchBar.setEnabled(false); in startTether() 154 if (mSwitchBar.isChecked() != shouldBeChecked) { in handleWifiApStateChanged() 155 mSwitchBar.setChecked(shouldBeChecked); in handleWifiApStateChanged() 161 mSwitchBar.setEnabled(!mDataSaverBackend.isDataSaverEnabled()); in updateWifiSwitch()
|
/packages/apps/Settings/src/com/android/settings/development/ |
D | DevelopmentSwitchBarController.java | 31 private final SettingsMainSwitchBar 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()
|
D | DevelopmentSettingsDashboardFragment.java | 108 private SettingsMainSwitchBar mSwitchBar; field in DevelopmentSettingsDashboardFragment 197 final boolean switchState = mSwitchBar.isChecked(); 278 mSwitchBar = ((SettingsActivity) getActivity()).getSwitchBar(); in onActivityCreated() 279 mSwitchBar.setTitle(getContext().getString(R.string.developer_options_main_switch_title)); in onActivityCreated() 280 mSwitchBar.show(); in onActivityCreated() 282 this /* DevelopmentSettings */, mSwitchBar, mIsAvailable, in onActivityCreated() 637 mSwitchBar.setChecked(false); in onEnableDevelopmentOptionsRejected() 646 mSwitchBar.setChecked(true); in onDisableDevelopmentOptionsRejected()
|
/packages/apps/Settings/src/com/android/settings/notification/zen/ |
D | ZenAutomaticRuleSwitchPreferenceController.java | 39 private MainSwitchPreference mSwitchBar; field in ZenAutomaticRuleSwitchPreferenceController 65 mSwitchBar = (MainSwitchPreference) pref; in displayPreference() 67 if (mSwitchBar != null) { in displayPreference() 68 mSwitchBar.setTitle(mContext.getString(R.string.zen_mode_use_automatic_rule)); in displayPreference() 75 mSwitchBar.addOnSwitchChangeListener(this); in displayPreference() 84 mSwitchBar.updateStatus(mRule.isEnabled()); in updateState()
|
/packages/apps/Settings/src/com/android/settings/connecteddevice/audiosharing/ |
D | AudioSharingSwitchBarController.java | 93 private final SettingsMainSwitchBar mSwitchBar; field in AudioSharingSwitchBarController 271 mSwitchBar = switchBar; in AudioSharingSwitchBarController() 322 mSwitchBar.setEnabled(false); in onCheckedChanged() 326 mSwitchBar.setEnabled(true); in onCheckedChanged() 328 mSwitchBar.setChecked(false); in onCheckedChanged() 345 mSwitchBar.setEnabled(true); in onCheckedChanged() 346 mSwitchBar.setChecked(false); in onCheckedChanged() 410 mSwitchBar.addOnSwitchChangeListener(this); in registerCallbacks() 428 mSwitchBar.removeOnSwitchChangeListener(this); in unregisterCallbacks() 461 mSwitchBar.setEnabled(false); in stopAudioSharing() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/deletionhelper/ |
D | AutomaticStorageManagerSwitchBarControllerTest.java | 53 private SettingsMainSwitchBar mSwitchBar; field in AutomaticStorageManagerSwitchBarControllerTest 67 mSwitchBar = new SettingsMainSwitchBar(mContext); in setUp() 75 mSwitchBar, in setUp() 131 mSwitchBar, in initializeSwitchOnConstruction() 136 assertThat(mSwitchBar.isChecked()).isTrue(); in initializeSwitchOnConstruction() 146 mSwitchBar = new SettingsMainSwitchBar(mContext); in initializingSwitchDoesNotTriggerView() 150 mSwitchBar, in initializingSwitchDoesNotTriggerView()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/audiosharing/ |
D | AudioSharingSwitchBarControllerTest.java | 133 private SettingsMainSwitchBar mSwitchBar; field in AudioSharingSwitchBarControllerTest 188 mSwitchBar = spy(new SettingsMainSwitchBar(mContext)); in setUp() 189 mSwitchBar.setDisabledByAdmin(mock(RestrictedLockUtils.EnforcedAdmin.class)); in setUp() 204 mController = new AudioSharingSwitchBarController(mContext, mSwitchBar, listener); in setUp() 223 assertThat(mSwitchBar.isEnabled()).isTrue(); in bluetoothOff_switchDisabled() 235 assertThat(mSwitchBar.isEnabled()).isFalse(); in bluetoothOff_switchDisabled() 236 assertThat(mSwitchBar.isChecked()).isFalse(); in bluetoothOff_switchDisabled() 248 assertThat(mSwitchBar.isEnabled()).isTrue(); in onServiceConnected_switchEnabled() 249 assertThat(mSwitchBar.isChecked()).isTrue(); in onServiceConnected_switchEnabled() 299 assertThat(mSwitchBar.isChecked()).isFalse(); in onStart_flagOnProfileNotReady_registerProfileCallback() [all …]
|
D | AudioSharingDashboardFragmentTest.java | 54 @Mock private SettingsMainSwitchBar mSwitchBar; field in AudioSharingDashboardFragmentTest 90 doReturn(mSwitchBar).when(mActivity).getSwitchBar(); in onActivityCreated_showSwitchBar() 96 verify(mSwitchBar).show(); in onActivityCreated_showSwitchBar()
|
/packages/apps/Settings/src/com/android/settings/emergency/ |
D | EmergencyGesturePreferenceController.java | 41 private MainSwitchPreference mSwitchBar; field in EmergencyGesturePreferenceController 63 mSwitchBar = (MainSwitchPreference) pref; in displayPreference() 64 mSwitchBar.setTitle(mContext.getString(R.string.emergency_gesture_switchbar_title)); in displayPreference() 65 mSwitchBar.addOnSwitchChangeListener(this); in displayPreference() 66 mSwitchBar.updateStatus(isChecked()); in displayPreference()
|
/packages/apps/Settings/src/com/android/settings/security/ |
D | ScreenPinningSettings.java | 67 private SettingsMainSwitchBar mSwitchBar; field in ScreenPinningSettings 92 mSwitchBar = activity.getSwitchBar(); in onActivityCreated() 93 mSwitchBar.setTitle(getContext().getString(R.string.app_pinning_main_switch_title)); in onActivityCreated() 94 mSwitchBar.show(); in onActivityCreated() 95 mSwitchBar.setChecked(isLockToAppEnabled(getActivity())); in onActivityCreated() 96 mSwitchBar.addOnSwitchChangeListener(this); in onActivityCreated() 110 mSwitchBar.removeOnSwitchChangeListener(this); in onDestroyView() 111 mSwitchBar.hide(); in onDestroyView() 226 mSwitchBar.setChecked(false); in onClick()
|
D | ContentProtectionTogglePreferenceController.java | 47 @Nullable private SettingsMainSwitchPreference mSwitchBar; field in ContentProtectionTogglePreferenceController 109 mSwitchBar = (SettingsMainSwitchPreference) preference; in displayPreference() 110 mSwitchBar.addOnSwitchChangeListener(this); in displayPreference() 124 if (mSwitchBar != null in updateState() 128 mSwitchBar.setDisabledByAdmin(mEnforcedAdmin); in updateState()
|
/packages/apps/Settings/src/com/android/settings/deletionhelper/ |
D | AutomaticStorageManagerSwitchBarController.java | 41 private SettingsMainSwitchBar mSwitchBar; field in AutomaticStorageManagerSwitchBarController 53 mSwitchBar = Preconditions.checkNotNull(switchBar); in AutomaticStorageManagerSwitchBarController() 62 mSwitchBar.setChecked(Utils.isStorageManagerEnabled(mContext)); in initializeCheckedStatus() 63 mSwitchBar.addOnSwitchChangeListener(this); in initializeCheckedStatus() 82 mSwitchBar.removeOnSwitchChangeListener(this); in tearDown()
|
D | AutomaticStorageManagerSettings.java | 55 private SettingsMainSwitchBar mSwitchBar; field in AutomaticStorageManagerSettings 85 mSwitchBar = activity.getSwitchBar(); in initializeSwitchBar() 86 mSwitchBar.setTitle( in initializeSwitchBar() 88 mSwitchBar.show(); in initializeSwitchBar() 92 mSwitchBar, in initializeSwitchBar() 123 mSwitchBar.hide(); in onDestroyView()
|
/packages/apps/Settings/src/com/android/settings/inputmethod/ |
D | SpellCheckersSettings.java | 51 private SettingsMainSwitchBar mSwitchBar; field in SpellCheckersSettings 94 mSwitchBar = ((SettingsActivity) getActivity()).getSwitchBar(); in onResume() 95 mSwitchBar.setTitle(getContext().getString(R.string.spell_checker_primary_switch_title)); in onResume() 96 mSwitchBar.show(); in onResume() 97 mSwitchBar.addOnSwitchChangeListener(this); in onResume() 104 mSwitchBar.removeOnSwitchChangeListener(this); in onPause() 117 mSwitchBar.setChecked(isSpellCheckerEnabled); in updatePreferenceScreen()
|
/packages/apps/Settings/src/com/android/settings/print/ |
D | PrintServiceSettingsFragment.java | 100 private SettingsMainSwitchBar mSwitchBar; field in PrintServiceSettingsFragment 163 mSwitchBar.removeOnSwitchChangeListener(this); in onStop() 164 mSwitchBar.hide(); in onStop() 176 if (!mSwitchBar.isChecked()) { in updateEmptyView() 222 mSwitchBar.setCheckedInternal(true); in updateUiForServiceState() 225 mSwitchBar.setCheckedInternal(false); in updateUiForServiceState() 237 mSwitchBar = activity.getSwitchBar(); in initComponents() 238 mSwitchBar.setTitle( in initComponents() 240 mSwitchBar.addOnSwitchChangeListener(this); in initComponents() 241 mSwitchBar.show(); in initComponents() [all …]
|
/packages/apps/Settings/src/com/android/settings/connecteddevice/ |
D | BluetoothDashboardFragment.java | 53 private SettingsMainSwitchBar mSwitchBar; field in BluetoothDashboardFragment 100 mSwitchBar = activity.getSwitchBar(); in onActivityCreated() 101 mSwitchBar.setTitle(getContext().getString(R.string.bluetooth_main_switch_title)); in onActivityCreated() 103 new MainSwitchBarController(mSwitchBar), mFooterPreference); in onActivityCreated()
|
/packages/apps/Settings/src/com/android/settings/notification/history/ |
D | NotificationHistoryActivity.java | 90 private MainSwitchBar mSwitchBar; field in NotificationHistoryActivity 248 mSwitchBar = findViewById(R.id.main_switch_bar); in onCreate() 291 if (mSwitchBar.isChecked() in onResume() 332 if (mSwitchBar != null) { in bindSwitch() 333 mSwitchBar.show(); in bindSwitch() 334 mSwitchBar.setTitle(getString(R.string.notification_history_toggle)); in bindSwitch() 336 mSwitchBar.addOnSwitchChangeListener(mOnSwitchClickListener); in bindSwitch() 340 mSwitchBar.setChecked(Settings.Secure.getInt(getContentResolver(), in bindSwitch() 342 toggleViews(mSwitchBar.isChecked()); in bindSwitch()
|
/packages/apps/Settings/src/com/android/settings/wifi/calling/ |
D | WifiCallingSettingsForSub.java | 94 private SettingsMainSwitchPreference mSwitchBar; field in WifiCallingSettingsForSub 300 mSwitchBar = (SettingsMainSwitchPreference) findPreference(SWITCH_BAR); in onCreate() 418 mSwitchBar.setChecked(wfcEnabled); in updateBody() 443 mSwitchBar.addOnSwitchChangeListener(this); in onResume() 462 mSwitchBar.removeOnSwitchChangeListener(this); in onPause()
|