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

Commit c706c3ee authored by Steven Moreland's avatar Steven Moreland
Browse files

Harder failures for lazy service clients.

Detect when servicemanager state is inconsistent at runtime.

Bug: 140310064
Change-Id: I59cd737f3e7b7d6e9649a6c77f2ef89fca5efd36
Test: aidl_lazy_test in TH
parent 340adb57
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -114,6 +114,12 @@ Status ClientCounterCallback::onClients(const sp<IBinder>& service, bool clients
        mNumConnectedServices--;
    }

    // if this fails, we should switch this to keep track of clients inside
    // of mRegisteredServices so that we know which service is double-counted.
    LOG_ALWAYS_FATAL_IF(mNumConnectedServices > mRegisteredServices.size(),
                        "Invalid state: %zu services have clients, but we only know about %zu",
                        mNumConnectedServices, mRegisteredServices.size());

    ALOGI("Process has %zu (of %zu available) client(s) in use after notification %s has clients: %d",
          mNumConnectedServices, mRegisteredServices.size(),
          String8(service->getInterfaceDescriptor()).string(), clients);