diff options
| author | Yiwei Zhang <zzyiwei@google.com> | 2019-01-17 02:02:44 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-01-17 02:02:44 +0000 |
| commit | c631eeadd6e0ab141698e4dfd05676aa88994014 (patch) | |
| tree | c3b11d5256599b1371d101394b5ee52ae6b08556 /core/java/android | |
| parent | e33a07c1dbf2afe42019d5629bf840ea1191156a (diff) | |
| parent | 4a626ac7b4036173a569bac509c3983c29644d92 (diff) | |
Merge "GUP: Add a global property for genreal preference"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 33 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 19 |
2 files changed, 39 insertions, 13 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index b0b8f493e98a..e4622dbdc379 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -480,21 +480,36 @@ public class GraphicsEnvironment { return; } - if (getGlobalSettingsString(coreSettings, Settings.Global.GUP_DEV_OPT_OUT_APPS) - .contains(ai.packageName)) { + // GUP_DEV_ALL_APPS + // 0: Default (Invalid values fallback to default as well) + // 1: All apps use Game Update Package + // 2: All apps use system graphics driver + int gupDevAllApps = coreSettings.getInt(Settings.Global.GUP_DEV_ALL_APPS, 0); + if (gupDevAllApps == 2) { if (DEBUG) { - Log.w(TAG, ai.packageName + " opts out from GUP."); + Log.w(TAG, "GUP is turned off on this device"); } 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."); + if (gupDevAllApps != 1) { + // GUP_DEV_OPT_OUT_APPS has higher priority than GUP_DEV_OPT_IN_APPS + if (getGlobalSettingsString(coreSettings, Settings.Global.GUP_DEV_OPT_OUT_APPS) + .contains(ai.packageName)) { + if (DEBUG) { + 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; } - return; } ApplicationInfo driverInfo; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 4606668b58d9..afeba853f377 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -11992,22 +11992,33 @@ public final class Settings { "angle_gl_driver_selection_values"; /** - * List of Apps selected to use Game Update Packages. + * Game Update Package global preference for all Apps. + * 0 = Default + * 1 = All Apps use Game Update Package + * 2 = All Apps use system graphics driver + * @hide + */ + public static final String GUP_DEV_ALL_APPS = "gup_dev_all_apps"; + + /** + * List of Apps selected to use Game Update Package. + * i.e. <pkg1>,<pkg2>,...,<pkgN> * @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. + * List of Apps selected not to use Game Update Package. + * i.e. <pkg1>,<pkg2>,...,<pkgN> * @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. + * Apps on the blacklist that are forbidden to use Game Update Package. * @hide */ - public static final String GUP_BLACK_LIST = "gup_black_list"; + public static final String GUP_BLACKLIST = "gup_blacklist"; /** * Ordered GPU debug layer list for Vulkan |
