[GUP] Hard code the name of the whitelist file.
am: be09eef818
Change-Id: Ib63d6d818600961a5cba4ed2c2d33d654bd1c849
This commit is contained in:
@@ -49,7 +49,7 @@ public class GraphicsEnvironment {
|
|||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
private static final String TAG = "GraphicsEnvironment";
|
private static final String TAG = "GraphicsEnvironment";
|
||||||
private static final String PROPERTY_GFX_DRIVER = "ro.gfx.driver.0";
|
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 ClassLoader mClassLoader;
|
||||||
private String mLayerPath;
|
private String mLayerPath;
|
||||||
@@ -241,22 +241,11 @@ public class GraphicsEnvironment {
|
|||||||
|
|
||||||
private static boolean onWhitelist(Context context, String driverPackageName,
|
private static boolean onWhitelist(Context context, String driverPackageName,
|
||||||
String applicationPackageName) {
|
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 {
|
try {
|
||||||
Context driverContext = context.createPackageContext(driverPackageName,
|
Context driverContext = context.createPackageContext(driverPackageName,
|
||||||
Context.CONTEXT_RESTRICTED);
|
Context.CONTEXT_RESTRICTED);
|
||||||
AssetManager assets = driverContext.getAssets();
|
AssetManager assets = driverContext.getAssets();
|
||||||
InputStream stream = assets.open(whitelistName);
|
InputStream stream = assets.open(GUP_WHITELIST_FILENAME);
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
|
||||||
for (String packageName; (packageName = reader.readLine()) != null; ) {
|
for (String packageName; (packageName = reader.readLine()) != null; ) {
|
||||||
if (packageName.equals(applicationPackageName)) {
|
if (packageName.equals(applicationPackageName)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user