diff options
author | Steven Moreland <smoreland@google.com> | 2021-09-07 22:19:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-09-07 22:19:47 +0000 |
commit | d21fe3951a16fe7b7f42572e615dd3de33f8c4f3 (patch) | |
tree | 630ef8f473e39362bb54ff930595a3d7509b0244 | |
parent | 8532cf70da79abb8c62a30be2ead749b3cb0a6b5 (diff) | |
parent | 62eaabc3242b5e4ae5da7d39928123fda570f0b2 (diff) | |
download | native-d21fe3951a16fe7b7f42572e615dd3de33f8c4f3.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: I53b504bbb6299988939674ba2b21344569c0da6d
-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()); |