summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-10 03:01:38 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-10 03:01:38 +0000
commita7eb8e3c0ee2cded715b980033b2e713da26c809 (patch)
treecfb92a3059316363531c44ed327964d28cc9aaeb
parent6f1f9d41af113f99f0573b0c3d8372ff5b9e33da (diff)
parent571b407460a7c0f6c2d90835b12ec6c50845fd79 (diff)
downloadnative-android-security-11.0.0_r49.tar.gz
Merge cherrypicks of [15800618, 15800895, 15800896, 15800898, 15800900, 15800902, 15800904, 15800906, 15800675, 15800677, 15800968, 15800798, 15800799, 15800801] into security-aosp-rvc-releaseandroid-security-11.0.0_r50android-security-11.0.0_r49
Change-Id: I841b6b5c3d335de7f3b53303ee5d9ebd5c93b2fb
-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());