Loading libs/graphicsenv/GraphicsEnv.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -139,12 +139,8 @@ static const std::string getSystemNativeLibraries(NativeLibrary type) { return env; } int GraphicsEnv::getCanLoadSystemLibraries() { if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { // Return an integer value since this crosses library boundaries return 1; } return 0; bool GraphicsEnv::isDebuggable() { return prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) > 0; } void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path, Loading libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +10 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,16 @@ private: public: static GraphicsEnv& getInstance(); int getCanLoadSystemLibraries(); // Check if the process is debuggable. It returns false except in any of the // following circumstances: // 1. ro.debuggable=1 (global debuggable enabled). // 2. android:debuggable="true" in the manifest for an individual app. // 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. bool isDebuggable(); // Set a search path for loading graphics drivers. The path is a list of // directories separated by ':'. A directory can be contained in a zip file Loading opengl/libs/EGL/egl_layers.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ void LayerLoader::LoadLayers() { // Only enable the system search path for non-user builds std::string system_path; if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { if (android::GraphicsEnv::getInstance().isDebuggable()) { system_path = kSystemLayerLibraryDir; } Loading vulkan/libvulkan/api.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -124,7 +124,8 @@ class OverrideLayerNames { }; void AddImplicitLayers() { if (!is_instance_ || !driver::Debuggable()) if (!is_instance_ || !android::GraphicsEnv::getInstance().isDebuggable()) return; GetLayersFromSettings(); Loading Loading @@ -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)); } Loading vulkan/libvulkan/driver.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -755,10 +755,6 @@ void FreeDeviceData(DeviceData* data, const VkAllocationCallbacks& allocator) { } // anonymous namespace bool Debuggable() { return (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) >= 0); } bool OpenHAL() { return Hal::Open(); } Loading Loading
libs/graphicsenv/GraphicsEnv.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -139,12 +139,8 @@ static const std::string getSystemNativeLibraries(NativeLibrary type) { return env; } int GraphicsEnv::getCanLoadSystemLibraries() { if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { // Return an integer value since this crosses library boundaries return 1; } return 0; bool GraphicsEnv::isDebuggable() { return prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) > 0; } void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path, Loading
libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +10 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,16 @@ private: public: static GraphicsEnv& getInstance(); int getCanLoadSystemLibraries(); // Check if the process is debuggable. It returns false except in any of the // following circumstances: // 1. ro.debuggable=1 (global debuggable enabled). // 2. android:debuggable="true" in the manifest for an individual app. // 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. bool isDebuggable(); // Set a search path for loading graphics drivers. The path is a list of // directories separated by ':'. A directory can be contained in a zip file Loading
opengl/libs/EGL/egl_layers.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ void LayerLoader::LoadLayers() { // Only enable the system search path for non-user builds std::string system_path; if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { if (android::GraphicsEnv::getInstance().isDebuggable()) { system_path = kSystemLayerLibraryDir; } Loading
vulkan/libvulkan/api.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -124,7 +124,8 @@ class OverrideLayerNames { }; void AddImplicitLayers() { if (!is_instance_ || !driver::Debuggable()) if (!is_instance_ || !android::GraphicsEnv::getInstance().isDebuggable()) return; GetLayersFromSettings(); Loading Loading @@ -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)); } Loading
vulkan/libvulkan/driver.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -755,10 +755,6 @@ void FreeDeviceData(DeviceData* data, const VkAllocationCallbacks& allocator) { } // anonymous namespace bool Debuggable() { return (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) >= 0); } bool OpenHAL() { return Hal::Open(); } Loading