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
This commit is contained in:
Tang Lee
2024-02-02 15:53:03 +08:00
parent fbddfd77ea
commit 4e95fdd9a2
2 changed files with 6 additions and 7 deletions

View File

@@ -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) {

View File

@@ -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);