Merge "Grant adb auth under recovery for unlocked & userdebug devices" am: 7cfb77ed8d
am: bc4645ade3

Change-Id: I8e88041c045af9a5548fa1fb0483807cee2f3418
diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
index 9ebab74..cbb5e69 100644
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -205,7 +205,11 @@
     // descriptor will always be open.
     adbd_cloexec_auth_socket();
 
-#if defined(ALLOW_ADBD_NO_AUTH)
+#if defined(__ANDROID_RECOVERY__)
+    if (is_device_unlocked() || __android_log_is_debuggable()) {
+        auth_required = false;
+    }
+#elif defined(ALLOW_ADBD_NO_AUTH)
     // If ro.adb.secure is unset, default to no authentication required.
     auth_required = android::base::GetBoolProperty("ro.adb.secure", false);
 #elif defined(__ANDROID__)