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:
Edgar Wang
2020-08-06 21:13:41 +08:00
parent 232aaec569
commit a8742aa7ab
30 changed files with 95 additions and 96 deletions

View File

@@ -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() {

View File

@@ -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);

View File

@@ -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;
}
}

View File

@@ -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<>();

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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 =