Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
libcutils: use __android_log_is_debuggable()
Browse files Browse the repository at this point in the history
Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: I8ee9d999a2e6a0336e45b6180ce6fd7975c113dc
  • Loading branch information
Mark Salyzyn committed Oct 14, 2016
1 parent 9ea359f commit b5aa4e7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions libcutils/trace-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#include <string.h>
#include <sys/types.h>

#include <android/log.h>
#include <cutils/compiler.h>
#include <cutils/properties.h>
#include <cutils/trace.h>
#include <private/android_logger.h>

/**
* Maximum size of a message that can be logged to the trace buffer.
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit b5aa4e7

Please sign in to comment.