From b5aa4e712597ce5568e07050fa38ab852412e37a Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 28 Mar 2016 15:39:26 -0700 Subject: [PATCH] libcutils: use __android_log_is_debuggable() Test: compile and boot smoke test Bug: 27566046 Bug: 31456426 Change-Id: I8ee9d999a2e6a0336e45b6180ce6fd7975c113dc --- libcutils/trace-dev.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libcutils/trace-dev.c b/libcutils/trace-dev.c index dcd95821f..113f423cb 100644 --- a/libcutils/trace-dev.c +++ b/libcutils/trace-dev.c @@ -26,10 +26,10 @@ #include #include -#include #include #include #include +#include /** * Maximum size of a message that can be logged to the trace buffer. @@ -86,16 +86,9 @@ static bool atrace_is_cmdline_match(const char* cmdline) // Determine whether application-level tracing is enabled for this process. static bool atrace_is_app_tracing_enabled() { - bool sys_debuggable = false; - char value[PROPERTY_VALUE_MAX]; + bool sys_debuggable = __android_log_is_debuggable(); bool result = false; - // Check whether the system is debuggable. - property_get("ro.debuggable", value, "0"); - if (value[0] == '1') { - sys_debuggable = true; - } - if (sys_debuggable || atrace_is_debuggable) { // Check whether tracing is enabled for this process. FILE * file = fopen("/proc/self/cmdline", "re");