diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 467dca15892..634c31a9ef0 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -1474,8 +1474,8 @@ @string/enhanced_4g_lte_mode_summary_4g_calling - - + + "com.google.android.googlequicksearchbox" diff --git a/res/values/config.xml b/res/values/config.xml index 956671b49f7..6a7a6c762d5 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -152,8 +152,8 @@ --> - - + + true diff --git a/res/values/strings.xml b/res/values/strings.xml index 3fec7c4f7b7..db5997099e2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1418,9 +1418,6 @@ Device admin doesn\'t allow using a recent PIN - - Common PINs are blocked by your IT admin. Try a different PIN. - This can\'t include an invalid character @@ -1478,9 +1475,6 @@ Device admin doesn\'t allow using a recent password - - Common passwords are blocked by your IT admin. Try a different password. - Ascending, descending, or repeated sequence of digits isn\'t allowed @@ -5533,8 +5527,8 @@ Allow the app to run in the background App not allowed to run in background - - Background usage can\u2019t be restricted + + Background usage can\u2019t be restricted Limit background activity? @@ -10505,8 +10499,8 @@ Unrestricted data - - Background data is turned off + + Background data is turned off On diff --git a/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java b/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java index ac8146a580e..52b1a8d1e49 100644 --- a/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java +++ b/src/com/android/settings/applications/ApplicationFeatureProviderImpl.java @@ -159,7 +159,7 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide keepEnabledPackages.add(euicc.packageName); } - keepEnabledPackages.addAll(getEnabledPackageWhitelist()); + keepEnabledPackages.addAll(getEnabledPackageAllowlist()); final LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); @@ -170,7 +170,7 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide return keepEnabledPackages; } - private Set getEnabledPackageWhitelist() { + private Set getEnabledPackageAllowlist() { final Set keepEnabledPackages = new ArraySet<>(); // Keep Settings intelligence enabled, otherwise search feature will be disabled. diff --git a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java index 71d9d13adea..61af4f600ab 100644 --- a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java +++ b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java @@ -142,7 +142,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase } private void logNonConfigurableAppMetrics() { - if (!isCrossProfilePackageWhitelisted(mPackageName)) { + if (!isCrossProfilePackageAllowlisted(mPackageName)) { logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_ADMIN_RESTRICTED); return; } @@ -382,7 +382,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase private boolean refreshUiForNonConfigurableApps() { mSwitchPref.setChecked(false); mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled); - if (!isCrossProfilePackageWhitelisted(mPackageName)) { + if (!isCrossProfilePackageAllowlisted(mPackageName)) { mInstallBanner.setVisible(false); mSwitchPref.setDisabledByAdmin(RestrictedLockUtils.getProfileOrDeviceOwner( mContext, mWorkProfile)); @@ -417,7 +417,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase return false; } - private boolean isCrossProfilePackageWhitelisted(String packageName) { + private boolean isCrossProfilePackageAllowlisted(String packageName) { return mContext.getSystemService(DevicePolicyManager.class) .getAllCrossProfilePackages().contains(packageName); } diff --git a/src/com/android/settings/bugreporthandler/BugReportHandlerUtil.java b/src/com/android/settings/bugreporthandler/BugReportHandlerUtil.java index f4acc7d1282..266a44929ea 100644 --- a/src/com/android/settings/bugreporthandler/BugReportHandlerUtil.java +++ b/src/com/android/settings/bugreporthandler/BugReportHandlerUtil.java @@ -76,14 +76,14 @@ public class BugReportHandlerUtil { int handlerUser = getCustomBugReportHandlerUser(context); boolean needToResetOutdatedSettings = false; - if (!isBugreportWhitelistedApp(handlerApp)) { + if (!isBugreportAllowlistedApp(handlerApp)) { handlerApp = getDefaultBugReportHandlerApp(context); handlerUser = UserHandle.USER_SYSTEM; } else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) { // It looks like the settings are outdated, need to reset outdated settings. // // i.e. - // If user chooses which profile and which bugreport-whitelisted app in that + // If user chooses which profile and which bugreport-allowlisted app in that // profile to handle a bugreport, then user remove the profile. // === RESULT === // The chosen bugreport handler app is outdated because the profile is removed, @@ -93,7 +93,7 @@ public class BugReportHandlerUtil { needToResetOutdatedSettings = true; } - if (!isBugreportWhitelistedApp(handlerApp) + if (!isBugreportAllowlistedApp(handlerApp) || getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) { // It looks like current handler app may be too old and doesn't support to handle a // bugreport, so change to let shell to handle a bugreport and need to reset @@ -136,7 +136,7 @@ public class BugReportHandlerUtil { */ public boolean setCurrentBugReportHandlerAppAndUser(Context context, String handlerApp, int handlerUser) { - if (!isBugreportWhitelistedApp(handlerApp)) { + if (!isBugreportAllowlistedApp(handlerApp)) { return false; } else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) { return false; @@ -155,17 +155,17 @@ public class BugReportHandlerUtil { public List> getValidBugReportHandlerInfos(Context context) { final List> validBugReportHandlerApplicationInfos = new ArrayList<>(); - List bugreportWhitelistedPackages; + List bugreportAllowlistedPackages; try { - bugreportWhitelistedPackages = + bugreportAllowlistedPackages = ActivityManager.getService().getBugreportWhitelistedPackages(); } catch (RemoteException e) { - Log.e(TAG, "Failed to get bugreportWhitelistedPackages:", e); + Log.e(TAG, "Failed to get bugreportAllowlistedPackages:", e); return validBugReportHandlerApplicationInfos; } // Add "Shell with system user" as System default preference on top of screen - if (bugreportWhitelistedPackages.contains(SHELL_APP_PACKAGE) + if (bugreportAllowlistedPackages.contains(SHELL_APP_PACKAGE) && !getBugReportHandlerAppReceivers(context, SHELL_APP_PACKAGE, UserHandle.USER_SYSTEM).isEmpty()) { try { @@ -181,7 +181,7 @@ public class BugReportHandlerUtil { final UserManager userManager = context.getSystemService(UserManager.class); final List profileList = userManager.getProfiles(UserHandle.getCallingUserId()); // Only add non-Shell app as normal preference - final List nonShellPackageList = bugreportWhitelistedPackages.stream() + final List nonShellPackageList = bugreportAllowlistedPackages.stream() .filter(pkg -> !SHELL_APP_PACKAGE.equals(pkg)).collect(Collectors.toList()); Collections.sort(nonShellPackageList); for (String pkg : nonShellPackageList) { @@ -202,15 +202,15 @@ public class BugReportHandlerUtil { return validBugReportHandlerApplicationInfos; } - private boolean isBugreportWhitelistedApp(String app) { - // Verify the app is bugreport-whitelisted + private boolean isBugreportAllowlistedApp(String app) { + // Verify the app is bugreport-allowlisted if (TextUtils.isEmpty(app)) { return false; } try { return ActivityManager.getService().getBugreportWhitelistedPackages().contains(app); } catch (RemoteException e) { - Log.e(TAG, "Failed to get bugreportWhitelistedPackages:", e); + Log.e(TAG, "Failed to get bugreportAllowlistedPackages:", e); return false; } } diff --git a/src/com/android/settings/core/SettingsBaseActivity.java b/src/com/android/settings/core/SettingsBaseActivity.java index 57697a689e5..68fa1d3e4aa 100644 --- a/src/com/android/settings/core/SettingsBaseActivity.java +++ b/src/com/android/settings/core/SettingsBaseActivity.java @@ -55,7 +55,7 @@ public class SettingsBaseActivity extends FragmentActivity { // Serves as a temporary list of tiles to ignore until we heard back from the PM that they // are disabled. - private static ArraySet sTileBlacklist = new ArraySet<>(); + private static ArraySet sTileDenylist = new ArraySet<>(); private final PackageReceiver mPackageReceiver = new PackageReceiver(); private final List mCategoryListeners = new ArrayList<>(); @@ -177,9 +177,9 @@ public class SettingsBaseActivity extends FragmentActivity { boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED; if (isEnabled != enabled || state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) { if (enabled) { - sTileBlacklist.remove(component); + sTileDenylist.remove(component); } else { - sTileBlacklist.add(component); + sTileDenylist.add(component); } pm.setComponentEnabledSetting(component, enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED @@ -217,7 +217,7 @@ public class SettingsBaseActivity extends FragmentActivity { @Override protected void onPostExecute(Void result) { - mCategoryManager.updateCategoryFromBlacklist(sTileBlacklist); + mCategoryManager.updateCategoryFromDenylist(sTileDenylist); onCategoriesChanged(); } } diff --git a/src/com/android/settings/dashboard/CategoryManager.java b/src/com/android/settings/dashboard/CategoryManager.java index 525b6f83aa3..51c485ae74e 100644 --- a/src/com/android/settings/dashboard/CategoryManager.java +++ b/src/com/android/settings/dashboard/CategoryManager.java @@ -85,15 +85,19 @@ public class CategoryManager { tryInitCategories(context, forceClearCache); } - public synchronized void updateCategoryFromBlacklist(Set tileBlacklist) { + /** + * Update category from deny list + * @param tileDenylist + */ + public synchronized void updateCategoryFromDenylist(Set tileDenylist) { if (mCategories == null) { - Log.w(TAG, "Category is null, skipping blacklist update"); + Log.w(TAG, "Category is null, skipping denylist update"); } for (int i = 0; i < mCategories.size(); i++) { DashboardCategory category = mCategories.get(i); for (int j = 0; j < category.getTilesCount(); j++) { Tile tile = category.getTile(j); - if (tileBlacklist.contains(tile.getIntent().getComponent())) { + if (tileDenylist.contains(tile.getIntent().getComponent())) { category.removeTile(j--); } } diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccessPreference.java b/src/com/android/settings/datausage/UnrestrictedDataAccessPreference.java index 902754a0f50..ebd88948807 100644 --- a/src/com/android/settings/datausage/UnrestrictedDataAccessPreference.java +++ b/src/com/android/settings/datausage/UnrestrictedDataAccessPreference.java @@ -175,7 +175,7 @@ public class UnrestrictedDataAccessPreference extends AppSwitchPreference implem if (isDisabledByAdmin()) { setSummary(R.string.disabled_by_admin); } else if (mDataUsageState.isDataSaverDenylisted) { - setSummary(R.string.restrict_background_blacklisted); + setSummary(R.string.restrict_background_blocklisted); } else { setSummary(""); } diff --git a/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceController.java b/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceController.java index 5d13b9a6b22..fad345683bb 100644 --- a/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceController.java +++ b/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceController.java @@ -118,7 +118,7 @@ public class BackgroundActivityPreferenceController extends AbstractPreferenceCo public void updateSummary(Preference preference) { if (mPowerAllowlistBackend.isAllowlisted(mTargetPackage)) { - preference.setSummary(R.string.background_activity_summary_whitelisted); + preference.setSummary(R.string.background_activity_summary_allowlisted); return; } final int mode = mAppOpsManager diff --git a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java index 4667e16e6b7..8d7bcd96ea6 100644 --- a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java +++ b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java @@ -391,11 +391,11 @@ public class BatteryAppListPreferenceController extends AbstractPreferenceContro } private boolean shouldShowSummary(BatterySipper sipper) { - final CharSequence[] whitelistPackages = mContext.getResources() - .getTextArray(R.array.whitelist_hide_summary_in_battery_usage); + final CharSequence[] allowlistPackages = mContext.getResources() + .getTextArray(R.array.allowlist_hide_summary_in_battery_usage); final String target = sipper.packageWithHighestDrain; - for (CharSequence packageName: whitelistPackages) { + for (CharSequence packageName: allowlistPackages) { if (TextUtils.equals(target, packageName)) { return false; } diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java index 1541cfd178f..d8047dd387e 100644 --- a/src/com/android/settings/panel/PanelFragment.java +++ b/src/com/android/settings/panel/PanelFragment.java @@ -306,7 +306,7 @@ public class PanelFragment extends Fragment { * Watching for the {@link Slice} to load. *

