diff options
author | Steven Moreland <smoreland@google.com> | 2021-09-07 22:19:46 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-09-07 22:19:46 +0000 |
commit | 8cec52154e8c4a66999155579971a4b5531a6d5d (patch) | |
tree | 01271660299add5eeb89294923bd8519ad740cd1 | |
parent | 44f1d53ba8fdfcf6925ad38c37b93e74d6647796 (diff) | |
parent | 62eaabc3242b5e4ae5da7d39928123fda570f0b2 (diff) | |
download | native-8cec52154e8c4a66999155579971a4b5531a6d5d.tar.gz |
libbinder: uptimeMillis returns int64_t! am: 3ba4963f5b am: 17aa765fd3 am: d666af6990 am: 62eaabc324
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15759163
Change-Id: Ie9e50a46e486fecafac61d66b79095687d671a3f
-rw-r--r-- | libs/binder/IServiceManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index a9f2d73951..218970a1b2 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -215,7 +215,8 @@ sp<IBinder> ServiceManagerShim::getService(const String16& name) const 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(); // Vendor code can't access system properties if (!gSystemBootCompleted && !isVendorService) { #ifdef __ANDROID__ @@ -230,7 +231,7 @@ sp<IBinder> ServiceManagerShim::getService(const String16& name) const 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()); |