adbd: turn on fdsan warnings.
Test: mma
Test: python test_device.py
Change-Id: Ic90fac0b731b0aa9fa934f4472b0c40f1263c340
diff --git a/daemon/main.cpp b/daemon/main.cpp
index c02cafa..f6f1acc 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -18,6 +18,7 @@
#include "sysdeps.h"
+#include <android/fdsan.h>
#include <errno.h>
#include <getopt.h>
#include <malloc.h>
@@ -177,6 +178,11 @@
signal(SIGPIPE, SIG_IGN);
+ auto fdsan_level = android_fdsan_get_error_level();
+ if (fdsan_level == ANDROID_FDSAN_ERROR_LEVEL_DISABLED) {
+ android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ONCE);
+ }
+
init_transport_registration();
// We need to call this even if auth isn't enabled because the file