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

Commit f33ccfaf authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Save the HIDL instances regardless of device version

It seems the lazy Hal interface caching was inserted after the
logical camera physical device query that requires support
for HIDL version 3.5. Devices that support older HIDL interfaces
will not be cached correctly and the lazy Hal functionality will
not work as expected.
Move the interface caching just before the unrelated device version
check.

Bug: 261568606
Test: Successful build
Change-Id: I6a676e5a63272c17482f1d066b78d6d4283b2b93
parent aaaad880
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -692,6 +692,11 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(

    mTorchStrengthLevel = 0;

    if (!kEnableLazyHal) {
        // Save HAL reference indefinitely
        mSavedInterface = interface;
    }

    queryPhysicalCameraIds();

    // Get physical camera characteristics if applicable
@@ -752,13 +757,6 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(
            }
        }
    }

    if (!kEnableLazyHal) {
        // Save HAL reference indefinitely
        mSavedInterface = interface;
    }


}

status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) {