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

Commit 4e95fdd9 authored by Tang Lee's avatar Tang Lee
Browse files

Revert Return ILLEGAL_ARGUMENT for setting null callback for 2.4 HAL

This reverts part of the CL(ag/24741349) on 2.4 HAL file to pass 2.4
VTS. Since ag/24741349 was just for passing latest VTS on default HAL,
it's ok to keep 2.4 HAL aligned with 2.4's VTS case.

Bug: 320925606
Test: none
Change-Id: I3c5e34930925c466ef6be4209e49122af1c791f6
parent fbddfd77
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -95,14 +95,13 @@ ExternalCameraProviderImpl_2_4::~ExternalCameraProviderImpl_2_4() {

Return<Status> ExternalCameraProviderImpl_2_4::setCallback(
        const sp<ICameraProviderCallback>& callback) {
    if (callback == nullptr) {
        return Status::ILLEGAL_ARGUMENT;
    }

    {
        Mutex::Autolock _l(mLock);
        mCallbacks = callback;
    }
    if (callback == nullptr) {
        return Status::OK;
    }
    // Send a callback for all devices to initialize
    {
        for (const auto& pair : mCameraStatusMap) {
+3 −3
Original line number Diff line number Diff line
@@ -448,11 +448,11 @@ bool LegacyCameraProviderImpl_2_4::setUpVendorTags() {
// Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
Return<Status> LegacyCameraProviderImpl_2_4::setCallback(
        const sp<ICameraProviderCallback>& callback) {
    if (callback == nullptr) {
        return Status::ILLEGAL_ARGUMENT;
    }
    Mutex::Autolock _l(mCbLock);
    mCallbacks = callback;
    if (callback == nullptr) {
        return Status::OK;
    }
    // Add and report all presenting external cameras.
    for (auto const& statusPair : mCameraStatusMap) {
        int id = std::stoi(statusPair.first);