From 279df620b0175bbe5dfe34f73d75450d541792de Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 18 Feb 2020 10:45:15 -0800 Subject: libvulkan: remove a redundant check debuggable logic There're below cases which we can load the debug layers: (1) Layer search paths added from Settings global Layers enabled from Settings global (2) Layer search paths added from default system debug path Layers enabled from system property (3) Layer search paths are from app class loader's default paths Layers enabled from system property For (1), we have done the debuggable check in Java land GraphicsEnvironment. For (2), we have a separate check debuggable logic for adding the system debug path to the layers search paths. For (3), we should never need to check debuggable. So we should just remove the redundant debuggable check when we add implicit layers, which can unblock (3) immediately as well as maintaining the security logic around debug layers. Bug: 147838267 Bug: 149183377 Test: CtsRootlessGpuDebugHostTest#testSystemPropertyEnableVulkan on userbuild Change-Id: I80d9cf3ff6786ce4d4ec5d8afb8da58ba0842ec9 --- vulkan/libvulkan/api.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'vulkan/libvulkan/api.cpp') diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp index dd9efd3e17..c3b5523b9e 100644 --- a/vulkan/libvulkan/api.cpp +++ b/vulkan/libvulkan/api.cpp @@ -124,8 +124,7 @@ class OverrideLayerNames { }; void AddImplicitLayers() { - if (!is_instance_ || - !android::GraphicsEnv::getInstance().isDebuggable()) + if (!is_instance_) return; GetLayersFromSettings(); -- cgit v1.2.3-59-g8ed1b