summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorPeiyong Lin <lpy@google.com>2020-07-28 18:41:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-07-28 18:41:08 +0000
commitadda6254d836d51db06b6eb263fda84cf98f9157 (patch)
treee0e35a404cb41f6a0f2a02e9d2614204c6eb7494 /core/java
parent31457aebae3752b3fd338c8a3c555c940fee1223 (diff)
parentb967a4c3812313a7ea972efbc0764a8a52a59e11 (diff)
Merge "Use more inclusive terms inside GraphicsEnvironment." into rvc-dev-plus-aosp
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/GraphicsEnvironment.java48
-rwxr-xr-xcore/java/android/provider/Settings.java12
2 files changed, 30 insertions, 30 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index df58a6c636f5..1539b6ed4ca7 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -78,7 +78,7 @@ public class GraphicsEnvironment {
private static final String ACTION_ANGLE_FOR_ANDROID_TOAST_MESSAGE =
"android.app.action.ANGLE_FOR_ANDROID_TOAST_MESSAGE";
private static final String INTENT_KEY_A4A_TOAST_MESSAGE = "A4A Toast Message";
- private static final String GAME_DRIVER_WHITELIST_ALL = "*";
+ private static final String GAME_DRIVER_ALLOWLIST_ALL = "*";
private static final String GAME_DRIVER_SPHAL_LIBRARIES_FILENAME = "sphal_libraries.txt";
private static final int VULKAN_1_0 = 0x00400000;
private static final int VULKAN_1_1 = 0x00401000;
@@ -142,19 +142,19 @@ public class GraphicsEnvironment {
+ "set to: '" + devOptIn + "'");
}
- // We only want to use ANGLE if the app is whitelisted or the developer has
+ // We only want to use ANGLE if the app is allowlisted or the developer has
// explicitly chosen something other than default driver.
- // The whitelist will be generated by the ANGLE APK at both boot time and
+ // The allowlist will be generated by the ANGLE APK at both boot time and
// ANGLE update time. It will only include apps mentioned in the rules file.
- final boolean whitelisted = checkAngleWhitelist(context, coreSettings, packageName);
+ final boolean allowlisted = checkAngleAllowlist(context, coreSettings, packageName);
final boolean requested = devOptIn.equals(sDriverMap.get(OpenGlDriverChoice.ANGLE));
- final boolean useAngle = (whitelisted || requested);
+ final boolean useAngle = (allowlisted || requested);
if (!useAngle) {
return false;
}
- if (whitelisted) {
- Log.v(TAG, "ANGLE whitelist includes " + packageName);
+ if (allowlisted) {
+ Log.v(TAG, "ANGLE allowlist includes " + packageName);
}
if (requested) {
Log.v(TAG, "ANGLE developer option for " + packageName + ": " + devOptIn);
@@ -564,17 +564,17 @@ public class GraphicsEnvironment {
}
/**
- * Pull ANGLE whitelist from GlobalSettings and compare against current package
+ * Pull ANGLE allowlist from GlobalSettings and compare against current package
*/
- private static boolean checkAngleWhitelist(Context context, Bundle bundle, String packageName) {
+ private static boolean checkAngleAllowlist(Context context, Bundle bundle, String packageName) {
final ContentResolver contentResolver = context.getContentResolver();
- final List<String> angleWhitelist =
+ final List<String> angleAllowlist =
getGlobalSettingsString(contentResolver, bundle,
Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST);
- if (DEBUG) Log.v(TAG, "ANGLE whitelist: " + angleWhitelist);
+ if (DEBUG) Log.v(TAG, "ANGLE allowlist: " + angleAllowlist);
- return angleWhitelist.contains(packageName);
+ return angleAllowlist.contains(packageName);
}
/**
@@ -584,7 +584,7 @@ public class GraphicsEnvironment {
* @param bundle
* @param packageName
* @return true: ANGLE setup successfully
- * false: ANGLE not setup (not on whitelist, ANGLE not present, etc.)
+ * false: ANGLE not setup (not on allowlist, ANGLE not present, etc.)
*/
public boolean setupAngle(Context context, Bundle bundle, PackageManager pm,
String packageName) {
@@ -750,8 +750,8 @@ public class GraphicsEnvironment {
// 2. GAME_DRIVER_OPT_OUT_APPS
// 3. GAME_DRIVER_PRERELEASE_OPT_IN_APPS
// 4. GAME_DRIVER_OPT_IN_APPS
- // 5. GAME_DRIVER_BLACKLIST
- // 6. GAME_DRIVER_WHITELIST
+ // 5. GAME_DRIVER_DENYLIST
+ // 6. GAME_DRIVER_ALLOWLIST
switch (coreSettings.getInt(Settings.Global.GAME_DRIVER_ALL_APPS, 0)) {
case GAME_DRIVER_GLOBAL_OPT_IN_OFF:
if (DEBUG) Log.v(TAG, "Game Driver is turned off on this device.");
@@ -790,21 +790,21 @@ public class GraphicsEnvironment {
final boolean isOptIn =
getGlobalSettingsString(null, coreSettings, Settings.Global.GAME_DRIVER_OPT_IN_APPS)
.contains(appPackageName);
- final List<String> whitelist =
- getGlobalSettingsString(null, coreSettings, Settings.Global.GAME_DRIVER_WHITELIST);
- if (!isOptIn && whitelist.indexOf(GAME_DRIVER_WHITELIST_ALL) != 0
- && !whitelist.contains(appPackageName)) {
- if (DEBUG) Log.v(TAG, "App is not on the whitelist for Game Driver.");
+ final List<String> allowlist =
+ getGlobalSettingsString(null, coreSettings, Settings.Global.GAME_DRIVER_ALLOWLIST);
+ if (!isOptIn && allowlist.indexOf(GAME_DRIVER_ALLOWLIST_ALL) != 0
+ && !allowlist.contains(appPackageName)) {
+ if (DEBUG) Log.v(TAG, "App is not on the allowlist for Game Driver.");
return null;
}
- // If the application is not opted-in, then check whether it's on the blacklist,
- // terminate early if it's on the blacklist and fallback to system driver.
+ // If the application is not opted-in, then check whether it's on the denylist,
+ // terminate early if it's on the denylist and fallback to system driver.
if (!isOptIn
&& getGlobalSettingsString(
- null, coreSettings, Settings.Global.GAME_DRIVER_BLACKLIST)
+ null, coreSettings, Settings.Global.GAME_DRIVER_DENYLIST)
.contains(appPackageName)) {
- if (DEBUG) Log.v(TAG, "App is on the blacklist for Game Driver.");
+ if (DEBUG) Log.v(TAG, "App is on the denylist for Game Driver.");
return null;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9ee88982f598..b3bf91ba3c06 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -12322,24 +12322,24 @@ public final class Settings {
public static final String GAME_DRIVER_OPT_OUT_APPS = "game_driver_opt_out_apps";
/**
- * Apps on the blacklist that are forbidden to use Game Driver.
+ * Apps on the denylist that are forbidden to use Game Driver.
* @hide
*/
- public static final String GAME_DRIVER_BLACKLIST = "game_driver_blacklist";
+ public static final String GAME_DRIVER_DENYLIST = "game_driver_denylist";
/**
- * List of blacklists, each blacklist is a blacklist for a specific version of Game Driver.
+ * List of denylists, each denylist is a denylist for a specific version of Game Driver.
* @hide
*/
- public static final String GAME_DRIVER_BLACKLISTS = "game_driver_blacklists";
+ public static final String GAME_DRIVER_DENYLISTS = "game_driver_denylists";
/**
- * Apps on the whitelist that are allowed to use Game Driver.
+ * Apps on the allowlist that are allowed to use Game Driver.
* The string is a list of application package names, seperated by comma.
* i.e. <apk1>,<apk2>,...,<apkN>
* @hide
*/
- public static final String GAME_DRIVER_WHITELIST = "game_driver_whitelist";
+ public static final String GAME_DRIVER_ALLOWLIST = "game_driver_allowlist";
/**
* List of libraries in sphal accessible by Game Driver