diff options
| author | Peiyong Lin <lpy@google.com> | 2020-07-28 19:11:05 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-07-28 19:11:05 +0000 |
| commit | e5133fac3aa845a9d66f97b1cc15c99e784c624d (patch) | |
| tree | 1a003c6ba1beee9eb0096f5c4910d5211c9029bd /core/java/android | |
| parent | 082610738d06c057092ea65d1280c5456737c8a7 (diff) | |
| parent | 057d3ace10187fe342cab2937521e446024242dc (diff) | |
Merge "Use more inclusive terms inside GraphicsEnvironment." into rvc-dev-plus-aosp am: adda6254d8 am: 057d3ace10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12245299
Change-Id: If6852756f543023a23b10a2070962c297f8d81cd
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 48 | ||||
| -rwxr-xr-x | core/java/android/provider/Settings.java | 12 |
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 |
