diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index a51a871e77804..232869d7aefc8 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -453,14 +453,22 @@ public class GraphicsEnvironment { final boolean appIsProfileable = isProfileable(context); final boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; if (appIsDebuggable || appIsProfileable || deviceIsDebuggable) { + String debugPackage; - String debugPackage = - coreSettings.getString(Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); + if (coreSettings != null) { + debugPackage = + coreSettings.getString(Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); + } else { + ContentResolver contentResolver = context.getContentResolver(); + debugPackage = Settings.Global.getString(contentResolver, + Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); + } if ((debugPackage != null) && (!debugPackage.isEmpty())) { return debugPackage; } } + return ""; }