summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-09-03 22:22:58 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-09-03 22:22:58 +0000
commitd666af6990e23d2b7faa1a3dca8ce7732e3e38e6 (patch)
treefd72b221c79e1485400fb4dce8db73d81a9242f6
parent978ad0539a48a36cb9497dbe258aa7cef6d43553 (diff)
parent17aa765fd3508e1202ef7cf03b07eced11fc1d5e (diff)
downloadnative-d666af6990e23d2b7faa1a3dca8ce7732e3e38e6.tar.gz
libbinder: uptimeMillis returns int64_t! am: 3ba4963f5b am: 17aa765fd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15720346 Change-Id: I51d7e7341d8af4788dbc224b7ab22129c235aa52
-rw-r--r--libs/binder/IServiceManager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 4ba6c2a923..8cd2d45c92 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -147,7 +147,8 @@ public:
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 @@ public:
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());