Loading core/java/android/os/GraphicsEnvironment.java +36 −5 Original line number Diff line number Diff line Loading @@ -336,6 +336,25 @@ public class GraphicsEnvironment { return resolveInfos.get(0).activityInfo.packageName; } /** * Check for ANGLE debug package, but only for apps that can load them (dumpable) */ private String getAngleDebugPackage(Context context, Bundle coreSettings) { final boolean appIsDebuggable = isDebuggable(context); final boolean appIsProfileable = isProfileable(context); final boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; if (appIsDebuggable || appIsProfileable || deviceIsDebuggable) { String debugPackage = coreSettings.getString(Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); if ((debugPackage != null) && (!debugPackage.isEmpty())) { return debugPackage; } } return ""; } /** * Attempt to setup ANGLE with a temporary rules file. * True: Temporary rules file was loaded. Loading Loading @@ -502,12 +521,24 @@ public class GraphicsEnvironment { } final ApplicationInfo angleInfo; String angleDebugPackage = getAngleDebugPackage(context, bundle); if (!angleDebugPackage.isEmpty()) { Log.i(TAG, "ANGLE debug package enabled: " + angleDebugPackage); try { // Note the debug package does not have to be pre-installed angleInfo = pm.getApplicationInfo(angleDebugPackage, 0); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "ANGLE debug package '" + angleDebugPackage + "' not installed"); return false; } } else { try { angleInfo = pm.getApplicationInfo(anglePkgName, PackageManager.MATCH_SYSTEM_ONLY); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "ANGLE package '" + anglePkgName + "' not installed"); return false; } } final String abi = chooseAbi(angleInfo); Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -12450,6 +12450,14 @@ public final class Settings { */ public static final String GPU_DEBUG_APP = "gpu_debug_app"; /** * Package containing ANGLE libraries other than system, which are only available * to dumpable apps that opt-in. * @hide */ public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE = "angle_debug_package"; /** * Force all PKGs to use ANGLE, regardless of any other settings * The value is a boolean (1 or 0). Loading core/proto/android/providers/settings/global.proto +2 −0 Original line number Diff line number Diff line Loading @@ -455,6 +455,8 @@ message GlobalSettingsProto { optional SettingProto show_angle_in_use_dialog = 15; // Game Driver - List of libraries in sphal accessible by Game Driver optional SettingProto game_driver_sphal_libraries = 16; // ANGLE - External package containing ANGLE libraries optional SettingProto angle_debug_package = 17; } optional Gpu gpu = 59; Loading core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -487,6 +487,7 @@ public class SettingsBackupTest { Settings.Global.GPU_DEBUG_APP, Settings.Global.GPU_DEBUG_LAYERS, Settings.Global.GPU_DEBUG_LAYERS_GLES, Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES, Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +3 −0 Original line number Diff line number Diff line Loading @@ -685,6 +685,9 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.GPU_DEBUG_LAYERS, GlobalSettingsProto.Gpu.DEBUG_LAYERS); dumpSetting(s, p, Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE, GlobalSettingsProto.Gpu.ANGLE_DEBUG_PACKAGE); dumpSetting(s, p, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE, GlobalSettingsProto.Gpu.ANGLE_GL_DRIVER_ALL_ANGLE); Loading Loading
core/java/android/os/GraphicsEnvironment.java +36 −5 Original line number Diff line number Diff line Loading @@ -336,6 +336,25 @@ public class GraphicsEnvironment { return resolveInfos.get(0).activityInfo.packageName; } /** * Check for ANGLE debug package, but only for apps that can load them (dumpable) */ private String getAngleDebugPackage(Context context, Bundle coreSettings) { final boolean appIsDebuggable = isDebuggable(context); final boolean appIsProfileable = isProfileable(context); final boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; if (appIsDebuggable || appIsProfileable || deviceIsDebuggable) { String debugPackage = coreSettings.getString(Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); if ((debugPackage != null) && (!debugPackage.isEmpty())) { return debugPackage; } } return ""; } /** * Attempt to setup ANGLE with a temporary rules file. * True: Temporary rules file was loaded. Loading Loading @@ -502,12 +521,24 @@ public class GraphicsEnvironment { } final ApplicationInfo angleInfo; String angleDebugPackage = getAngleDebugPackage(context, bundle); if (!angleDebugPackage.isEmpty()) { Log.i(TAG, "ANGLE debug package enabled: " + angleDebugPackage); try { // Note the debug package does not have to be pre-installed angleInfo = pm.getApplicationInfo(angleDebugPackage, 0); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "ANGLE debug package '" + angleDebugPackage + "' not installed"); return false; } } else { try { angleInfo = pm.getApplicationInfo(anglePkgName, PackageManager.MATCH_SYSTEM_ONLY); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "ANGLE package '" + anglePkgName + "' not installed"); return false; } } final String abi = chooseAbi(angleInfo); Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -12450,6 +12450,14 @@ public final class Settings { */ public static final String GPU_DEBUG_APP = "gpu_debug_app"; /** * Package containing ANGLE libraries other than system, which are only available * to dumpable apps that opt-in. * @hide */ public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE = "angle_debug_package"; /** * Force all PKGs to use ANGLE, regardless of any other settings * The value is a boolean (1 or 0). Loading
core/proto/android/providers/settings/global.proto +2 −0 Original line number Diff line number Diff line Loading @@ -455,6 +455,8 @@ message GlobalSettingsProto { optional SettingProto show_angle_in_use_dialog = 15; // Game Driver - List of libraries in sphal accessible by Game Driver optional SettingProto game_driver_sphal_libraries = 16; // ANGLE - External package containing ANGLE libraries optional SettingProto angle_debug_package = 17; } optional Gpu gpu = 59; Loading
core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -487,6 +487,7 @@ public class SettingsBackupTest { Settings.Global.GPU_DEBUG_APP, Settings.Global.GPU_DEBUG_LAYERS, Settings.Global.GPU_DEBUG_LAYERS_GLES, Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES, Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +3 −0 Original line number Diff line number Diff line Loading @@ -685,6 +685,9 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.GPU_DEBUG_LAYERS, GlobalSettingsProto.Gpu.DEBUG_LAYERS); dumpSetting(s, p, Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE, GlobalSettingsProto.Gpu.ANGLE_DEBUG_PACKAGE); dumpSetting(s, p, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE, GlobalSettingsProto.Gpu.ANGLE_GL_DRIVER_ALL_ANGLE); Loading