Camera: Vts: update check for setCallback

A Rust HAL cannot return a service specific error when a nullptr is
passed to setCallback, since libbinder_rs checks for nullptr and returns
EX_NULL_POINTER before the request reaches the specific HAL.

Bug: 360755781
Test: atest VtsAidlHalCameraProvider_TargetTest

Change-Id: I8c558aa6b1d7c89b89506b975b4acd97b5571791
This commit is contained in:
Hidenori Kobayashi
2024-11-11 02:19:26 +00:00
committed by Avichal Rakesh
parent eb9805c249
commit 731178ea46

View File

@@ -118,7 +118,8 @@ TEST_P(CameraAidlTest, setCallback) {
ScopedAStatus ret = mProvider->setCallback(cb);
ASSERT_TRUE(ret.isOk());
ret = mProvider->setCallback(nullptr);
ASSERT_EQ(static_cast<int32_t>(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError());
ASSERT_TRUE(static_cast<int32_t>(Status::ILLEGAL_ARGUMENT) == ret.getServiceSpecificError() ||
EX_NULL_POINTER == ret.getExceptionCode());
}
// Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device