Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: robotest & manual Change-Id: Ia8625091a107fc3fb652d3ba3f75ea3cc1a8d9f5
This commit is contained in:
@@ -15,6 +15,6 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- List of packages that should be whitelisted for slice uri access. Do not translate -->
|
||||
<string-array name="slice_whitelist_package_names" translatable="false"/>
|
||||
<!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
|
||||
<string-array name="slice_allowlist_package_names" translatable="false"/>
|
||||
</resources>
|
||||
|
||||
@@ -81,9 +81,9 @@
|
||||
<item>fake_package/fake_service</item>
|
||||
</string-array>
|
||||
|
||||
<!-- List of packages that should be whitelisted for slice uri access. Do not translate -->
|
||||
<string-array name="slice_whitelist_package_names" translatable="false">
|
||||
<item>com.android.settings.slice_whitelist_package</item>
|
||||
<!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
|
||||
<string-array name="slice_allowlist_package_names" translatable="false">
|
||||
<item>com.android.settings.slice_allowlist_package</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Email address for the homepage contextual cards feedback -->
|
||||
|
||||
@@ -329,9 +329,9 @@ public final class ApplicationFeatureProviderImplTest {
|
||||
|
||||
ReflectionHelpers.setField(mProvider, "mContext", spyContext);
|
||||
|
||||
final Set<String> whitelist = mProvider.getKeepEnabledPackages();
|
||||
final Set<String> 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<String> whitelist = mProvider.getKeepEnabledPackages();
|
||||
final Set<String> allowlist = mProvider.getKeepEnabledPackages();
|
||||
|
||||
assertThat(whitelist).contains("com.android.packageinstaller");
|
||||
assertThat(allowlist).contains("com.android.packageinstaller");
|
||||
}
|
||||
|
||||
private void setUpUsersAndInstalledApps() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Integer> whitelistXml = Arrays.asList(R.xml.security_dashboard_settings);
|
||||
private final List<Integer> 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<Integer> xmlSet = getIndexableXml();
|
||||
xmlSet.addAll(whitelistXml);
|
||||
xmlSet.addAll(mAllowlistXml);
|
||||
|
||||
List<String> xmlControllers = new ArrayList<>();
|
||||
Set<String> invalidConstructors = new HashSet<>();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -625,25 +625,25 @@ public class SettingsSliceProviderTest {
|
||||
|
||||
@Test
|
||||
@Config(qualifiers = "mcc998")
|
||||
public void grantWhitelistedPackagePermissions_noWhitelist_shouldNotGrant() {
|
||||
public void grantAllowlistedPackagePermissions_noAllowlist_shouldNotGrant() {
|
||||
final List<Uri> 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<Uri> 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
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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<String> whitelistedFragment = new ArrayList<>();
|
||||
final List<String> 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");
|
||||
|
||||
@@ -56,7 +56,7 @@ public class UniquePreferenceTest {
|
||||
private static final List<String> IGNORE_PREF_TYPES = Arrays.asList(
|
||||
"com.android.settingslib.widget.FooterPreference");
|
||||
|
||||
private static final List<String> WHITELISTED_DUPLICATE_KEYS = Arrays.asList(
|
||||
private static final List<String> 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);
|
||||
|
||||
Reference in New Issue
Block a user