Use more inclusive terms inside GraphicsEnvironment.

Bug: b/162288333
Test: N/A
Change-Id: I2f1f13a892be0c8ff3f89e0ceabe39058390727d
diff --git a/Android.bp b/Android.bp
index 23cd1a1..bcac22d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -426,7 +426,7 @@
         "apex_aidl_interface-java",
         "suspend_control_aidl_interface-java",
         "framework-protos",
-        "game-driver-protos",
+        "updatable-driver-protos",
         "android.hidl.base-V1.0-java",
         "android.hardware.cas-V1.0-java",
         "android.hardware.cas-V1.1-java",
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index df58a6c..1539b6e 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -78,7 +78,7 @@
     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 @@
                     + "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 @@
     }
 
     /**
-     * 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 @@
      * @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 @@
         // 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 @@
         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 9ee8898..b3bf91b 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -12322,24 +12322,24 @@
         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
diff --git a/core/proto/android/providers/settings/global.proto b/core/proto/android/providers/settings/global.proto
index 9bbe0ca..21b7960 100644
--- a/core/proto/android/providers/settings/global.proto
+++ b/core/proto/android/providers/settings/global.proto
@@ -445,14 +445,14 @@
         // i.e. <pkg1>,<pkg2>,...,<pkgN>
         optional SettingProto game_driver_opt_out_apps = 10;
         // Game Driver - List of Apps that are forbidden to use Game Driver
-        optional SettingProto game_driver_blacklist = 11;
+        optional SettingProto game_driver_denylist = 11;
         // Game Driver - List of Apps that are allowed to use Game Driver
-        optional SettingProto game_driver_whitelist = 12;
+        optional SettingProto game_driver_allowlist = 12;
         // ANGLE - List of Apps that can check ANGLE rules
         optional SettingProto angle_whitelist = 13;
-        // Game Driver - List of blacklists, each blacklist is a blacklist for
+        // Game Driver - List of denylists, each denylist is a denylist for
         // a specific Game Driver version
-        optional SettingProto game_driver_blacklists = 14;
+        optional SettingProto game_driver_denylists = 14;
         // ANGLE - Show a dialog box when ANGLE is selected for the currently running PKG
         optional SettingProto show_angle_in_use_dialog = 15;
         // Game Driver - List of libraries in sphal accessible by Game Driver
diff --git a/graphics/proto/Android.bp b/graphics/proto/Android.bp
index ddced59..ea79b73 100644
--- a/graphics/proto/Android.bp
+++ b/graphics/proto/Android.bp
@@ -1,10 +1,10 @@
 java_library_static {
-    name: "game-driver-protos",
+    name: "updatable-driver-protos",
     host_supported: true,
     proto: {
         type: "lite",
     },
-    srcs: ["game_driver.proto"],
+    srcs: ["updatable_driver.proto"],
     jarjar_rules: "jarjar-rules.txt",
-    sdk_version: "28",
+    sdk_version: "30",
 }
diff --git a/graphics/proto/game_driver.proto b/graphics/proto/updatable_driver.proto
similarity index 77%
rename from graphics/proto/game_driver.proto
rename to graphics/proto/updatable_driver.proto
index fd7ffcc..cbc9424 100644
--- a/graphics/proto/game_driver.proto
+++ b/graphics/proto/updatable_driver.proto
@@ -16,16 +16,16 @@
 
 syntax = "proto2";
 
-package android.gamedriver;
+package android.updatabledriver;
 
-option java_package = "android.gamedriver";
-option java_outer_classname = "GameDriverProto";
+option java_package = "android.updatabledriver";
+option java_outer_classname = "UpdatableDriverProto";
 
-message Blacklist {
+message Denylist {
     optional int64 version_code = 1;
     repeated string package_names = 2;
 }
 
-message Blacklists {
-    repeated Blacklist blacklists = 1;
+message Denylists {
+    repeated Denylist denylists = 1;
 }
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 1d25b1a..6fd6f71 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -785,14 +785,14 @@
                 Settings.Global.GAME_DRIVER_OPT_OUT_APPS,
                 GlobalSettingsProto.Gpu.GAME_DRIVER_OPT_OUT_APPS);
         dumpSetting(s, p,
-                Settings.Global.GAME_DRIVER_BLACKLIST,
-                GlobalSettingsProto.Gpu.GAME_DRIVER_BLACKLIST);
+                Settings.Global.GAME_DRIVER_DENYLIST,
+                GlobalSettingsProto.Gpu.GAME_DRIVER_DENYLIST);
         dumpSetting(s, p,
-                Settings.Global.GAME_DRIVER_WHITELIST,
-                GlobalSettingsProto.Gpu.GAME_DRIVER_WHITELIST);
+                Settings.Global.GAME_DRIVER_ALLOWLIST,
+                GlobalSettingsProto.Gpu.GAME_DRIVER_ALLOWLIST);
         dumpSetting(s, p,
-                Settings.Global.GAME_DRIVER_BLACKLISTS,
-                GlobalSettingsProto.Gpu.GAME_DRIVER_BLACKLISTS);
+                Settings.Global.GAME_DRIVER_DENYLISTS,
+                GlobalSettingsProto.Gpu.GAME_DRIVER_DENYLISTS);
         dumpSetting(s, p,
                 Settings.Global.GAME_DRIVER_SPHAL_LIBRARIES,
                 GlobalSettingsProto.Gpu.GAME_DRIVER_SPHAL_LIBRARIES);
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index b90b9c1..ed0481b 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -508,9 +508,9 @@
                     Settings.Global.GAME_DRIVER_OPT_IN_APPS,
                     Settings.Global.GAME_DRIVER_PRERELEASE_OPT_IN_APPS,
                     Settings.Global.GAME_DRIVER_OPT_OUT_APPS,
-                    Settings.Global.GAME_DRIVER_BLACKLISTS,
-                    Settings.Global.GAME_DRIVER_BLACKLIST,
-                    Settings.Global.GAME_DRIVER_WHITELIST,
+                    Settings.Global.GAME_DRIVER_DENYLISTS,
+                    Settings.Global.GAME_DRIVER_DENYLIST,
+                    Settings.Global.GAME_DRIVER_ALLOWLIST,
                     Settings.Global.GAME_DRIVER_SPHAL_LIBRARIES,
                     Settings.Global.GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX,
                     Settings.Global.GPU_DEBUG_LAYER_APP,
diff --git a/services/core/java/com/android/server/am/CoreSettingsObserver.java b/services/core/java/com/android/server/am/CoreSettingsObserver.java
index 8527ae9..d0ca84f 100644
--- a/services/core/java/com/android/server/am/CoreSettingsObserver.java
+++ b/services/core/java/com/android/server/am/CoreSettingsObserver.java
@@ -105,9 +105,9 @@
         sGlobalSettingToTypeMap.put(
                 Settings.Global.GAME_DRIVER_PRERELEASE_OPT_IN_APPS, String.class);
         sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_OPT_OUT_APPS, String.class);
-        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_BLACKLIST, String.class);
-        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_WHITELIST, String.class);
-        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_BLACKLISTS, String.class);
+        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_DENYLIST, String.class);
+        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_ALLOWLIST, String.class);
+        sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_DENYLISTS, String.class);
         sGlobalSettingToTypeMap.put(Settings.Global.GAME_DRIVER_SPHAL_LIBRARIES, String.class);
         // add other global settings here...
 
diff --git a/services/core/java/com/android/server/gpu/GpuService.java b/services/core/java/com/android/server/gpu/GpuService.java
index 8a3c963..c0617ca 100644
--- a/services/core/java/com/android/server/gpu/GpuService.java
+++ b/services/core/java/com/android/server/gpu/GpuService.java
@@ -29,8 +29,6 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.database.ContentObserver;
-import android.gamedriver.GameDriverProto.Blacklist;
-import android.gamedriver.GameDriverProto.Blacklists;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Handler;
@@ -40,6 +38,8 @@
 import android.provider.DeviceConfig.Properties;
 import android.provider.Settings;
 import android.text.TextUtils;
+import android.updatabledriver.UpdatableDriverProto.Denylist;
+import android.updatabledriver.UpdatableDriverProto.Denylists;
 import android.util.Base64;
 import android.util.Slog;
 
@@ -65,7 +65,7 @@
 
     private static final String PROD_DRIVER_PROPERTY = "ro.gfx.driver.0";
     private static final String DEV_DRIVER_PROPERTY = "ro.gfx.driver.1";
-    private static final String GAME_DRIVER_WHITELIST_FILENAME = "whitelist.txt";
+    private static final String GAME_DRIVER_ALLOWLIST_FILENAME = "allowlist.txt";
     private static final int BASE64_FLAGS = Base64.NO_PADDING | Base64.NO_WRAP;
 
     private final Context mContext;
@@ -81,7 +81,7 @@
     private SettingsObserver mSettingsObserver;
     private DeviceConfigListener mDeviceConfigListener;
     @GuardedBy("mLock")
-    private Blacklists mBlacklists;
+    private Denylists mDenylists;
 
     public GpuService(Context context) {
         super(context);
@@ -118,19 +118,19 @@
             mSettingsObserver = new SettingsObserver();
             mDeviceConfigListener = new DeviceConfigListener();
             fetchGameDriverPackageProperties();
-            processBlacklists();
-            setBlacklist();
+            processDenylists();
+            setDenylist();
             fetchDeveloperDriverPackageProperties();
         }
     }
 
     private final class SettingsObserver extends ContentObserver {
-        private final Uri mGameDriverBlackUri =
-                Settings.Global.getUriFor(Settings.Global.GAME_DRIVER_BLACKLISTS);
+        private final Uri mGameDriverDenylistsUri =
+                Settings.Global.getUriFor(Settings.Global.GAME_DRIVER_DENYLISTS);
 
         SettingsObserver() {
             super(new Handler());
-            mContentResolver.registerContentObserver(mGameDriverBlackUri, false, this,
+            mContentResolver.registerContentObserver(mGameDriverDenylistsUri, false, this,
                     UserHandle.USER_ALL);
         }
 
@@ -140,9 +140,9 @@
                 return;
             }
 
-            if (mGameDriverBlackUri.equals(uri)) {
-                processBlacklists();
-                setBlacklist();
+            if (mGameDriverDenylistsUri.equals(uri)) {
+                processDenylists();
+                setDenylist();
             }
         }
     }
@@ -157,10 +157,10 @@
         @Override
         public void onPropertiesChanged(Properties properties) {
             synchronized (mDeviceConfigLock) {
-                if (properties.getKeyset().contains(Settings.Global.GAME_DRIVER_BLACKLISTS)) {
-                    parseBlacklists(
-                            properties.getString(Settings.Global.GAME_DRIVER_BLACKLISTS, ""));
-                    setBlacklist();
+                if (properties.getKeyset().contains(Settings.Global.GAME_DRIVER_DENYLISTS)) {
+                    parseDenylists(
+                            properties.getString(Settings.Global.GAME_DRIVER_DENYLISTS, ""));
+                    setDenylist();
                 }
             }
         }
@@ -187,7 +187,7 @@
                 case ACTION_PACKAGE_REMOVED:
                     if (isProdDriver) {
                         fetchGameDriverPackageProperties();
-                        setBlacklist();
+                        setDenylist();
                     } else if (isDevDriver) {
                         fetchDeveloperDriverPackageProperties();
                     }
@@ -239,17 +239,17 @@
             return;
         }
 
-        // Reset the whitelist.
+        // Reset the allowlist.
         Settings.Global.putString(mContentResolver,
-                                  Settings.Global.GAME_DRIVER_WHITELIST, "");
+                                  Settings.Global.GAME_DRIVER_ALLOWLIST, "");
         mGameDriverVersionCode = driverInfo.longVersionCode;
 
         try {
             final Context driverContext = mContext.createPackageContext(mProdDriverPackageName,
                                                                         Context.CONTEXT_RESTRICTED);
 
-            assetToSettingsGlobal(mContext, driverContext, GAME_DRIVER_WHITELIST_FILENAME,
-                    Settings.Global.GAME_DRIVER_WHITELIST, ",");
+            assetToSettingsGlobal(mContext, driverContext, GAME_DRIVER_ALLOWLIST_FILENAME,
+                    Settings.Global.GAME_DRIVER_ALLOWLIST, ",");
         } catch (PackageManager.NameNotFoundException e) {
             if (DEBUG) {
                 Slog.w(TAG, "driver package '" + mProdDriverPackageName + "' not installed");
@@ -257,48 +257,48 @@
         }
     }
 
-    private void processBlacklists() {
+    private void processDenylists() {
         String base64String = DeviceConfig.getProperty(DeviceConfig.NAMESPACE_GAME_DRIVER,
-                Settings.Global.GAME_DRIVER_BLACKLISTS);
+                Settings.Global.GAME_DRIVER_DENYLISTS);
         if (base64String == null) {
             base64String =
                     Settings.Global.getString(mContentResolver,
-                                              Settings.Global.GAME_DRIVER_BLACKLISTS);
+                                              Settings.Global.GAME_DRIVER_DENYLISTS);
         }
-        parseBlacklists(base64String != null ? base64String : "");
+        parseDenylists(base64String != null ? base64String : "");
     }
 
-    private void parseBlacklists(String base64String) {
+    private void parseDenylists(String base64String) {
         synchronized (mLock) {
-            // Reset all blacklists
-            mBlacklists = null;
+            // Reset all denylists
+            mDenylists = null;
             try {
-                mBlacklists = Blacklists.parseFrom(Base64.decode(base64String, BASE64_FLAGS));
+                mDenylists = Denylists.parseFrom(Base64.decode(base64String, BASE64_FLAGS));
             } catch (IllegalArgumentException e) {
                 if (DEBUG) {
-                    Slog.w(TAG, "Can't parse blacklist, skip and continue...");
+                    Slog.w(TAG, "Can't parse denylist, skip and continue...");
                 }
             } catch (InvalidProtocolBufferException e) {
                 if (DEBUG) {
-                    Slog.w(TAG, "Can't parse blacklist, skip and continue...");
+                    Slog.w(TAG, "Can't parse denylist, skip and continue...");
                 }
             }
         }
     }
 
-    private void setBlacklist() {
+    private void setDenylist() {
         Settings.Global.putString(mContentResolver,
-                                  Settings.Global.GAME_DRIVER_BLACKLIST, "");
+                                  Settings.Global.GAME_DRIVER_DENYLIST, "");
         synchronized (mLock) {
-            if (mBlacklists == null) {
+            if (mDenylists == null) {
                 return;
             }
-            List<Blacklist> blacklists = mBlacklists.getBlacklistsList();
-            for (Blacklist blacklist : blacklists) {
-                if (blacklist.getVersionCode() == mGameDriverVersionCode) {
+            List<Denylist> denylists = mDenylists.getDenylistsList();
+            for (Denylist denylist : denylists) {
+                if (denylist.getVersionCode() == mGameDriverVersionCode) {
                     Settings.Global.putString(mContentResolver,
-                            Settings.Global.GAME_DRIVER_BLACKLIST,
-                            String.join(",", blacklist.getPackageNamesList()));
+                            Settings.Global.GAME_DRIVER_DENYLIST,
+                            String.join(",", denylist.getPackageNamesList()));
                     return;
                 }
             }