mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user