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

Commit 66c153a4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Synchronize between provider removal and registration"

parents 137c7aaa 6ba8eb27
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ hardware::Return<void> CameraProviderManager::onRegistration(
        const hardware::hidl_string& /*fqName*/,
        const hardware::hidl_string& name,
        bool /*preexisting*/) {
    std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock);
    {
        std::lock_guard<std::mutex> lock(mInterfaceMutex);

@@ -458,6 +459,7 @@ status_t CameraProviderManager::addProviderLocked(const std::string& newProvider
}

status_t CameraProviderManager::removeProvider(const std::string& provider) {
    std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock);
    std::unique_lock<std::mutex> lock(mInterfaceMutex);
    std::vector<String8> removedDeviceIds;
    status_t res = NAME_NOT_FOUND;
+3 −0
Original line number Diff line number Diff line
@@ -246,6 +246,9 @@ private:
    wp<StatusListener> mListener;
    ServiceInteractionProxy* mServiceProxy;

    // mProviderLifecycleLock is locked during onRegistration and removeProvider
    mutable std::mutex mProviderLifecycleLock;

    static HardwareServiceInteractionProxy sHardwareServiceInteractionProxy;

    struct ProviderInfo :