diff options
author | Steven Moreland <smoreland@google.com> | 2021-09-03 22:39:10 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2021-09-03 22:51:10 +0000 |
commit | 62eaabc3242b5e4ae5da7d39928123fda570f0b2 (patch) | |
tree | 630ef8f473e39362bb54ff930595a3d7509b0244 /libs | |
parent | 78e5cf5c0e1a02f3a0ef8db28f03d51118ebd210 (diff) | |
parent | d666af6990e23d2b7faa1a3dca8ce7732e3e38e6 (diff) | |
download | native-62eaabc3242b5e4ae5da7d39928123fda570f0b2.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
Diffstat (limited to 'libs')
-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()); |