Merge "GUP: Update global property for the new dev opt"

This commit is contained in:
Yiwei Zhang
2019-01-10 00:33:39 +00:00
committed by Android (Google) Code Review
7 changed files with 29 additions and 15 deletions

View File

@@ -480,14 +480,19 @@ public class GraphicsEnvironment {
return;
}
String applicationPackageName = context.getPackageName();
String devOptInApplicationName = coreSettings.getString(
Settings.Global.GUP_DEV_OPT_IN_APPS);
boolean devOptIn = applicationPackageName.equals(devOptInApplicationName);
boolean whitelisted = onWhitelist(context, driverPackageName, ai.packageName);
if (!devOptIn && !whitelisted) {
if (getGlobalSettingsString(coreSettings, Settings.Global.GUP_DEV_OPT_OUT_APPS)
.contains(ai.packageName)) {
if (DEBUG) {
Log.w(TAG, applicationPackageName + " is not on the whitelist.");
Log.w(TAG, ai.packageName + " opts out from GUP.");
}
return;
}
if (!getGlobalSettingsString(coreSettings, Settings.Global.GUP_DEV_OPT_IN_APPS)
.contains(ai.packageName)
&& !onWhitelist(context, driverPackageName, ai.packageName)) {
if (DEBUG) {
Log.w(TAG, ai.packageName + " is not on the whitelist.");
}
return;
}

View File

@@ -12000,11 +12000,17 @@ public final class Settings {
"angle_gl_driver_selection_values";
/**
* Apps that are selected to use Game Update Package.
* List of Apps selected to use Game Update Packages.
* @hide
*/
public static final String GUP_DEV_OPT_IN_APPS = "gup_dev_opt_in_apps";
/**
* List of Apps selected not to use Game Update Packages.
* @hide
*/
public static final String GUP_DEV_OPT_OUT_APPS = "gup_dev_opt_out_apps";
/**
* Apps on the black list that are forbidden to useGame Update Package.
* @hide

View File

@@ -436,11 +436,12 @@ message GlobalSettingsProto {
// Ordered GPU debug layer list for GLES
// i.e. <layer1>:<layer2>:...:<layerN>
optional SettingProto debug_layers_gles = 7;
// Apps opt in to load graphics driver from Game Update Package
// instead of native graphcis driver through developer options.
// GUP - List of Apps selected to use Game Update Packages
optional SettingProto gup_dev_opt_in_apps = 8;
// Apps on the black list that are forbidden to useGame Update Package.
optional SettingProto gup_black_list = 9;
// GUP - List of Apps selected not to use Game Update Packages
optional SettingProto gup_dev_opt_out_apps = 9;
// GUP - List of Apps that are forbidden to use Game Update Packages
optional SettingProto gup_black_list = 10;
}
optional Gpu gpu = 59;

View File

@@ -478,6 +478,7 @@ public class SettingsBackupTest {
Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS,
Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES,
Settings.Global.GUP_DEV_OPT_IN_APPS,
Settings.Global.GUP_DEV_OPT_OUT_APPS,
Settings.Global.GUP_BLACK_LIST,
Settings.Global.GPU_DEBUG_LAYER_APP,
Settings.Global.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING,

View File

@@ -1137,9 +1137,6 @@
<!-- The notice header of Third-party licenses. not translatable -->
<string name="notice_header" translatable="false"></string>
<!-- UI debug setting: opt in to use updated graphics driver? [CHAR LIMIT=100] -->
<string name="gup_dev_opt_in_app_summary">Opt in app to use Game Update Package in developement</string>
<!-- Name of the phone device [CHAR LIMIT=NONE] -->
<string name="media_transfer_phone_device_name">Phone speaker</string>
</resources>

View File

@@ -707,6 +707,9 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Global.GUP_DEV_OPT_IN_APPS,
GlobalSettingsProto.Gpu.GUP_DEV_OPT_IN_APPS);
dumpSetting(s, p,
Settings.Global.GUP_DEV_OPT_OUT_APPS,
GlobalSettingsProto.Gpu.GUP_DEV_OPT_OUT_APPS);
dumpSetting(s, p,
Settings.Global.GUP_BLACK_LIST,
GlobalSettingsProto.Gpu.GUP_BLACK_LIST);

View File

@@ -68,6 +68,7 @@ final class CoreSettingsObserver extends ContentObserver {
sGlobalSettingToTypeMap.put(Settings.Global.GPU_DEBUG_LAYER_APP, String.class);
sGlobalSettingToTypeMap.put(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, int.class);
sGlobalSettingToTypeMap.put(Settings.Global.GUP_DEV_OPT_IN_APPS, String.class);
sGlobalSettingToTypeMap.put(Settings.Global.GUP_DEV_OPT_OUT_APPS, String.class);
sGlobalSettingToTypeMap.put(Settings.Global.GUP_BLACK_LIST, String.class);
// add other global settings here...
}