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:
@@ -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<Uri> descendants) {
|
||||
static void grantAllowlistedPackagePermissions(Context context, List<Uri> 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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user