Merge "remount: Replace ServiceManager::getService with checkService" into main am: 4131a3afd1 am: 18cea8df37

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2690886

Change-Id: I677dd4b109cc5a6f0c0be953f0a4d6b17eb7546b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yi-Yo Chiang 2023-08-04 05:04:43 +00:00 committed by Automerger Merge Worker
commit 9365d00cf2

View file

@ -128,12 +128,11 @@ class MyLogger {
}
static android::sp<android::os::IVold> GetVold() {
auto sm = android::defaultServiceManager();
while (true) {
if (auto sm = android::defaultServiceManager()) {
if (auto binder = sm->getService(android::String16("vold"))) {
if (auto vold = android::interface_cast<android::os::IVold>(binder)) {
return vold;
}
if (auto binder = sm->checkService(android::String16("vold"))) {
if (auto vold = android::interface_cast<android::os::IVold>(binder)) {
return vold;
}
}
std::this_thread::sleep_for(2s);