adb: use __android_log_is_debuggable()
Test: compile and months of adb functionality use
Bug: 27566046
Bug: 31456426
Change-Id: I6568eea0eda8dc67dec2ba34cd4c3f56fb0ff0e9
diff --git a/sockets.cpp b/sockets.cpp
index fff6049..3a57174 100644
--- a/sockets.cpp
+++ b/sockets.cpp
@@ -32,6 +32,7 @@
#if !ADB_HOST
#include <android-base/properties.h>
+#include <private/android_logger.h>
#endif
#include "adb.h"
@@ -416,12 +417,7 @@
D("LS(%d): bound to '%s' via %d", s->id, name, fd);
#if !ADB_HOST
- bool debuggable = false;
- if (!strncmp(name, "root:", 5)) {
- debuggable = android::base::GetBoolProperty("ro.debuggable", false);
- }
-
- if ((!strncmp(name, "root:", 5) && getuid() != 0 && debuggable) ||
+ if ((!strncmp(name, "root:", 5) && getuid() != 0 && __android_log_is_debuggable()) ||
(!strncmp(name, "unroot:", 7) && getuid() == 0) ||
!strncmp(name, "usb:", 4) ||
!strncmp(name, "tcpip:", 6)) {