summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-10-19 00:39:09 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-10-19 00:39:09 +0000
commitf15aa37df3614a552a2ad0e7325edde4d596bcf1 (patch)
tree01271660299add5eeb89294923bd8519ad740cd1
parent44b97a489a2ecec5fd5f2672daa61fabb585d717 (diff)
parent1709323c2d52a0e0a52f4e3a1943da1aa138fe3a (diff)
downloadnative-android-platform-11.0.0_r13.tar.gz
Merge cherrypicks of [15759163] into rvc-platform-release.android-platform-11.0.0_r13android-platform-11.0.0_r12
Change-Id: I0569db17ece0e84a66fa55ca63a16cba12a75c2a
-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 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());