diff options
author | Steven Moreland <smoreland@google.com> | 2021-09-03 22:39:10 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-10-19 00:38:53 +0000 |
commit | 1709323c2d52a0e0a52f4e3a1943da1aa138fe3a (patch) | |
tree | 01271660299add5eeb89294923bd8519ad740cd1 | |
parent | 44b97a489a2ecec5fd5f2672daa61fabb585d717 (diff) | |
download | native-1709323c2d52a0e0a52f4e3a1943da1aa138fe3a.tar.gz |
libbinder: uptimeMillis returns int64_t! am: 3ba4963f5b am: 17aa765fd3 am: d666af6990
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15720346
Bug: 197336441
Change-Id: I703760ecbfa007d27caf76556ed21bbf0558df80
(cherry picked from commit 62eaabc3242b5e4ae5da7d39928123fda570f0b2)
-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()); |