diff --git a/fs_mgr/fs_mgr_remount.cpp b/fs_mgr/fs_mgr_remount.cpp index 4c458283a..4b3a5d3ea 100644 --- a/fs_mgr/fs_mgr_remount.cpp +++ b/fs_mgr/fs_mgr_remount.cpp @@ -128,12 +128,11 @@ class MyLogger { } static android::sp 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(binder)) { - return vold; - } + if (auto binder = sm->checkService(android::String16("vold"))) { + if (auto vold = android::interface_cast(binder)) { + return vold; } } std::this_thread::sleep_for(2s);