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:
@@ -1474,8 +1474,8 @@
|
|||||||
<item>@string/enhanced_4g_lte_mode_summary_4g_calling</item>
|
<item>@string/enhanced_4g_lte_mode_summary_4g_calling</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- A whitelist which packages won't show summary in battery usage screen. [CHAR LIMIT=NONE] -->
|
<!-- An allowlist which packages won't show summary in battery usage screen. [CHAR LIMIT=NONE] -->
|
||||||
<string-array name="whitelist_hide_summary_in_battery_usage" translatable="false">
|
<string-array name="allowlist_hide_summary_in_battery_usage" translatable="false">
|
||||||
<!-- Google -->
|
<!-- Google -->
|
||||||
<item>"com.google.android.googlequicksearchbox"</item>
|
<item>"com.google.android.googlequicksearchbox"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
@@ -152,8 +152,8 @@
|
|||||||
-->
|
-->
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- List of packages that should be whitelisted for slice uri access. Do not translate -->
|
<!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
|
||||||
<string-array name="slice_whitelist_package_names" translatable="false"/>
|
<string-array name="slice_allowlist_package_names" translatable="false"/>
|
||||||
|
|
||||||
<!-- Whether or not App & Notification screen should display recently used apps -->
|
<!-- Whether or not App & Notification screen should display recently used apps -->
|
||||||
<bool name="config_display_recent_apps">true</bool>
|
<bool name="config_display_recent_apps">true</bool>
|
||||||
|
@@ -1418,9 +1418,6 @@
|
|||||||
<!-- Error shown when in PIN mode and PIN has been used recently. Please keep this string short! -->
|
<!-- Error shown when in PIN mode and PIN has been used recently. Please keep this string short! -->
|
||||||
<string name="lockpassword_pin_recently_used">Device admin doesn\'t allow using a recent PIN</string>
|
<string name="lockpassword_pin_recently_used">Device admin doesn\'t allow using a recent PIN</string>
|
||||||
|
|
||||||
<!-- Error shown when a user is choosing a PIN for their work phone, but what they suggest is blocked by their company's IT administrator. The user should try another PIN that's less common and more complicated. -->
|
|
||||||
<string name="lockpassword_pin_blacklisted_by_admin">Common PINs are blocked by your IT admin. Try a different PIN.</string>
|
|
||||||
|
|
||||||
<!-- Error shown when in PASSWORD mode and user enters an invalid character -->
|
<!-- Error shown when in PASSWORD mode and user enters an invalid character -->
|
||||||
<string name="lockpassword_illegal_character">This can\'t include an invalid character</string>
|
<string name="lockpassword_illegal_character">This can\'t include an invalid character</string>
|
||||||
|
|
||||||
@@ -1478,9 +1475,6 @@
|
|||||||
<string name="lockpassword_password_recently_used">Device admin doesn\'t allow using a recent
|
<string name="lockpassword_password_recently_used">Device admin doesn\'t allow using a recent
|
||||||
password</string>
|
password</string>
|
||||||
|
|
||||||
<!-- Error shown when a user is choosing a PASSWORD for their work phone, but what they suggest is blocked by their company's IT administrator. The user should try another PASSWORD that's less common and more complicated. -->
|
|
||||||
<string name="lockpassword_password_blacklisted_by_admin">Common passwords are blocked by your IT admin. Try a different password.</string>
|
|
||||||
|
|
||||||
<!-- [CHAR_LIMIT=NONE] Error shown when the user tries to set an ascending or descending sequence of digits -->
|
<!-- [CHAR_LIMIT=NONE] Error shown when the user tries to set an ascending or descending sequence of digits -->
|
||||||
<string name="lockpassword_pin_no_sequential_digits">Ascending, descending, or repeated sequence
|
<string name="lockpassword_pin_no_sequential_digits">Ascending, descending, or repeated sequence
|
||||||
of digits isn\'t allowed</string>
|
of digits isn\'t allowed</string>
|
||||||
@@ -5533,8 +5527,8 @@
|
|||||||
<string name="background_activity_summary">Allow the app to run in the background</string>
|
<string name="background_activity_summary">Allow the app to run in the background</string>
|
||||||
<!-- Summary for the background activity when it is disabled [CHAR_LIMIT=120] -->
|
<!-- Summary for the background activity when it is disabled [CHAR_LIMIT=120] -->
|
||||||
<string name="background_activity_summary_disabled">App not allowed to run in background</string>
|
<string name="background_activity_summary_disabled">App not allowed to run in background</string>
|
||||||
<!-- TODO: Pending UX review. Summary for the background activity when it is whitlisted [CHAR_LIMIT=120] -->
|
<!-- TODO: Pending UX review. Summary for the background activity when it is allowlisted [CHAR_LIMIT=120] -->
|
||||||
<string name="background_activity_summary_whitelisted">Background usage can\u2019t be restricted</string>
|
<string name="background_activity_summary_allowlisted">Background usage can\u2019t be restricted</string>
|
||||||
<!-- TODO: Pending UX review. Title for the warning dialog to show to the user when limiting background activity for an app -->
|
<!-- TODO: Pending UX review. Title for the warning dialog to show to the user when limiting background activity for an app -->
|
||||||
<string name="background_activity_warning_dialog_title">Limit background activity?</string>
|
<string name="background_activity_warning_dialog_title">Limit background activity?</string>
|
||||||
<!-- TODO: Pending UX review. Text for the warning dialog to show to the user when limiting background activity for an app -->
|
<!-- TODO: Pending UX review. Text for the warning dialog to show to the user when limiting background activity for an app -->
|
||||||
@@ -10505,8 +10499,8 @@
|
|||||||
<!-- Button that leads to list of apps with unrestricted data access [CHAR LIMIT=60] -->
|
<!-- Button that leads to list of apps with unrestricted data access [CHAR LIMIT=60] -->
|
||||||
<string name="unrestricted_data_saver">Unrestricted data</string>
|
<string name="unrestricted_data_saver">Unrestricted data</string>
|
||||||
|
|
||||||
<!-- Description of message shown when app is blacklisted for background data access [CHAR LIMIT=NONE] -->
|
<!-- Description of message shown when app is blocklisted for background data access [CHAR LIMIT=NONE] -->
|
||||||
<string name="restrict_background_blacklisted">Background data is turned off</string>
|
<string name="restrict_background_blocklisted">Background data is turned off</string>
|
||||||
|
|
||||||
<!-- Summary for the Data Saver feature being on [CHAR LIMIT=NONE] -->
|
<!-- Summary for the Data Saver feature being on [CHAR LIMIT=NONE] -->
|
||||||
<string name="data_saver_on">On</string>
|
<string name="data_saver_on">On</string>
|
||||||
|
@@ -159,7 +159,7 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
|
|||||||
keepEnabledPackages.add(euicc.packageName);
|
keepEnabledPackages.add(euicc.packageName);
|
||||||
}
|
}
|
||||||
|
|
||||||
keepEnabledPackages.addAll(getEnabledPackageWhitelist());
|
keepEnabledPackages.addAll(getEnabledPackageAllowlist());
|
||||||
|
|
||||||
final LocationManager locationManager =
|
final LocationManager locationManager =
|
||||||
(LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
|
(LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
|
||||||
@@ -170,7 +170,7 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
|
|||||||
return keepEnabledPackages;
|
return keepEnabledPackages;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<String> getEnabledPackageWhitelist() {
|
private Set<String> getEnabledPackageAllowlist() {
|
||||||
final Set<String> keepEnabledPackages = new ArraySet<>();
|
final Set<String> keepEnabledPackages = new ArraySet<>();
|
||||||
|
|
||||||
// Keep Settings intelligence enabled, otherwise search feature will be disabled.
|
// Keep Settings intelligence enabled, otherwise search feature will be disabled.
|
||||||
|
@@ -142,7 +142,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logNonConfigurableAppMetrics() {
|
private void logNonConfigurableAppMetrics() {
|
||||||
if (!isCrossProfilePackageWhitelisted(mPackageName)) {
|
if (!isCrossProfilePackageAllowlisted(mPackageName)) {
|
||||||
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_ADMIN_RESTRICTED);
|
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_ADMIN_RESTRICTED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -382,7 +382,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
private boolean refreshUiForNonConfigurableApps() {
|
private boolean refreshUiForNonConfigurableApps() {
|
||||||
mSwitchPref.setChecked(false);
|
mSwitchPref.setChecked(false);
|
||||||
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled);
|
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled);
|
||||||
if (!isCrossProfilePackageWhitelisted(mPackageName)) {
|
if (!isCrossProfilePackageAllowlisted(mPackageName)) {
|
||||||
mInstallBanner.setVisible(false);
|
mInstallBanner.setVisible(false);
|
||||||
mSwitchPref.setDisabledByAdmin(RestrictedLockUtils.getProfileOrDeviceOwner(
|
mSwitchPref.setDisabledByAdmin(RestrictedLockUtils.getProfileOrDeviceOwner(
|
||||||
mContext, mWorkProfile));
|
mContext, mWorkProfile));
|
||||||
@@ -417,7 +417,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCrossProfilePackageWhitelisted(String packageName) {
|
private boolean isCrossProfilePackageAllowlisted(String packageName) {
|
||||||
return mContext.getSystemService(DevicePolicyManager.class)
|
return mContext.getSystemService(DevicePolicyManager.class)
|
||||||
.getAllCrossProfilePackages().contains(packageName);
|
.getAllCrossProfilePackages().contains(packageName);
|
||||||
}
|
}
|
||||||
|
@@ -76,14 +76,14 @@ public class BugReportHandlerUtil {
|
|||||||
int handlerUser = getCustomBugReportHandlerUser(context);
|
int handlerUser = getCustomBugReportHandlerUser(context);
|
||||||
|
|
||||||
boolean needToResetOutdatedSettings = false;
|
boolean needToResetOutdatedSettings = false;
|
||||||
if (!isBugreportWhitelistedApp(handlerApp)) {
|
if (!isBugreportAllowlistedApp(handlerApp)) {
|
||||||
handlerApp = getDefaultBugReportHandlerApp(context);
|
handlerApp = getDefaultBugReportHandlerApp(context);
|
||||||
handlerUser = UserHandle.USER_SYSTEM;
|
handlerUser = UserHandle.USER_SYSTEM;
|
||||||
} else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
} else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
||||||
// It looks like the settings are outdated, need to reset outdated settings.
|
// It looks like the settings are outdated, need to reset outdated settings.
|
||||||
//
|
//
|
||||||
// i.e.
|
// 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.
|
// profile to handle a bugreport, then user remove the profile.
|
||||||
// === RESULT ===
|
// === RESULT ===
|
||||||
// The chosen bugreport handler app is outdated because the profile is removed,
|
// The chosen bugreport handler app is outdated because the profile is removed,
|
||||||
@@ -93,7 +93,7 @@ public class BugReportHandlerUtil {
|
|||||||
needToResetOutdatedSettings = true;
|
needToResetOutdatedSettings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isBugreportWhitelistedApp(handlerApp)
|
if (!isBugreportAllowlistedApp(handlerApp)
|
||||||
|| getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
|| getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
||||||
// It looks like current handler app may be too old and doesn't support to handle a
|
// 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
|
// 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,
|
public boolean setCurrentBugReportHandlerAppAndUser(Context context, String handlerApp,
|
||||||
int handlerUser) {
|
int handlerUser) {
|
||||||
if (!isBugreportWhitelistedApp(handlerApp)) {
|
if (!isBugreportAllowlistedApp(handlerApp)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
} else if (getBugReportHandlerAppReceivers(context, handlerApp, handlerUser).isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -155,17 +155,17 @@ public class BugReportHandlerUtil {
|
|||||||
public List<Pair<ApplicationInfo, Integer>> getValidBugReportHandlerInfos(Context context) {
|
public List<Pair<ApplicationInfo, Integer>> getValidBugReportHandlerInfos(Context context) {
|
||||||
final List<Pair<ApplicationInfo, Integer>> validBugReportHandlerApplicationInfos =
|
final List<Pair<ApplicationInfo, Integer>> validBugReportHandlerApplicationInfos =
|
||||||
new ArrayList<>();
|
new ArrayList<>();
|
||||||
List<String> bugreportWhitelistedPackages;
|
List<String> bugreportAllowlistedPackages;
|
||||||
try {
|
try {
|
||||||
bugreportWhitelistedPackages =
|
bugreportAllowlistedPackages =
|
||||||
ActivityManager.getService().getBugreportWhitelistedPackages();
|
ActivityManager.getService().getBugreportWhitelistedPackages();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Failed to get bugreportWhitelistedPackages:", e);
|
Log.e(TAG, "Failed to get bugreportAllowlistedPackages:", e);
|
||||||
return validBugReportHandlerApplicationInfos;
|
return validBugReportHandlerApplicationInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add "Shell with system user" as System default preference on top of screen
|
// 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,
|
&& !getBugReportHandlerAppReceivers(context, SHELL_APP_PACKAGE,
|
||||||
UserHandle.USER_SYSTEM).isEmpty()) {
|
UserHandle.USER_SYSTEM).isEmpty()) {
|
||||||
try {
|
try {
|
||||||
@@ -181,7 +181,7 @@ public class BugReportHandlerUtil {
|
|||||||
final UserManager userManager = context.getSystemService(UserManager.class);
|
final UserManager userManager = context.getSystemService(UserManager.class);
|
||||||
final List<UserInfo> profileList = userManager.getProfiles(UserHandle.getCallingUserId());
|
final List<UserInfo> profileList = userManager.getProfiles(UserHandle.getCallingUserId());
|
||||||
// Only add non-Shell app as normal preference
|
// Only add non-Shell app as normal preference
|
||||||
final List<String> nonShellPackageList = bugreportWhitelistedPackages.stream()
|
final List<String> nonShellPackageList = bugreportAllowlistedPackages.stream()
|
||||||
.filter(pkg -> !SHELL_APP_PACKAGE.equals(pkg)).collect(Collectors.toList());
|
.filter(pkg -> !SHELL_APP_PACKAGE.equals(pkg)).collect(Collectors.toList());
|
||||||
Collections.sort(nonShellPackageList);
|
Collections.sort(nonShellPackageList);
|
||||||
for (String pkg : nonShellPackageList) {
|
for (String pkg : nonShellPackageList) {
|
||||||
@@ -202,15 +202,15 @@ public class BugReportHandlerUtil {
|
|||||||
return validBugReportHandlerApplicationInfos;
|
return validBugReportHandlerApplicationInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isBugreportWhitelistedApp(String app) {
|
private boolean isBugreportAllowlistedApp(String app) {
|
||||||
// Verify the app is bugreport-whitelisted
|
// Verify the app is bugreport-allowlisted
|
||||||
if (TextUtils.isEmpty(app)) {
|
if (TextUtils.isEmpty(app)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return ActivityManager.getService().getBugreportWhitelistedPackages().contains(app);
|
return ActivityManager.getService().getBugreportWhitelistedPackages().contains(app);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Failed to get bugreportWhitelistedPackages:", e);
|
Log.e(TAG, "Failed to get bugreportAllowlistedPackages:", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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
|
// Serves as a temporary list of tiles to ignore until we heard back from the PM that they
|
||||||
// are disabled.
|
// are disabled.
|
||||||
private static ArraySet<ComponentName> sTileBlacklist = new ArraySet<>();
|
private static ArraySet<ComponentName> sTileDenylist = new ArraySet<>();
|
||||||
|
|
||||||
private final PackageReceiver mPackageReceiver = new PackageReceiver();
|
private final PackageReceiver mPackageReceiver = new PackageReceiver();
|
||||||
private final List<CategoryListener> mCategoryListeners = new ArrayList<>();
|
private final List<CategoryListener> mCategoryListeners = new ArrayList<>();
|
||||||
@@ -177,9 +177,9 @@ public class SettingsBaseActivity extends FragmentActivity {
|
|||||||
boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
|
boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
|
||||||
if (isEnabled != enabled || state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
|
if (isEnabled != enabled || state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
sTileBlacklist.remove(component);
|
sTileDenylist.remove(component);
|
||||||
} else {
|
} else {
|
||||||
sTileBlacklist.add(component);
|
sTileDenylist.add(component);
|
||||||
}
|
}
|
||||||
pm.setComponentEnabledSetting(component, enabled
|
pm.setComponentEnabledSetting(component, enabled
|
||||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||||
@@ -217,7 +217,7 @@ public class SettingsBaseActivity extends FragmentActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void result) {
|
protected void onPostExecute(Void result) {
|
||||||
mCategoryManager.updateCategoryFromBlacklist(sTileBlacklist);
|
mCategoryManager.updateCategoryFromDenylist(sTileDenylist);
|
||||||
onCategoriesChanged();
|
onCategoriesChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -85,15 +85,19 @@ public class CategoryManager {
|
|||||||
tryInitCategories(context, forceClearCache);
|
tryInitCategories(context, forceClearCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void updateCategoryFromBlacklist(Set<ComponentName> tileBlacklist) {
|
/**
|
||||||
|
* Update category from deny list
|
||||||
|
* @param tileDenylist
|
||||||
|
*/
|
||||||
|
public synchronized void updateCategoryFromDenylist(Set<ComponentName> tileDenylist) {
|
||||||
if (mCategories == null) {
|
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++) {
|
for (int i = 0; i < mCategories.size(); i++) {
|
||||||
DashboardCategory category = mCategories.get(i);
|
DashboardCategory category = mCategories.get(i);
|
||||||
for (int j = 0; j < category.getTilesCount(); j++) {
|
for (int j = 0; j < category.getTilesCount(); j++) {
|
||||||
Tile tile = category.getTile(j);
|
Tile tile = category.getTile(j);
|
||||||
if (tileBlacklist.contains(tile.getIntent().getComponent())) {
|
if (tileDenylist.contains(tile.getIntent().getComponent())) {
|
||||||
category.removeTile(j--);
|
category.removeTile(j--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -175,7 +175,7 @@ public class UnrestrictedDataAccessPreference extends AppSwitchPreference implem
|
|||||||
if (isDisabledByAdmin()) {
|
if (isDisabledByAdmin()) {
|
||||||
setSummary(R.string.disabled_by_admin);
|
setSummary(R.string.disabled_by_admin);
|
||||||
} else if (mDataUsageState.isDataSaverDenylisted) {
|
} else if (mDataUsageState.isDataSaverDenylisted) {
|
||||||
setSummary(R.string.restrict_background_blacklisted);
|
setSummary(R.string.restrict_background_blocklisted);
|
||||||
} else {
|
} else {
|
||||||
setSummary("");
|
setSummary("");
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@ public class BackgroundActivityPreferenceController extends AbstractPreferenceCo
|
|||||||
|
|
||||||
public void updateSummary(Preference preference) {
|
public void updateSummary(Preference preference) {
|
||||||
if (mPowerAllowlistBackend.isAllowlisted(mTargetPackage)) {
|
if (mPowerAllowlistBackend.isAllowlisted(mTargetPackage)) {
|
||||||
preference.setSummary(R.string.background_activity_summary_whitelisted);
|
preference.setSummary(R.string.background_activity_summary_allowlisted);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int mode = mAppOpsManager
|
final int mode = mAppOpsManager
|
||||||
|
@@ -391,11 +391,11 @@ public class BatteryAppListPreferenceController extends AbstractPreferenceContro
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldShowSummary(BatterySipper sipper) {
|
private boolean shouldShowSummary(BatterySipper sipper) {
|
||||||
final CharSequence[] whitelistPackages = mContext.getResources()
|
final CharSequence[] allowlistPackages = mContext.getResources()
|
||||||
.getTextArray(R.array.whitelist_hide_summary_in_battery_usage);
|
.getTextArray(R.array.allowlist_hide_summary_in_battery_usage);
|
||||||
final String target = sipper.packageWithHighestDrain;
|
final String target = sipper.packageWithHighestDrain;
|
||||||
|
|
||||||
for (CharSequence packageName: whitelistPackages) {
|
for (CharSequence packageName: allowlistPackages) {
|
||||||
if (TextUtils.equals(target, packageName)) {
|
if (TextUtils.equals(target, packageName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -306,7 +306,7 @@ public class PanelFragment extends Fragment {
|
|||||||
* Watching for the {@link Slice} to load.
|
* Watching for the {@link Slice} to load.
|
||||||
* <p>
|
* <p>
|
||||||
* If the Slice comes back {@code null} or with the Error attribute, if slice
|
* 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.
|
* keep the Slice data.
|
||||||
* <p>
|
* <p>
|
||||||
* If the Slice has come back fully loaded, then mark the Slice as loaded. No
|
* 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) {
|
private void removeSliceLiveData(Uri uri) {
|
||||||
final List<String> whiteList = Arrays.asList(
|
final List<String> allowList = Arrays.asList(
|
||||||
getResources().getStringArray(
|
getResources().getStringArray(
|
||||||
R.array.config_panel_keep_observe_uri));
|
R.array.config_panel_keep_observe_uri));
|
||||||
if (!whiteList.contains(uri.toString())) {
|
if (!allowList.contains(uri.toString())) {
|
||||||
mSliceLiveData.remove(uri);
|
mSliceLiveData.remove(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,13 +45,13 @@ public class SearchFeatureProviderImpl implements SearchFeatureProvider {
|
|||||||
final String packageName = caller.getPackageName();
|
final String packageName = caller.getPackageName();
|
||||||
final boolean isSettingsPackage = TextUtils.equals(packageName, context.getPackageName())
|
final boolean isSettingsPackage = TextUtils.equals(packageName, context.getPackageName())
|
||||||
|| TextUtils.equals(getSettingsIntelligencePkgName(context), packageName);
|
|| TextUtils.equals(getSettingsIntelligencePkgName(context), packageName);
|
||||||
final boolean isWhitelistedPackage =
|
final boolean isAllowlistedPackage =
|
||||||
isSignatureAllowlisted(context, caller.getPackageName());
|
isSignatureAllowlisted(context, caller.getPackageName());
|
||||||
if (isSettingsPackage || isWhitelistedPackage) {
|
if (isSettingsPackage || isAllowlistedPackage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new SecurityException("Search result intents must be called with from a "
|
throw new SecurityException("Search result intents must be called with from a "
|
||||||
+ "whitelisted package.");
|
+ "allowlisted package.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -328,7 +328,7 @@ public class SettingsSliceProvider extends SliceProvider {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
descendants.addAll(customSlices);
|
descendants.addAll(customSlices);
|
||||||
}
|
}
|
||||||
grantWhitelistedPackagePermissions(getContext(), descendants);
|
grantAllowlistedPackagePermissions(getContext(), descendants);
|
||||||
return descendants;
|
return descendants;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,23 +344,23 @@ public class SettingsSliceProvider extends SliceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static void grantWhitelistedPackagePermissions(Context context, List<Uri> descendants) {
|
static void grantAllowlistedPackagePermissions(Context context, List<Uri> descendants) {
|
||||||
if (descendants == null) {
|
if (descendants == null) {
|
||||||
Log.d(TAG, "No descendants to grant permission with, skipping.");
|
Log.d(TAG, "No descendants to grant permission with, skipping.");
|
||||||
}
|
}
|
||||||
final String[] whitelistPackages =
|
final String[] allowlistPackages =
|
||||||
context.getResources().getStringArray(R.array.slice_whitelist_package_names);
|
context.getResources().getStringArray(R.array.slice_allowlist_package_names);
|
||||||
if (whitelistPackages == null || whitelistPackages.length == 0) {
|
if (allowlistPackages == null || allowlistPackages.length == 0) {
|
||||||
Log.d(TAG, "No packages to whitelist, skipping.");
|
Log.d(TAG, "No packages to allowlist, skipping.");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, String.format(
|
Log.d(TAG, String.format(
|
||||||
"Whitelisting %d uris to %d pkgs.",
|
"Allowlisting %d uris to %d pkgs.",
|
||||||
descendants.size(), whitelistPackages.length));
|
descendants.size(), allowlistPackages.length));
|
||||||
}
|
}
|
||||||
final SliceManager sliceManager = context.getSystemService(SliceManager.class);
|
final SliceManager sliceManager = context.getSystemService(SliceManager.class);
|
||||||
for (Uri descendant : descendants) {
|
for (Uri descendant : descendants) {
|
||||||
for (String toPackage : whitelistPackages) {
|
for (String toPackage : allowlistPackages) {
|
||||||
sliceManager.grantSlicePermission(toPackage, descendant);
|
sliceManager.grantSlicePermission(toPackage, descendant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -167,7 +167,7 @@ public class AppDialogFragment extends InstrumentedDialogFragment implements App
|
|||||||
try {
|
try {
|
||||||
if (mPackageInfo.packageName.equals(VpnUtils.getConnectedPackage(mService, userId))) {
|
if (mPackageInfo.packageName.equals(VpnUtils.getConnectedPackage(mService, userId))) {
|
||||||
mService.setAlwaysOnVpnPackage(userId, null, /* lockdownEnabled */ false,
|
mService.setAlwaysOnVpnPackage(userId, null, /* lockdownEnabled */ false,
|
||||||
/* lockdownWhitelist */ null);
|
/* lockdownAllowlist */ null);
|
||||||
mService.prepareVpn(mPackageInfo.packageName, VpnConfig.LEGACY_VPN, userId);
|
mService.prepareVpn(mPackageInfo.packageName, VpnConfig.LEGACY_VPN, userId);
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
@@ -231,7 +231,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
private boolean setAlwaysOnVpn(boolean isEnabled, boolean isLockdown) {
|
private boolean setAlwaysOnVpn(boolean isEnabled, boolean isLockdown) {
|
||||||
return mConnectivityManager.setAlwaysOnVpnPackageForUser(mUserId,
|
return mConnectivityManager.setAlwaysOnVpnPackageForUser(mUserId,
|
||||||
isEnabled ? mPackageName : null, isLockdown, /* lockdownWhitelist */ null);
|
isEnabled ? mPackageName : null, isLockdown, /* lockdownAllowlist */ null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUI() {
|
private void updateUI() {
|
||||||
|
@@ -180,7 +180,7 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
|
|||||||
|
|
||||||
final ConnectivityManager conn = ConnectivityManager.from(mContext);
|
final ConnectivityManager conn = ConnectivityManager.from(mContext);
|
||||||
conn.setAlwaysOnVpnPackageForUser(UserHandle.myUserId(), null,
|
conn.setAlwaysOnVpnPackageForUser(UserHandle.myUserId(), null,
|
||||||
/* lockdownEnabled */ false, /* lockdownWhitelist */ null);
|
/* lockdownEnabled */ false, /* lockdownAllowlist */ null);
|
||||||
VpnUtils.setLockdownVpn(mContext, profile.key);
|
VpnUtils.setLockdownVpn(mContext, profile.key);
|
||||||
} else {
|
} else {
|
||||||
// update only if lockdown vpn has been changed
|
// update only if lockdown vpn has been changed
|
||||||
|
@@ -15,6 +15,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<!-- List of packages that should be whitelisted for slice uri access. Do not translate -->
|
<!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
|
||||||
<string-array name="slice_whitelist_package_names" translatable="false"/>
|
<string-array name="slice_allowlist_package_names" translatable="false"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -81,9 +81,9 @@
|
|||||||
<item>fake_package/fake_service</item>
|
<item>fake_package/fake_service</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- List of packages that should be whitelisted for slice uri access. Do not translate -->
|
<!-- List of packages that should be allowlisted for slice uri access. Do not translate -->
|
||||||
<string-array name="slice_whitelist_package_names" translatable="false">
|
<string-array name="slice_allowlist_package_names" translatable="false">
|
||||||
<item>com.android.settings.slice_whitelist_package</item>
|
<item>com.android.settings.slice_allowlist_package</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Email address for the homepage contextual cards feedback -->
|
<!-- Email address for the homepage contextual cards feedback -->
|
||||||
|
@@ -329,9 +329,9 @@ public final class ApplicationFeatureProviderImplTest {
|
|||||||
|
|
||||||
ReflectionHelpers.setField(mProvider, "mContext", spyContext);
|
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
|
@Test
|
||||||
@@ -351,9 +351,9 @@ public final class ApplicationFeatureProviderImplTest {
|
|||||||
|
|
||||||
ReflectionHelpers.setField(mProvider, "mContext", spyContext);
|
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() {
|
private void setUpUsersAndInstalledApps() {
|
||||||
|
@@ -93,7 +93,7 @@ public class SpecialAppAccessPreferenceControllerTest {
|
|||||||
entry.hasLauncherEntry = true;
|
entry.hasLauncherEntry = true;
|
||||||
entry.info = new ApplicationInfo();
|
entry.info = new ApplicationInfo();
|
||||||
entry.extraInfo = new AppStateDataUsageBridge.DataUsageState(
|
entry.extraInfo = new AppStateDataUsageBridge.DataUsageState(
|
||||||
true /* whitelisted */, false /* blacklisted */);
|
true /* allowlisted */, false /* denylisted */);
|
||||||
apps.add(entry);
|
apps.add(entry);
|
||||||
when(mSession.getAllApps()).thenReturn(apps);
|
when(mSession.getAllApps()).thenReturn(apps);
|
||||||
|
|
||||||
|
@@ -596,8 +596,8 @@ public class ManageApplicationsTest {
|
|||||||
mFragment.onItemSelected(null, null, 0, 0);
|
mFragment.onItemSelected(null, null, 0, 0);
|
||||||
|
|
||||||
AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter");
|
AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter");
|
||||||
assertThat(filter.filterApp(createPowerWhiteListApp(false))).isFalse();
|
assertThat(filter.filterApp(createPowerAllowListApp(false))).isFalse();
|
||||||
assertThat(filter.filterApp(createPowerWhiteListApp(true))).isTrue();
|
assertThat(filter.filterApp(createPowerAllowListApp(true))).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -615,8 +615,8 @@ public class ManageApplicationsTest {
|
|||||||
mFragment.onItemSelected(null, null, 1, 0);
|
mFragment.onItemSelected(null, null, 1, 0);
|
||||||
|
|
||||||
AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter");
|
AppFilter filter = ReflectionHelpers.getField(adapter, "mCompositeFilter");
|
||||||
assertThat(filter.filterApp(createPowerWhiteListApp(false))).isTrue();
|
assertThat(filter.filterApp(createPowerAllowListApp(false))).isTrue();
|
||||||
assertThat(filter.filterApp(createPowerWhiteListApp(true))).isTrue();
|
assertThat(filter.filterApp(createPowerAllowListApp(true))).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpOptionMenus() {
|
private void setUpOptionMenus() {
|
||||||
@@ -646,11 +646,11 @@ public class ManageApplicationsTest {
|
|||||||
return appList;
|
return appList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppEntry createPowerWhiteListApp(boolean isPowerWhiteListed) {
|
private AppEntry createPowerAllowListApp(boolean isPowerAllowListed) {
|
||||||
final ApplicationInfo info = new ApplicationInfo();
|
final ApplicationInfo info = new ApplicationInfo();
|
||||||
info.sourceDir = "abc";
|
info.sourceDir = "abc";
|
||||||
final AppEntry entry = new AppEntry(mContext, info, 0);
|
final AppEntry entry = new AppEntry(mContext, info, 0);
|
||||||
entry.extraInfo = isPowerWhiteListed ? Boolean.TRUE : Boolean.FALSE;
|
entry.extraInfo = isPowerAllowListed ? Boolean.TRUE : Boolean.FALSE;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ import java.util.Set;
|
|||||||
public class XmlControllerAttributeTest {
|
public class XmlControllerAttributeTest {
|
||||||
|
|
||||||
// List of XML that could be retrieved from the illegalClasses list.
|
// 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 =
|
private static final String NO_VALID_CONSTRUCTOR_ERROR =
|
||||||
"Controllers added in XML need a constructor following either:"
|
"Controllers added in XML need a constructor following either:"
|
||||||
@@ -62,7 +62,7 @@ public class XmlControllerAttributeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testAllIndexableXML_onlyValidBasePreferenceControllersAdded() throws Exception {
|
public void testAllIndexableXML_onlyValidBasePreferenceControllersAdded() throws Exception {
|
||||||
Set<Integer> xmlSet = getIndexableXml();
|
Set<Integer> xmlSet = getIndexableXml();
|
||||||
xmlSet.addAll(whitelistXml);
|
xmlSet.addAll(mAllowlistXml);
|
||||||
|
|
||||||
List<String> xmlControllers = new ArrayList<>();
|
List<String> xmlControllers = new ArrayList<>();
|
||||||
Set<String> invalidConstructors = new HashSet<>();
|
Set<String> invalidConstructors = new HashSet<>();
|
||||||
|
@@ -53,11 +53,11 @@ public class InstrumentableFragmentCodeInspector extends CodeInspector {
|
|||||||
}
|
}
|
||||||
final String className = clazz.getName();
|
final String className = clazz.getName();
|
||||||
// If it's a fragment, it must also be instrumentable.
|
// If it's a fragment, it must also be instrumentable.
|
||||||
final boolean whitelisted =
|
final boolean allowlisted =
|
||||||
mNotImplementingInstrumentableExemptList.remove(className);
|
mNotImplementingInstrumentableExemptList.remove(className);
|
||||||
if (Fragment.class.isAssignableFrom(clazz)
|
if (Fragment.class.isAssignableFrom(clazz)
|
||||||
&& !Instrumentable.class.isAssignableFrom(clazz)
|
&& !Instrumentable.class.isAssignableFrom(clazz)
|
||||||
&& !whitelisted) {
|
&& !allowlisted) {
|
||||||
broken.add(className);
|
broken.add(className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -155,7 +155,7 @@ public class BackgroundActivityPreferenceControllerTest {
|
|||||||
mController.updateState(mPreference);
|
mController.updateState(mPreference);
|
||||||
assertThat(mPreference.isEnabled()).isFalse();
|
assertThat(mPreference.isEnabled()).isFalse();
|
||||||
assertThat(mPreference.getSummary()).isEqualTo(
|
assertThat(mPreference.getSummary()).isEqualTo(
|
||||||
mShadowContext.getText(R.string.background_activity_summary_whitelisted));
|
mShadowContext.getText(R.string.background_activity_summary_allowlisted));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -206,7 +206,7 @@ public class NotificationPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIsBlockable_oemWhitelist() {
|
public void testIsBlockable_oemAllowlist() {
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
NotificationChannel channel = mock(NotificationChannel.class);
|
NotificationChannel channel = mock(NotificationChannel.class);
|
||||||
when(channel.isImportanceLockedByOEM()).thenReturn(true);
|
when(channel.isImportanceLockedByOEM()).thenReturn(true);
|
||||||
|
@@ -625,25 +625,25 @@ public class SettingsSliceProviderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "mcc998")
|
@Config(qualifiers = "mcc998")
|
||||||
public void grantWhitelistedPackagePermissions_noWhitelist_shouldNotGrant() {
|
public void grantAllowlistedPackagePermissions_noAllowlist_shouldNotGrant() {
|
||||||
final List<Uri> uris = new ArrayList<>();
|
final List<Uri> uris = new ArrayList<>();
|
||||||
uris.add(Uri.parse("content://settings/slice"));
|
uris.add(Uri.parse("content://settings/slice"));
|
||||||
|
|
||||||
SettingsSliceProvider.grantWhitelistedPackagePermissions(mContext, uris);
|
SettingsSliceProvider.grantAllowlistedPackagePermissions(mContext, uris);
|
||||||
|
|
||||||
verify(mManager, never()).grantSlicePermission(anyString(), any(Uri.class));
|
verify(mManager, never()).grantSlicePermission(anyString(), any(Uri.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "mcc999")
|
@Config(qualifiers = "mcc999")
|
||||||
public void grantWhitelistedPackagePermissions_hasPackageWhitelist_shouldGrant() {
|
public void grantAllowlistedPackagePermissions_hasPackageAllowlist_shouldGrant() {
|
||||||
final List<Uri> uris = new ArrayList<>();
|
final List<Uri> uris = new ArrayList<>();
|
||||||
uris.add(Uri.parse("content://settings/slice"));
|
uris.add(Uri.parse("content://settings/slice"));
|
||||||
|
|
||||||
SettingsSliceProvider.grantWhitelistedPackagePermissions(mContext, uris);
|
SettingsSliceProvider.grantAllowlistedPackagePermissions(mContext, uris);
|
||||||
|
|
||||||
verify(mManager)
|
verify(mManager)
|
||||||
.grantSlicePermission("com.android.settings.slice_whitelist_package", uris.get(0));
|
.grantSlicePermission("com.android.settings.slice_allowlist_package", uris.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -111,12 +111,12 @@ public class SliceControllerInXmlCodeInspector extends CodeInspector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!mXmlDeclaredControllers.contains(clazz.getName())) {
|
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());
|
missingControllersInXml.add(clazz.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removed whitelisted classes
|
// Removed allowlisted classes
|
||||||
missingControllersInXml.removeAll(mExemptedClasses);
|
missingControllersInXml.removeAll(mExemptedClasses);
|
||||||
|
|
||||||
final String missingControllerError =
|
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 android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
|
||||||
|
|
||||||
import static com.android.settings.SettingsActivity.META_DATA_KEY_FRAGMENT_CLASS;
|
import static com.android.settings.SettingsActivity.META_DATA_KEY_FRAGMENT_CLASS;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import static junit.framework.Assert.fail;
|
import static junit.framework.Assert.fail;
|
||||||
@@ -88,11 +89,11 @@ public class SettingsGatewayTest {
|
|||||||
@Presubmit
|
@Presubmit
|
||||||
public void publicFragmentMustAppearInSettingsGateway()
|
public void publicFragmentMustAppearInSettingsGateway()
|
||||||
throws PackageManager.NameNotFoundException {
|
throws PackageManager.NameNotFoundException {
|
||||||
final List<String> whitelistedFragment = new ArrayList<>();
|
final List<String> allowlistedFragment = new ArrayList<>();
|
||||||
final StringBuilder error = new StringBuilder();
|
final StringBuilder error = new StringBuilder();
|
||||||
|
|
||||||
for (String fragment : SettingsGateway.ENTRY_FRAGMENTS) {
|
for (String fragment : SettingsGateway.ENTRY_FRAGMENTS) {
|
||||||
whitelistedFragment.add(fragment);
|
allowlistedFragment.add(fragment);
|
||||||
}
|
}
|
||||||
final PackageInfo pi = mPackageManager.getPackageInfo(mPackageName,
|
final PackageInfo pi = mPackageManager.getPackageInfo(mPackageName,
|
||||||
GET_META_DATA | MATCH_DISABLED_COMPONENTS | GET_ACTIVITIES);
|
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);
|
final String fragmentName = metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
|
||||||
|
|
||||||
assertThat(fragmentName).isNotNull();
|
assertThat(fragmentName).isNotNull();
|
||||||
if (!whitelistedFragment.contains(fragmentName)) {
|
if (!allowlistedFragment.contains(fragmentName)) {
|
||||||
error.append("SettingsGateway.ENTRY_FRAGMENTS must contain " + fragmentName
|
error.append("SettingsGateway.ENTRY_FRAGMENTS must contain " + fragmentName
|
||||||
+ " because this fragment is used in manifest for " + activity.name)
|
+ " because this fragment is used in manifest for " + activity.name)
|
||||||
.append("\n");
|
.append("\n");
|
||||||
|
@@ -56,7 +56,7 @@ public class UniquePreferenceTest {
|
|||||||
private static final List<String> IGNORE_PREF_TYPES = Arrays.asList(
|
private static final List<String> IGNORE_PREF_TYPES = Arrays.asList(
|
||||||
"com.android.settingslib.widget.FooterPreference");
|
"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
|
"owner_info_settings", // Lock screen message in security - multiple xml files
|
||||||
// contain this because security page is constructed by
|
// contain this because security page is constructed by
|
||||||
// combining small xml chunks. Eventually the page
|
// combining small xml chunks. Eventually the page
|
||||||
@@ -185,7 +185,7 @@ public class UniquePreferenceTest {
|
|||||||
nullKeyClasses.add(className);
|
nullKeyClasses.add(className);
|
||||||
continue;
|
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 "
|
Log.e(TAG, "Every preference key must unique; found "
|
||||||
+ " in " + className
|
+ " in " + className
|
||||||
+ " / " + key);
|
+ " / " + key);
|
||||||
@@ -209,7 +209,7 @@ public class UniquePreferenceTest {
|
|||||||
nullKeyClasses.add(className);
|
nullKeyClasses.add(className);
|
||||||
continue;
|
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
|
Log.e(TAG, "Every SearchIndexableRaw key must unique; found " + raw.key
|
||||||
+ " in " + className);
|
+ " in " + className);
|
||||||
duplicatedKeys.add(raw.key);
|
duplicatedKeys.add(raw.key);
|
||||||
|
Reference in New Issue
Block a user