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

Commit 731178ea authored by Hidenori Kobayashi's avatar Hidenori Kobayashi Committed by Avichal Rakesh
Browse files

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
parent eb9805c2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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