Remove libcutils socket_peer_is_trusted dependency.
ART is the only caller of this code, and it's trivially rewritten to
just use NDK API.
Bug: N/A
Test: boots
Change-Id: I679a0f7e7ba48c6660c69629af180f04c4532c62
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index c716d92..1b907b7 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -23,6 +23,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex.h"
+#include "base/socket_peer_is_trusted.h"
#include "jni/java_vm_ext.h"
#include "jni/jni_env_ext.h"
#include "mirror/throwable.h"
@@ -38,10 +39,6 @@
#include "poll.h"
-#ifdef ART_TARGET_ANDROID
-#include "cutils/sockets.h"
-#endif
-
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -514,11 +511,7 @@
// the debuggable flag set.
int ret = connect(sock, &control_addr_.controlAddrPlain, control_addr_len_);
if (ret == 0) {
- bool trusted = sock >= 0;
-#ifdef ART_TARGET_ANDROID
- // Needed for socket_peer_is_trusted.
- trusted = trusted && socket_peer_is_trusted(sock);
-#endif
+ bool trusted = sock >= 0 && art::SocketPeerIsTrusted(sock);
if (!trusted) {
LOG(ERROR) << "adb socket is not trusted. Aborting connection.";
if (sock >= 0 && shutdown(sock, SHUT_RDWR)) {