summaryrefslogtreecommitdiff
path: root/libs/graphicsenv/GraphicsEnv.cpp
diff options
context:
space:
mode:
author Cody Northrop <cnorthrop@google.com> 2022-11-09 00:09:30 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-11-09 00:09:30 +0000
commitdc4988ef6cb8b32ef52a71419f6f126dd4f79d84 (patch)
tree45a3d28e9d88563af5316dd6e60c34c696e82b32 /libs/graphicsenv/GraphicsEnv.cpp
parent762cd12772a8936c5d0bf5eb802d7eab787ec47e (diff)
parent5d32e628450494b72473c039c7d6f6ce57540bb1 (diff)
Merge "GraphicsEnv: Fix isDebuggable"
Diffstat (limited to 'libs/graphicsenv/GraphicsEnv.cpp')
-rw-r--r--libs/graphicsenv/GraphicsEnv.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index 4a0a839948..5f5f85a2ad 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -126,7 +126,20 @@ static const std::string getSystemNativeLibraries(NativeLibrary type) {
}
bool GraphicsEnv::isDebuggable() {
- return prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) > 0;
+ // This flag determines if the application is marked debuggable
+ bool appDebuggable = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) > 0;
+
+ // This flag is set only in `debuggable` builds of the platform
+#if defined(ANDROID_DEBUGGABLE)
+ bool platformDebuggable = true;
+#else
+ bool platformDebuggable = false;
+#endif
+
+ ALOGV("GraphicsEnv::isDebuggable returning appDebuggable=%s || platformDebuggable=%s",
+ appDebuggable ? "true" : "false", platformDebuggable ? "true" : "false");
+
+ return appDebuggable || platformDebuggable;
}
void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path,