Merge "remount: Replace ServiceManager::getService with checkService" into main
This commit is contained in:
commit
4131a3afd1
1 changed files with 4 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue