diff options
| author | 2019-04-22 15:09:28 +0000 | |
|---|---|---|
| committer | 2019-04-22 15:09:28 +0000 | |
| commit | 5012f5bdce0a8444d4c5b32709b9a15e35b1def0 (patch) | |
| tree | 83d3b69ecdad8bd749ef59b22b1662f9bb9801c7 | |
| parent | a99ff5fa9a7bb43113db51c0069222417accd322 (diff) | |
| parent | 5973ec96780bbe39dadabd5d0dbd9922128ccc4a (diff) | |
Merge "Verify Bundle is not null before using it" into qt-dev
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index a51a871e7780..232869d7aefc 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 = - coreSettings.getString(Settings.Global.GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE); + String debugPackage; + + 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 ""; } |