/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/ |
D | ExternalSourcesDetailsTest.java | 58 private RestrictedSwitchPreference mSwitchPref; field in ExternalSourcesDetailsTest 72 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 105 assertThat(mSwitchPref.isDisabledByAdmin()).isFalse(); in refreshUi_hasApplicationInfo_shouldReturnTrue() 117 ReflectionHelpers.setField(fragment, "mSwitchPref", mSwitchPref); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() 121 ReflectionHelpers.setField(mSwitchPref, "mHelper", mHelper); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() 132 when(mSwitchPref.isDisabledByAdmin()).thenReturn(true); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() 134 }).when(mSwitchPref).checkRestrictionAndSetDisabled( in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() 144 assertThat(mSwitchPref.isDisabledByAdmin()).isTrue(); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() 156 ReflectionHelpers.setField(fragment, "mSwitchPref", mSwitchPref); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference() 160 ReflectionHelpers.setField(mSwitchPref, "mHelper", mHelper); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference() [all …]
|
D | AlarmsAndRemindersDetailsTest.java | 44 private RestrictedSwitchPreference mSwitchPref; field in AlarmsAndRemindersDetailsTest 58 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 101 verify(mSwitchPref).setEnabled(false); in refreshUi_switchPreferenceEnabled() 106 verify(mSwitchPref).setEnabled(true); in refreshUi_switchPreferenceEnabled() 118 verify(mSwitchPref).setChecked(true); in refreshUi_switchPreferenceChecked() 122 verify(mSwitchPref).setChecked(false); in refreshUi_switchPreferenceChecked()
|
D | LongBackgroundTasksDetailsTest.java | 44 private RestrictedSwitchPreference mSwitchPref; field in LongBackgroundTasksDetailsTest 58 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 101 verify(mSwitchPref).setEnabled(false); in refreshUi_switchPreferenceEnabled() 106 verify(mSwitchPref).setEnabled(true); in refreshUi_switchPreferenceEnabled() 118 verify(mSwitchPref).setChecked(true); in refreshUi_switchPreferenceChecked() 122 verify(mSwitchPref).setChecked(false); in refreshUi_switchPreferenceChecked()
|
D | ManageExternalStorageDetailsTest.java | 60 private SwitchPreference mSwitchPref; field in ManageExternalStorageDetailsTest 80 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 105 mFragment.onPreferenceChange(mSwitchPref, /* newValue */ true); in onPreferenceChange_enableManageExternalStorage_shouldTriggerAppOpsManager() 114 verify(mSwitchPref, times(1)).setEnabled(acSetEnabled.capture()); in onPreferenceChange_enableManageExternalStorage_shouldTriggerAppOpsManager() 119 verify(mSwitchPref, times(1)).setChecked(acSetChecked.capture()); in onPreferenceChange_enableManageExternalStorage_shouldTriggerAppOpsManager() 140 mFragment.onPreferenceChange(mSwitchPref, /* newValue */ false); in onPreferenceChange_disableManageExternalStorage_shouldTriggerAppOpsManager() 149 verify(mSwitchPref, times(1)).setEnabled(acSetEnabled.capture()); in onPreferenceChange_disableManageExternalStorage_shouldTriggerAppOpsManager() 154 verify(mSwitchPref, times(1)).setChecked(acSetChecked.capture()); in onPreferenceChange_disableManageExternalStorage_shouldTriggerAppOpsManager()
|
D | TurnScreenOnDetailsTest.java | 46 private SwitchPreference mSwitchPref; field in TurnScreenOnDetailsTest 61 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 104 verify(mSwitchPref).setEnabled(false); in refreshUi_permissionNotDeclared_switchPreferenceDisabled() 116 verify(mSwitchPref).setEnabled(true); in refreshUi_permissionDeclared_switchPreferenceEnabled() 128 verify(mSwitchPref).setChecked(true); in refreshUi_turnScreenOnAllowed_switchPreferenceChecked() 140 verify(mSwitchPref).setChecked(false); in refreshUi_turnScreenOnDisallowed_switchPreferenceUnchecked()
|
D | MediaManagementAppsDetailsTest.java | 46 private SwitchPreference mSwitchPref; field in MediaManagementAppsDetailsTest 60 ReflectionHelpers.setField(mFragment, "mSwitchPref", mSwitchPref); in setUp() 114 verify(mSwitchPref).setEnabled(isPermissionDeclared); in assert_refreshUi_switchPreferenceSetEnabled() 125 verify(mSwitchPref).setChecked(isPermissible); in assert_refreshUi_switchPreferenceSetChecked()
|
/packages/apps/Settings/src/com/android/settings/applications/appinfo/ |
D | ExternalSourcesDetails.java | 48 private RestrictedSwitchPreference mSwitchPref; field in ExternalSourcesDetails 61 mSwitchPref = (RestrictedSwitchPreference) findPreference(KEY_EXTERNAL_SOURCE_SWITCH); in onCreate() 62 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 68 if (preference == mSwitchPref) { in onPreferenceChange() 115 mSwitchPref.setChecked(false); in refreshUi() 116 mSwitchPref.setSummary(com.android.settingslib.R.string.disabled); in refreshUi() 117 mSwitchPref.setEnabled(false); in refreshUi() 120 mSwitchPref.checkRestrictionAndSetDisabled(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES); in refreshUi() 121 if (!mSwitchPref.isDisabledByAdmin()) { in refreshUi() 122 mSwitchPref.checkRestrictionAndSetDisabled( in refreshUi() [all …]
|
D | MediaManagementAppsDetails.java | 44 private TwoStatePreference mSwitchPref; field in MediaManagementAppsDetails 57 mSwitchPref = findPreference(KEY_SWITCH_PREF); in onCreate() 60 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 66 if (preference == mSwitchPref) { in onPreferenceChange() 99 mSwitchPref.setEnabled(mPermissionState.permissionDeclared); in refreshUi() 100 mSwitchPref.setChecked(mPermissionState.isPermissible()); in refreshUi()
|
D | TurnScreenOnDetails.java | 49 private TwoStatePreference mSwitchPref; field in TurnScreenOnDetails 63 mSwitchPref = (TwoStatePreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 64 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 70 if (preference == mSwitchPref) { in onPreferenceChange() 91 mSwitchPref.setEnabled(mPermissionState.permissionDeclared); in refreshUi() 92 mSwitchPref.setChecked(mPermissionState.isPermissible()); in refreshUi()
|
D | WriteSettingsDetails.java | 46 private TwoStatePreference mSwitchPref; field in WriteSettingsDetails 58 mSwitchPref = findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 60 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 71 if (preference == mSwitchPref) { in onPreferenceChange() 102 mSwitchPref.setChecked(canWrite); in refreshUi() 104 mSwitchPref.setEnabled(mWriteSettingsState.permissionDeclared); in refreshUi()
|
D | AlarmsAndRemindersDetails.java | 49 private RestrictedSwitchPreference mSwitchPref; field in AlarmsAndRemindersDetails 82 mSwitchPref = findPreference(KEY_SWITCH); in onCreate() 83 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 96 if (preference == mSwitchPref) { in onPreferenceChange() 148 mSwitchPref.setEnabled(mPermissionState.shouldBeVisible()); in refreshUi() 149 mSwitchPref.setChecked( in refreshUi()
|
D | LongBackgroundTasksDetails.java | 49 private RestrictedSwitchPreference mSwitchPref; field in LongBackgroundTasksDetails 82 mSwitchPref = findPreference(KEY_SWITCH); in onCreate() 83 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 96 if (preference == mSwitchPref) { in onPreferenceChange() 148 mSwitchPref.setEnabled(mPermissionState.shouldBeVisible()); in refreshUi() 149 mSwitchPref.setChecked( in refreshUi()
|
D | ManageExternalStorageDetails.java | 50 private TwoStatePreference mSwitchPref; field in ManageExternalStorageDetails 64 mSwitchPref = findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 67 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 97 if (preference == mSwitchPref) { in onPreferenceChange() 138 mSwitchPref.setChecked(mPermissionState.isPermissible()); in refreshUi() 141 mSwitchPref.setEnabled(mPermissionState.permissionDeclared); in refreshUi()
|
D | DrawOverlayDetails.java | 55 private TwoStatePreference mSwitchPref = null; field in DrawOverlayDetails 73 mSwitchPref = findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 76 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 104 if (preference == mSwitchPref) { in onPreferenceChange() 145 mSwitchPref.setChecked(isAllowed); in refreshUi() 147 mSwitchPref.setEnabled(mOverlayState.permissionDeclared && mOverlayState.controlEnabled); in refreshUi()
|
/packages/apps/Settings/src/com/android/settings/nfc/ |
D | ChangeNfcTagAppsStateDetails.java | 44 private TwoStatePreference mSwitchPref; field in ChangeNfcTagAppsStateDetails 54 mSwitchPref = (TwoStatePreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 57 mSwitchPref.setTitle(R.string.change_nfc_tag_apps_detail_switch); in onCreate() 60 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 77 if (preference == mSwitchPref) { in onPreferenceChange() 101 mSwitchPref.setChecked(state.isAllowed()); in refreshUi() 102 mSwitchPref.setEnabled(state.isExisted()); in refreshUi()
|
/packages/apps/Settings/src/com/android/settings/applications/ |
D | UsageAccessDetails.java | 60 private RestrictedSwitchPreference mSwitchPref; field in UsageAccessDetails 81 mSwitchPref = (RestrictedSwitchPreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 85 mSwitchPref.setTitle(R.string.permit_usage_access); in onCreate() 88 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 102 if (preference == mSwitchPref) { in onPreferenceChange() 176 mSwitchPref.checkEcmRestrictionAndSetDisabled(AppOpsManager.OPSTR_GET_USAGE_STATS, in refreshUi() 178 shouldEnable = !mSwitchPref.isDisabledByEcm(); in refreshUi() 181 mSwitchPref.setChecked(hasAccess); in refreshUi() 182 mSwitchPref.setEnabled(shouldEnable); in refreshUi() 192 mSwitchPref.setSummary( in refreshUi()
|
/packages/apps/Settings/src/com/android/settings/wifi/ |
D | ChangeWifiStateDetails.java | 44 private TwoStatePreference mSwitchPref; field in ChangeWifiStateDetails 56 mSwitchPref = (TwoStatePreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 59 mSwitchPref.setTitle(R.string.change_wifi_state_app_detail_switch); in onCreate() 62 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 77 if (preference == mSwitchPref) { in onPreferenceChange() 111 mSwitchPref.setChecked(canChange); in refreshUi() 113 mSwitchPref.setEnabled(mWifiSettingsState.permissionDeclared); in refreshUi()
|
/packages/apps/Settings/src/com/android/settings/applications/specialaccess/pictureinpicture/ |
D | PictureInPictureDetails.java | 44 private TwoStatePreference mSwitchPref; field in PictureInPictureDetails 52 mSwitchPref = (TwoStatePreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); in onCreate() 55 mSwitchPref.setTitle(R.string.picture_in_picture_app_detail_switch); in onCreate() 58 mSwitchPref.setOnPreferenceChangeListener(this); in onCreate() 63 if (preference == mSwitchPref) { in onPreferenceChange() 76 mSwitchPref.setChecked(isAllowed); in refreshUi()
|
/packages/apps/Settings/src/com/android/settings/applications/specialaccess/interactacrossprofiles/ |
D | InteractAcrossProfilesDetails.java | 95 private RestrictedSwitchPreference mSwitchPref; field in InteractAcrossProfilesDetails 143 mSwitchPref = findPreference(INTERACT_ACROSS_PROFILES_SETTINGS_SWITCH); in onCreateView() 144 mSwitchPref.setOnPreferenceClickListener(this); in onCreateView() 277 if (preference == mSwitchPref) { in onPreferenceClick() 430 mSwitchPref.setEnabled(false); in refreshUi() 441 mSwitchPref.setChecked(false); in refreshUiForNonConfigurableApps() 442 mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled); in refreshUiForNonConfigurableApps() 445 mSwitchPref.setDisabledByAdmin(RestrictedLockUtils.getProfileOrDeviceOwner( in refreshUiForNonConfigurableApps() 449 mSwitchPref.setEnabled(false); in refreshUiForNonConfigurableApps() 511 mSwitchPref.setEnabled(true); in refreshUiForConfigurableApps() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/calling/ |
D | WifiCallingSettingsForSubTest.java | 379 private SettingsMainSwitchPreference mSwitchPref; field in WifiCallingSettingsForSubTest.TestFragment 382 mSwitchPref = switchPref; in setSwitchBar() 388 return (T) mSwitchPref; in findPreference()
|