libbinder: uptimeMillis returns int64_t! am: 3ba4963f5b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15720346
Change-Id: Ic08346b606933f364a2dbdad7a09c97b9ef059e7
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 4ba6c2a..8cd2d45 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -147,7 +147,8 @@
const bool isVendorService =
strcmp(ProcessState::self()->getDriverName().c_str(), "/dev/vndbinder") == 0;
- const long timeout = uptimeMillis() + 5000;
+ const long timeout = 5000;
+ int64_t startTime = uptimeMillis();
if (!gSystemBootCompleted && !isVendorService) {
// Vendor code can't access system properties
char bootCompleted[PROPERTY_VALUE_MAX];
@@ -158,7 +159,7 @@
const long sleepTime = gSystemBootCompleted ? 1000 : 100;
int n = 0;
- while (uptimeMillis() < timeout) {
+ while (uptimeMillis() - startTime < timeout) {
n++;
ALOGI("Waiting for service '%s' on '%s'...", String8(name).string(),
ProcessState::self()->getDriverName().c_str());