diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-11-15 19:22:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-11-15 19:22:45 +0000 |
commit | 7731672db385142bb3d677cfe9ad4648b5d272fe (patch) | |
tree | a5cf5e362c4b8aa1f8070cf20e0a8c4db9bf3dbb | |
parent | e68948d99436d9efd60799ba05e28097764b485e (diff) | |
parent | c8f0b746348f0948a71bc72e6efb64c85adef22a (diff) | |
download | native-7731672db385142bb3d677cfe9ad4648b5d272fe.tar.gz |
Merge "Merge cherrypicks of [15759163] into rvc-platform-release. am: f15aa37df3" into android11-gsi
-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()); |