summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2019-11-08 11:55:36 -0800
committer Yiwei Zhang <zzyiwei@google.com> 2019-11-08 16:00:40 -0800
commit6a674c9e105bdc5d736c06a4500dcdac1c6c4006 (patch)
tree56d3b404c4aadb9a1b7b45b10df18e5e35c63067 /vulkan/libvulkan/api.cpp
parent0f9d717a7463d833cd460610c97b5854ff18096a (diff)
GraphicsEnv: refactor to unify the debuggable logic
By default, PR_SET_DUMPABLE is 0 for zygote spawned apps, except in the following circumstances: 1. ro.debuggable=1 (global debuggable enabled, i.e., userdebug or eng builds). 2. android:debuggable="true" in the manifest for an individual application. 3. An app which explicitly calls prctl(PR_SET_DUMPABLE, 1). 4. GraphicsEnv calls prctl(PR_SET_DUMPABLE, 1) in the presence of <meta-data android:name="com.android.graphics.injectLayers.enable" android:value="true"/> in the application manifest. So checking both ro.debuggable=1 and PR_GET_DUMPABLE is redundant. Bug: 144186877 Test: CtsAngleIntegrationHostTestCases Test: CtsRootlessGpuDebugHostTest Change-Id: I934f64315b67db77ee2c2a9dff50fb23bc0a546a
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
-rw-r--r--vulkan/libvulkan/api.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp
index 24039b1fee..a1207d324f 100644
--- a/vulkan/libvulkan/api.cpp
+++ b/vulkan/libvulkan/api.cpp
@@ -124,7 +124,8 @@ class OverrideLayerNames {
};
void AddImplicitLayers() {
- if (!is_instance_ || !driver::Debuggable())
+ if (!is_instance_ ||
+ !android::GraphicsEnv::getInstance().isDebuggable())
return;
GetLayersFromSettings();
@@ -370,7 +371,8 @@ class OverrideExtensionNames {
private:
bool EnableDebugCallback() const {
- return (is_instance_ && driver::Debuggable() &&
+ return (is_instance_ &&
+ android::GraphicsEnv::getInstance().isDebuggable() &&
property_get_bool("debug.vulkan.enable_callback", false));
}