OSDN Git Service

[GUP] Hard code the name of the whitelist file.
authorPeiyong Lin <lpy@google.com>
Thu, 3 Jan 2019 01:46:55 +0000 (17:46 -0800)
committerYiwei Zhang <zzyiwei@google.com>
Wed, 17 Apr 2019 01:35:17 +0000 (18:35 -0700)
Allowing customized whitelist filename could result in inconsistency and
fragmentations in toolings.

BUG: 120870520
Test: Build, flash and boot
Change-Id: Ibe9337b358b6a67600048f1661d73574d7bea607
Merged-In: Ibe9337b358b6a67600048f1661d73574d7bea607

core/java/android/os/GraphicsEnvironment.java

index 60003d3..2773c0e 100644 (file)
@@ -49,7 +49,7 @@ public class GraphicsEnvironment {
     private static final boolean DEBUG = false;
     private static final String TAG = "GraphicsEnvironment";
     private static final String PROPERTY_GFX_DRIVER = "ro.gfx.driver.0";
-    private static final String PROPERTY_GFX_DRIVER_WHITELIST = "ro.gfx.driver.whitelist.0";
+    private static final String GUP_WHITELIST_FILENAME = "whitelist.txt";
 
     private ClassLoader mClassLoader;
     private String mLayerPath;
@@ -241,22 +241,11 @@ public class GraphicsEnvironment {
 
     private static boolean onWhitelist(Context context, String driverPackageName,
             String applicationPackageName) {
-        String whitelistName = SystemProperties.get(PROPERTY_GFX_DRIVER_WHITELIST);
-
-        // Empty whitelist implies no updatable graphics driver. Typically, the pre-installed
-        // updatable graphics driver is supposed to be a place holder and contains no graphics
-        // driver and whitelist.
-        if (whitelistName == null || whitelistName.isEmpty()) {
-            if (DEBUG) {
-                Log.w(TAG, "No whitelist found.");
-            }
-            return false;
-        }
         try {
             Context driverContext = context.createPackageContext(driverPackageName,
                                                                  Context.CONTEXT_RESTRICTED);
             AssetManager assets = driverContext.getAssets();
-            InputStream stream = assets.open(whitelistName);
+            InputStream stream = assets.open(GUP_WHITELIST_FILENAME);
             BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
             for (String packageName; (packageName = reader.readLine()) != null; ) {
                 if (packageName.equals(applicationPackageName)) {