* If the Slice comes back {@code null} or with the Error attribute, if slice - * uri is not in the whitelist, remove the Slice data from the list, otherwise + * uri is not in the allowlist, remove the Slice data from the list, otherwise * keep the Slice data. *

* If the Slice has come back fully loaded, then mark the Slice as loaded. No @@ -337,10 +337,10 @@ public class PanelFragment extends Fragment { } private void removeSliceLiveData(Uri uri) { - final List whiteList = Arrays.asList( + final List allowList = Arrays.asList( getResources().getStringArray( R.array.config_panel_keep_observe_uri)); - if (!whiteList.contains(uri.toString())) { + if (!allowList.contains(uri.toString())) { mSliceLiveData.remove(uri); } } diff --git a/src/com/android/settings/search/SearchFeatureProviderImpl.java b/src/com/android/settings/search/SearchFeatureProviderImpl.java index 5c68d1b6371..508d37d7e6a 100644 --- a/src/com/android/settings/search/SearchFeatureProviderImpl.java +++ b/src/com/android/settings/search/SearchFeatureProviderImpl.java @@ -45,13 +45,13 @@ public class SearchFeatureProviderImpl implements SearchFeatureProvider { final String packageName = caller.getPackageName(); final boolean isSettingsPackage = TextUtils.equals(packageName, context.getPackageName()) || TextUtils.equals(getSettingsIntelligencePkgName(context), packageName); - final boolean isWhitelistedPackage = + final boolean isAllowlistedPackage = isSignatureAllowlisted(context, caller.getPackageName()); - if (isSettingsPackage || isWhitelistedPackage) { + if (isSettingsPackage || isAllowlistedPackage) { return; } throw new SecurityException("Search result intents must be called with from a " - + "whitelisted package."); + + "allowlisted package."); } @Override diff --git a/src/com/android/settings/slices/SettingsSliceProvider.java b/src/com/android/settings/slices/SettingsSliceProvider.java index 0707d06b93c..23af4617244 100644 --- a/src/com/android/settings/slices/SettingsSliceProvider.java +++ b/src/com/android/settings/slices/SettingsSliceProvider.java @@ -328,7 +328,7 @@ public class SettingsSliceProvider extends SliceProvider { .collect(Collectors.toList()); descendants.addAll(customSlices); } - grantWhitelistedPackagePermissions(getContext(), descendants); + grantAllowlistedPackagePermissions(getContext(), descendants); return descendants; } @@ -344,23 +344,23 @@ public class SettingsSliceProvider extends SliceProvider { } @VisibleForTesting - static void grantWhitelistedPackagePermissions(Context context, List descendants) { + static void grantAllowlistedPackagePermissions(Context context, List descendants) { if (descendants == null) { Log.d(TAG, "No descendants to grant permission with, skipping."); } - final String[] whitelistPackages = - context.getResources().getStringArray(R.array.slice_whitelist_package_names); - if (whitelistPackages == null || whitelistPackages.length == 0) { - Log.d(TAG, "No packages to whitelist, skipping."); + final String[] allowlistPackages = + context.getResources().getStringArray(R.array.slice_allowlist_package_names); + if (allowlistPackages == null || allowlistPackages.length == 0) { + Log.d(TAG, "No packages to allowlist, skipping."); return; } else { Log.d(TAG, String.format( - "Whitelisting %d uris to %d pkgs.", - descendants.size(), whitelistPackages.length)); + "Allowlisting %d uris to %d pkgs.", + descendants.size(), allowlistPackages.length)); } final SliceManager sliceManager = context.getSystemService(SliceManager.class); for (Uri descendant : descendants) { - for (String toPackage : whitelistPackages) { + for (String toPackage : allowlistPackages) { sliceManager.grantSlicePermission(toPackage, descendant); } } diff --git a/src/com/android/settings/vpn2/AppDialogFragment.java b/src/com/android/settings/vpn2/AppDialogFragment.java index ea9e546a6e5..9c73784d048 100644 --- a/src/com/android/settings/vpn2/AppDialogFragment.java +++ b/src/com/android/settings/vpn2/AppDialogFragment.java @@ -167,7 +167,7 @@ public class AppDialogFragment extends InstrumentedDialogFragment implements App try { if (mPackageInfo.packageName.equals(VpnUtils.getConnectedPackage(mService, userId))) { mService.setAlwaysOnVpnPackage(userId, null, /* lockdownEnabled */ false, - /* lockdownWhitelist */ null); + /* lockdownAllowlist */ null); mService.prepareVpn(mPackageInfo.packageName, VpnConfig.LEGACY_VPN, userId); } } catch (RemoteException e) { diff --git a/src/com/android/settings/vpn2/AppManagementFragment.java b/src/com/android/settings/vpn2/AppManagementFragment.java index 8280a3db9fc..d2cbcd5c1cf 100644 --- a/src/com/android/settings/vpn2/AppManagementFragment.java +++ b/src/com/android/settings/vpn2/AppManagementFragment.java @@ -231,7 +231,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment private boolean setAlwaysOnVpn(boolean isEnabled, boolean isLockdown) { return mConnectivityManager.setAlwaysOnVpnPackageForUser(mUserId, - isEnabled ? mPackageName : null, isLockdown, /* lockdownWhitelist */ null); + isEnabled ? mPackageName : null, isLockdown, /* lockdownAllowlist */ null); } private void updateUI() { diff --git a/src/com/android/settings/vpn2/ConfigDialogFragment.java b/src/com/android/settings/vpn2/ConfigDialogFragment.java index 57ba8bfd799..d6b92d71a01 100644 --- a/src/com/android/settings/vpn2/ConfigDialogFragment.java +++ b/src/com/android/settings/vpn2/ConfigDialogFragment.java @@ -180,7 +180,7 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements final ConnectivityManager conn = ConnectivityManager.from(mContext); conn.setAlwaysOnVpnPackageForUser(UserHandle.myUserId(), null, - /* lockdownEnabled */ false, /* lockdownWhitelist */ null); + /* lockdownEnabled */ false, /* lockdownAllowlist */ null); VpnUtils.setLockdownVpn(mContext, profile.key); } else { // update only if lockdown vpn has been changed diff --git a/tests/robotests/res/values-mcc998/config.xml b/tests/robotests/res/values-mcc998/config.xml index f9b91379226..6572b1485b5 100644 --- a/tests/robotests/res/values-mcc998/config.xml +++ b/tests/robotests/res/values-mcc998/config.xml @@ -15,6 +15,6 @@ --> - - + + diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml index ff17891fef0..b1d4be9ea1c 100644 --- a/tests/robotests/res/values-mcc999/config.xml +++ b/tests/robotests/res/values-mcc999/config.xml @@ -81,9 +81,9 @@ fake_package/fake_service - - - com.android.settings.slice_whitelist_package + + + com.android.settings.slice_allowlist_package diff --git a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java index 2bb93b5f2f9..1651cb61696 100644 --- a/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java +++ b/tests/robotests/src/com/android/settings/applications/ApplicationFeatureProviderImplTest.java @@ -329,9 +329,9 @@ public final class ApplicationFeatureProviderImplTest { ReflectionHelpers.setField(mProvider, "mContext", spyContext); - final Set whitelist = mProvider.getKeepEnabledPackages(); + final Set allowlist = mProvider.getKeepEnabledPackages(); - assertThat(whitelist).contains("com.android.settings.intelligence"); + assertThat(allowlist).contains("com.android.settings.intelligence"); } @Test @@ -351,9 +351,9 @@ public final class ApplicationFeatureProviderImplTest { ReflectionHelpers.setField(mProvider, "mContext", spyContext); - final Set whitelist = mProvider.getKeepEnabledPackages(); + final Set allowlist = mProvider.getKeepEnabledPackages(); - assertThat(whitelist).contains("com.android.packageinstaller"); + assertThat(allowlist).contains("com.android.packageinstaller"); } private void setUpUsersAndInstalledApps() { diff --git a/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java index 00d3cb119fe..e0a08364a8c 100644 --- a/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/SpecialAppAccessPreferenceControllerTest.java @@ -93,7 +93,7 @@ public class SpecialAppAccessPreferenceControllerTest { entry.hasLauncherEntry = true; entry.info = new ApplicationInfo(); entry.extraInfo = new AppStateDataUsageBridge.DataUsageState( - true /* whitelisted */, false /* blacklisted */); + true /* allowlisted */, false /* denylisted */); apps.add(entry); when(mSession.getAllApps()).thenReturn(apps); diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java index a27e40df25e..86f5fe83c6c 100644 --- a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java +++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java @@ -596,8 +596,8 @@ public class ManageApplicationsTest { mFragment.onItemSelected(null, null, 0, 0); AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter"); - assertThat(filter.filterApp(createPowerWhiteListApp(false))).isFalse(); - assertThat(filter.filterApp(createPowerWhiteListApp(true))).isTrue(); + assertThat(filter.filterApp(createPowerAllowListApp(false))).isFalse(); + assertThat(filter.filterApp(createPowerAllowListApp(true))).isTrue(); } @Test @@ -615,8 +615,8 @@ public class ManageApplicationsTest { mFragment.onItemSelected(null, null, 1, 0); AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter"); - assertThat(filter.filterApp(createPowerWhiteListApp(false))).isTrue(); - assertThat(filter.filterApp(createPowerWhiteListApp(true))).isTrue(); + assertThat(filter.filterApp(createPowerAllowListApp(false))).isTrue(); + assertThat(filter.filterApp(createPowerAllowListApp(true))).isTrue(); } private void setUpOptionMenus() { @@ -646,11 +646,11 @@ public class ManageApplicationsTest { return appList; } - private AppEntry createPowerWhiteListApp(boolean isPowerWhiteListed) { + private AppEntry createPowerAllowListApp(boolean isPowerAllowListed) { final ApplicationInfo info = new ApplicationInfo(); info.sourceDir = "abc"; final AppEntry entry = new AppEntry(mContext, info, 0); - entry.extraInfo = isPowerWhiteListed ? Boolean.TRUE : Boolean.FALSE; + entry.extraInfo = isPowerAllowListed ? Boolean.TRUE : Boolean.FALSE; return entry; } } diff --git a/tests/robotests/src/com/android/settings/core/XmlControllerAttributeTest.java b/tests/robotests/src/com/android/settings/core/XmlControllerAttributeTest.java index da234a1978a..5a62f74066d 100644 --- a/tests/robotests/src/com/android/settings/core/XmlControllerAttributeTest.java +++ b/tests/robotests/src/com/android/settings/core/XmlControllerAttributeTest.java @@ -35,7 +35,7 @@ import java.util.Set; public class XmlControllerAttributeTest { // List of XML that could be retrieved from the illegalClasses list. - private final List whitelistXml = Arrays.asList(R.xml.security_dashboard_settings); + private final List mAllowlistXml = Arrays.asList(R.xml.security_dashboard_settings); private static final String NO_VALID_CONSTRUCTOR_ERROR = "Controllers added in XML need a constructor following either:" @@ -62,7 +62,7 @@ public class XmlControllerAttributeTest { @Test public void testAllIndexableXML_onlyValidBasePreferenceControllersAdded() throws Exception { Set xmlSet = getIndexableXml(); - xmlSet.addAll(whitelistXml); + xmlSet.addAll(mAllowlistXml); List xmlControllers = new ArrayList<>(); Set invalidConstructors = new HashSet<>(); diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java index a2f61bfe87f..8f650ea0b7e 100644 --- a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java +++ b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java @@ -53,11 +53,11 @@ public class InstrumentableFragmentCodeInspector extends CodeInspector { } final String className = clazz.getName(); // If it's a fragment, it must also be instrumentable. - final boolean whitelisted = + final boolean allowlisted = mNotImplementingInstrumentableExemptList.remove(className); if (Fragment.class.isAssignableFrom(clazz) && !Instrumentable.class.isAssignableFrom(clazz) - && !whitelisted) { + && !allowlisted) { broken.add(className); } } diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java index 6c8467bcd61..de0cc0528b4 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/BackgroundActivityPreferenceControllerTest.java @@ -155,7 +155,7 @@ public class BackgroundActivityPreferenceControllerTest { mController.updateState(mPreference); assertThat(mPreference.isEnabled()).isFalse(); assertThat(mPreference.getSummary()).isEqualTo( - mShadowContext.getText(R.string.background_activity_summary_whitelisted)); + mShadowContext.getText(R.string.background_activity_summary_allowlisted)); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java index 259f40ee299..a9e4361d37d 100644 --- a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java @@ -206,7 +206,7 @@ public class NotificationPreferenceControllerTest { } @Test - public void testIsBlockable_oemWhitelist() { + public void testIsBlockable_oemAllowlist() { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationChannel channel = mock(NotificationChannel.class); when(channel.isImportanceLockedByOEM()).thenReturn(true); diff --git a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java index a79eafa8aaa..b5c6c446703 100644 --- a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java +++ b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java @@ -625,25 +625,25 @@ public class SettingsSliceProviderTest { @Test @Config(qualifiers = "mcc998") - public void grantWhitelistedPackagePermissions_noWhitelist_shouldNotGrant() { + public void grantAllowlistedPackagePermissions_noAllowlist_shouldNotGrant() { final List uris = new ArrayList<>(); uris.add(Uri.parse("content://settings/slice")); - SettingsSliceProvider.grantWhitelistedPackagePermissions(mContext, uris); + SettingsSliceProvider.grantAllowlistedPackagePermissions(mContext, uris); verify(mManager, never()).grantSlicePermission(anyString(), any(Uri.class)); } @Test @Config(qualifiers = "mcc999") - public void grantWhitelistedPackagePermissions_hasPackageWhitelist_shouldGrant() { + public void grantAllowlistedPackagePermissions_hasPackageAllowlist_shouldGrant() { final List uris = new ArrayList<>(); uris.add(Uri.parse("content://settings/slice")); - SettingsSliceProvider.grantWhitelistedPackagePermissions(mContext, uris); + SettingsSliceProvider.grantAllowlistedPackagePermissions(mContext, uris); verify(mManager) - .grantSlicePermission("com.android.settings.slice_whitelist_package", uris.get(0)); + .grantSlicePermission("com.android.settings.slice_allowlist_package", uris.get(0)); } @Test diff --git a/tests/robotests/src/com/android/settings/slices/SliceControllerInXmlCodeInspector.java b/tests/robotests/src/com/android/settings/slices/SliceControllerInXmlCodeInspector.java index d4a740d8683..93fb25fa60a 100644 --- a/tests/robotests/src/com/android/settings/slices/SliceControllerInXmlCodeInspector.java +++ b/tests/robotests/src/com/android/settings/slices/SliceControllerInXmlCodeInspector.java @@ -111,12 +111,12 @@ public class SliceControllerInXmlCodeInspector extends CodeInspector { } if (!mXmlDeclaredControllers.contains(clazz.getName())) { - // Class clazz should have been declared in XML (unless whitelisted). + // Class clazz should have been declared in XML (unless allowlisted). missingControllersInXml.add(clazz.getName()); } } - // Removed whitelisted classes + // Removed allowlisted classes missingControllersInXml.removeAll(mExemptedClasses); final String missingControllerError = diff --git a/tests/unit/src/com/android/settings/core/SettingsGatewayTest.java b/tests/unit/src/com/android/settings/core/SettingsGatewayTest.java index 7d03bbaf085..f8798767ebe 100644 --- a/tests/unit/src/com/android/settings/core/SettingsGatewayTest.java +++ b/tests/unit/src/com/android/settings/core/SettingsGatewayTest.java @@ -21,6 +21,7 @@ import static android.content.pm.PackageManager.GET_META_DATA; import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS; import static com.android.settings.SettingsActivity.META_DATA_KEY_FRAGMENT_CLASS; + import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.fail; @@ -88,11 +89,11 @@ public class SettingsGatewayTest { @Presubmit public void publicFragmentMustAppearInSettingsGateway() throws PackageManager.NameNotFoundException { - final List whitelistedFragment = new ArrayList<>(); + final List allowlistedFragment = new ArrayList<>(); final StringBuilder error = new StringBuilder(); for (String fragment : SettingsGateway.ENTRY_FRAGMENTS) { - whitelistedFragment.add(fragment); + allowlistedFragment.add(fragment); } final PackageInfo pi = mPackageManager.getPackageInfo(mPackageName, GET_META_DATA | MATCH_DISABLED_COMPONENTS | GET_ACTIVITIES); @@ -106,7 +107,7 @@ public class SettingsGatewayTest { final String fragmentName = metaData.getString(META_DATA_KEY_FRAGMENT_CLASS); assertThat(fragmentName).isNotNull(); - if (!whitelistedFragment.contains(fragmentName)) { + if (!allowlistedFragment.contains(fragmentName)) { error.append("SettingsGateway.ENTRY_FRAGMENTS must contain " + fragmentName + " because this fragment is used in manifest for " + activity.name) .append("\n"); diff --git a/tests/unit/src/com/android/settings/core/UniquePreferenceTest.java b/tests/unit/src/com/android/settings/core/UniquePreferenceTest.java index 9ed1c914989..ddd00a2277b 100644 --- a/tests/unit/src/com/android/settings/core/UniquePreferenceTest.java +++ b/tests/unit/src/com/android/settings/core/UniquePreferenceTest.java @@ -56,7 +56,7 @@ public class UniquePreferenceTest { private static final List IGNORE_PREF_TYPES = Arrays.asList( "com.android.settingslib.widget.FooterPreference"); - private static final List WHITELISTED_DUPLICATE_KEYS = Arrays.asList( + private static final List ALLOWLISTED_DUPLICATE_KEYS = Arrays.asList( "owner_info_settings", // Lock screen message in security - multiple xml files // contain this because security page is constructed by // combining small xml chunks. Eventually the page @@ -185,7 +185,7 @@ public class UniquePreferenceTest { nullKeyClasses.add(className); continue; } - if (uniqueKeys.contains(key) && !WHITELISTED_DUPLICATE_KEYS.contains(key)) { + if (uniqueKeys.contains(key) && !ALLOWLISTED_DUPLICATE_KEYS.contains(key)) { Log.e(TAG, "Every preference key must unique; found " + " in " + className + " / " + key); @@ -209,7 +209,7 @@ public class UniquePreferenceTest { nullKeyClasses.add(className); continue; } - if (uniqueKeys.contains(raw.key) && !WHITELISTED_DUPLICATE_KEYS.contains(raw.key)) { + if (uniqueKeys.contains(raw.key) && !ALLOWLISTED_DUPLICATE_KEYS.contains(raw.key)) { Log.e(TAG, "Every SearchIndexableRaw key must unique; found " + raw.key + " in " + className); duplicatedKeys.add(raw.key);