summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-04-22 15:09:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-22 15:09:28 +0000
commit5012f5bdce0a8444d4c5b32709b9a15e35b1def0 (patch)
tree83d3b69ecdad8bd749ef59b22b1662f9bb9801c7
parenta99ff5fa9a7bb43113db51c0069222417accd322 (diff)
parent5973ec96780bbe39dadabd5d0dbd9922128ccc4a (diff)
Merge "Verify Bundle is not null before using it" into qt-dev
-rw-r--r--core/java/android/os/GraphicsEnvironment.java14
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 "";
}