Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59442132 authored by Yi-Yo Chiang's avatar Yi-Yo Chiang
Browse files

remount: Replace ServiceManager::getService with checkService

Address this build log message:
```
[ 18% 2/11] //system/core/fs_mgr:remount clang++ fs_mgr_remount.cpp
system/core/fs_mgr/fs_mgr_remount.cpp:133:31: warning: 'getService' is deprecated: this polls for 5s, prefer waitForService or checkService [-Wdeprecated-declarations]
        if (auto binder = sm->getService(android::String16("vold"))) {
                              ^
```

Bug: 293695109
Test: adb-remount-test
Change-Id: I3b5c7d338e9307dee58edeb0f6a00ba9a73d46f6
parent b7cfba1c
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -128,14 +128,13 @@ 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 binder = sm->checkService(android::String16("vold"))) {
            if (auto vold = android::interface_cast<android::os::IVold>(binder)) {
                return vold;
            }
        }
        }
        std::this_thread::sleep_for(2s);
    }
}