Update language to comply with Android's inclusive language guidance

1. Rename isClientInWhitelist to isClientInAllowlist

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 162536543
Test: Build & run
Change-Id: Ibbd97bf31915d59b5110cbcc8f2126f7a7221060
This commit is contained in:
jasonwshsu
2020-08-13 15:21:57 +08:00
parent 063ea3bd99
commit cfb9bd346c

View File

@@ -1530,12 +1530,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
int serviceCount = userState.mBoundServices.size();
for (int i = 0; i < serviceCount; i++) {
AccessibilityServiceConnection service = userState.mBoundServices.get(i);
relevantEventTypes |= isClientInPackageWhitelist(service.getServiceInfo(), client)
relevantEventTypes |= isClientInPackageAllowlist(service.getServiceInfo(), client)
? service.getRelevantEventTypes()
: 0;
}
relevantEventTypes |= isClientInPackageWhitelist(
relevantEventTypes |= isClientInPackageAllowlist(
mUiAutomationManager.getServiceInfo(), client)
? mUiAutomationManager.getRelevantEventTypes()
: 0;
@@ -1571,7 +1571,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
}
}
private static boolean isClientInPackageWhitelist(
private static boolean isClientInPackageAllowlist(
@Nullable AccessibilityServiceInfo serviceInfo, Client client) {
if (serviceInfo == null) return false;
@@ -1590,7 +1590,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
Slog.d(LOG_TAG, "Dropping events: "
+ Arrays.toString(clientPackages) + " -> "
+ serviceInfo.getComponentName().flattenToShortString()
+ " due to not being in package whitelist "
+ " due to not being in package allowlist "
+ Arrays.toString(serviceInfo.packageNames));
}
}
@@ -1991,9 +1991,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
}
private void updateLegacyCapabilitiesLocked(AccessibilityUserState userState) {
// Up to JB-MR1 we had a white list with services that can enable touch
// Up to JB-MR1 we had a allowlist with services that can enable touch
// exploration. When a service is first started we show a dialog to the
// use to get a permission to white list the service.
// use to get a permission to allowlist the service.
final int installedServiceCount = userState.mInstalledServices.size();
for (int i = 0; i < installedServiceCount; i++) {
AccessibilityServiceInfo serviceInfo = userState.mInstalledServices.get(i);
@@ -2261,9 +2261,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
}
if (service.getServiceInfo().getResolveInfo().serviceInfo.applicationInfo.targetSdkVersion
<= Build.VERSION_CODES.JELLY_BEAN_MR1) {
// Up to JB-MR1 we had a white list with services that can enable touch
// Up to JB-MR1 we had a allowlist with services that can enable touch
// exploration. When a service is first started we show a dialog to the
// use to get a permission to white list the service.
// use to get a permission to allowlist the service.
if (userState.mTouchExplorationGrantedServices.contains(service.mComponentName)) {
return true;
} else if (mEnableTouchExplorationDialog == null