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

Commit 7f9edd9b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "LazyServiceRegistrar: Use defaultServiceManager"

parents 107b205e 718470ee
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -64,8 +64,7 @@ private:

bool ClientCounterCallback::registerService(const sp<IBinder>& service, const std::string& name,
                                            bool allowIsolated, int dumpFlags) {
    auto manager = interface_cast<AidlServiceManager>(
                    ProcessState::self()->getContextObject(nullptr));
    auto manager = interface_cast<AidlServiceManager>(asBinder(defaultServiceManager()));

    bool reRegister = mRegisteredServices.count(name) > 0;
    std::string regStr = (reRegister) ? "Re-registering" : "Registering";
@@ -114,9 +113,7 @@ Status ClientCounterCallback::onClients(const sp<IBinder>& service, bool clients
void ClientCounterCallback::tryShutdown() {
    ALOGI("Trying to shut down the service. No clients in use for any service in process.");

    // This makes the same assumption as IServiceManager.cpp. Could dedupe if used in more places.
    auto manager = interface_cast<AidlServiceManager>(
            ProcessState::self()->getContextObject(nullptr));
    auto manager = interface_cast<AidlServiceManager>(asBinder(defaultServiceManager()));

    auto unRegisterIt = mRegisteredServices.begin();
    for (; unRegisterIt != mRegisteredServices.end(); ++unRegisterIt) {