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

Commit 00a54e41 authored by Pawan Wagh's avatar Pawan Wagh Committed by Gerrit Code Review
Browse files

Merge "servicemanager : Adding clear API to ServiceManager"

parents 607fcc71 243888ec
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -762,4 +762,10 @@ Status ServiceManager::getServiceDebugInfo(std::vector<ServiceDebugInfo>* outRet
    return Status::ok();
}

void ServiceManager::clear() {
    mNameToService.clear();
    mNameToRegistrationCallback.clear();
    mNameToClientCallback.clear();
}

}  // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ public:
    void binderDied(const wp<IBinder>& who) override;
    void handleClientCallbacks();

    /**
     *  This API is added for debug purposes. It clears members which hold service and callback
     * information.
     */
    void clear();

protected:
    virtual void tryStartService(const std::string& name);

+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    auto accessPtr = std::make_unique<Access>();
    auto serviceManager = sp<ServiceManager>::make(std::move(accessPtr));
    fuzzService(serviceManager, FuzzedDataProvider(data, size));
    serviceManager->clear();

    return 0;
}