Switch adb over to <chrono>.
Clearer code, and lets us lose some more portability cruft.
Bug: http://b/32878766
Test: manual
Change-Id: Ie44928bbf8d68a74127aaf76e7e0060e25fa2cc8
diff --git a/adb.cpp b/adb.cpp
index 8b6b2b5..3cd50ba 100644
--- a/adb.cpp
+++ b/adb.cpp
@@ -30,7 +30,9 @@
#include <sys/time.h>
#include <time.h>
+#include <chrono>
#include <string>
+#include <thread>
#include <vector>
#include <android-base/errors.h>
@@ -51,6 +53,7 @@
#include <sys/capability.h>
#include <sys/mount.h>
#include <android-base/properties.h>
+using namespace std::chrono_literals;
#endif
std::string adb_version() {
@@ -375,7 +378,7 @@
adbd_auth_verified(t);
t->failed_auth_attempts = 0;
} else {
- if (t->failed_auth_attempts++ > 256) adb_sleep_ms(1000);
+ if (t->failed_auth_attempts++ > 256) std::this_thread::sleep_for(1s);
send_auth_request(t);
}
break;