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

Commit bcfa7faa authored by Cody Heiner's avatar Cody Heiner
Browse files

Change getService (deprecated) to waitForService

The `getService` method is now deprecated. This changes the
getService calls to waitForService.

The only potential difference in functionality is that getService
times out after 10 seconds, while waitForService waits indefinitely.

Test: flash to device and reboot,
  `adb logcat | egrep -i "twoshay|flinger"`
  shows nothing suspiciously different before/after the change.

Bug: 265069414
Change-Id: I84c5f860c869a4e11be6e5490268920dae1e29cc
parent d0dd92a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -687,7 +687,7 @@ void SurfaceFlinger::bootFinished() {

    // wait patiently for the window manager death
    const String16 name("window");
    mWindowManager = defaultServiceManager()->getService(name);
    mWindowManager = defaultServiceManager()->waitForService(name);
    if (mWindowManager != 0) {
        mWindowManager->linkToDeath(sp<IBinder::DeathRecipient>::fromExisting(this));
    }
@@ -701,7 +701,7 @@ void SurfaceFlinger::bootFinished() {
    LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM,
                   ns2ms(systemTime(SYSTEM_TIME_MONOTONIC)));

    sp<IBinder> input(defaultServiceManager()->getService(String16("inputflinger")));
    sp<IBinder> input(defaultServiceManager()->waitForService(String16("inputflinger")));

    static_cast<void>(mScheduler->schedule([=]() FTL_FAKE_GUARD(kMainThreadContext) {
        if (input == nullptr) {
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ sp<IIPCTest> IPCTest::initRemoteService() {
            IPCThreadState::self()->joinThreadPool();
            [&]() { exit(0); }();
        }
        sp<IBinder> binder = defaultServiceManager()->getService(serviceName);
        sp<IBinder> binder = defaultServiceManager()->waitForService(serviceName);
        remote = interface_cast<IIPCTest>(binder);
        remote->setDeathToken(mDeathRecipient);
    }