diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index fb8f84acc8f39..a52e3d49148d4 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -474,9 +474,8 @@ public class GraphicsEnvironment { * target functionality. The ANGLE broadcast receiver code will apply a "deferlist" at * the first boot of a newly-flashed device. However, there is a gap in time between * when applications can start and when the deferlist is applied. For now, assume that - * if ANGLE is the system driver and Settings.Global.ANGLE_GL_DRIVER_SELECTION_PKGS is - * empty, that the deferlist has not yet been applied. In this case, select the Legacy - * driver. + * if ANGLE is the system driver and Settings.Global.ANGLE_DEFERLIST is empty, that the + * deferlist has not yet been applied. In this case, select the Legacy driver. * otherwise ... * 3) Use ANGLE if isAngleEnabledByGameMode() returns true; otherwise ... * 4) The global switch (i.e. use the system driver, whether ANGLE or legacy; @@ -516,14 +515,17 @@ public class GraphicsEnvironment { contentResolver, bundle, Settings.Global.ANGLE_GL_DRIVER_SELECTION_PKGS); final List optInValues = getGlobalSettingsString( contentResolver, bundle, Settings.Global.ANGLE_GL_DRIVER_SELECTION_VALUES); + final List angleDeferlist = getGlobalSettingsString( + contentResolver, bundle, Settings.Global.ANGLE_DEFERLIST); Log.v(TAG, "Currently set values for:"); Log.v(TAG, " angle_gl_driver_selection_pkgs =" + optInPackages); Log.v(TAG, " angle_gl_driver_selection_values =" + optInValues); // If ANGLE is the system driver AND the deferlist has not yet been applied, select the // Legacy driver - if (mAngleIsSystemDriver && optInPackages.size() <= 1) { - Log.v(TAG, "Ignoring angle_gl_driver_selection_* until deferlist has been applied"); + if (mAngleIsSystemDriver && angleDeferlist.size() == 0) { + Log.v(TAG, "ANGLE deferlist (" + Settings.Global.ANGLE_DEFERLIST + ") has not been " + + "applied, defaulting to legacy driver"); return ANGLE_GL_DRIVER_TO_USE_LEGACY; } diff --git a/services/core/java/com/android/server/am/CoreSettingsObserver.java b/services/core/java/com/android/server/am/CoreSettingsObserver.java index 2e3e635c11576..ddc9e9166faa5 100644 --- a/services/core/java/com/android/server/am/CoreSettingsObserver.java +++ b/services/core/java/com/android/server/am/CoreSettingsObserver.java @@ -95,6 +95,10 @@ final class CoreSettingsObserver extends ContentObserver { Settings.Global.ANGLE_GL_DRIVER_SELECTION_VALUES, String.class); sGlobalSettingToTypeMap.put( Settings.Global.ANGLE_EGL_FEATURES, String.class); + sGlobalSettingToTypeMap.put( + Settings.Global.ANGLE_DEFERLIST, String.class); + sGlobalSettingToTypeMap.put( + Settings.Global.ANGLE_DEFERLIST_MODE, String.class); sGlobalSettingToTypeMap.put( Settings.Global.SHOW_ANGLE_IN_USE_DIALOG_BOX, String.class); sGlobalSettingToTypeMap.put(Settings.Global.ENABLE_GPU_DEBUG_LAYERS, int.class);