Loading automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -563,7 +563,8 @@ TEST_P(EvsHidlTest, CameraStreamBuffering) { activeCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly Return<EvsResult> badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); Return<EvsResult> badResult = pCam->setMaxFramesInFlight(std::numeric_limits<int32_t>::max()); EXPECT_EQ(EvsResult::BUFFER_NOT_AVAILABLE, badResult); // Now ask for exactly two buffers in flight as we'll test behavior in that case Loading automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -526,7 +526,7 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { mActiveCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly auto badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); auto badResult = pCam->setMaxFramesInFlight(std::numeric_limits<int32_t>::max()); EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == static_cast<int>(EvsResult::INVALID_ARG)); Loading neuralnetworks/utils/adapter/aidl/src/Device.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -135,16 +135,26 @@ std::shared_ptr<PreparedModel> adaptPreparedModel(nn::SharedPreparedModel prepar return ndk::SharedRefBase::make<PreparedModel>(std::move(preparedModel)); } void notify(IPreparedModelCallback* callback, ErrorStatus status, const std::shared_ptr<IPreparedModel>& preparedModel) { if (callback != nullptr) { const auto ret = callback->notify(status, preparedModel); if (!ret.isOk()) { LOG(ERROR) << "IPreparedModelCallback::notify failed with " << ret.getDescription(); } } } void notify(IPreparedModelCallback* callback, PrepareModelResult result) { if (!result.has_value()) { const auto& [message, status] = result.error(); LOG(ERROR) << message; const auto aidlCode = utils::convert(status).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback, aidlCode, nullptr); } else { auto preparedModel = std::move(result).value(); auto aidlPreparedModel = adaptPreparedModel(std::move(preparedModel)); callback->notify(ErrorStatus::NONE, std::move(aidlPreparedModel)); notify(callback, ErrorStatus::NONE, std::move(aidlPreparedModel)); } } Loading Loading @@ -284,7 +294,7 @@ ndk::ScopedAStatus Device::prepareModel(const Model& model, ExecutionPreference if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading @@ -300,7 +310,7 @@ ndk::ScopedAStatus Device::prepareModelFromCache( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading @@ -317,7 +327,7 @@ ndk::ScopedAStatus Device::prepareModelWithConfig( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading Loading
automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -563,7 +563,8 @@ TEST_P(EvsHidlTest, CameraStreamBuffering) { activeCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly Return<EvsResult> badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); Return<EvsResult> badResult = pCam->setMaxFramesInFlight(std::numeric_limits<int32_t>::max()); EXPECT_EQ(EvsResult::BUFFER_NOT_AVAILABLE, badResult); // Now ask for exactly two buffers in flight as we'll test behavior in that case Loading
automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -526,7 +526,7 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { mActiveCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly auto badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); auto badResult = pCam->setMaxFramesInFlight(std::numeric_limits<int32_t>::max()); EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == static_cast<int>(EvsResult::INVALID_ARG)); Loading
neuralnetworks/utils/adapter/aidl/src/Device.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -135,16 +135,26 @@ std::shared_ptr<PreparedModel> adaptPreparedModel(nn::SharedPreparedModel prepar return ndk::SharedRefBase::make<PreparedModel>(std::move(preparedModel)); } void notify(IPreparedModelCallback* callback, ErrorStatus status, const std::shared_ptr<IPreparedModel>& preparedModel) { if (callback != nullptr) { const auto ret = callback->notify(status, preparedModel); if (!ret.isOk()) { LOG(ERROR) << "IPreparedModelCallback::notify failed with " << ret.getDescription(); } } } void notify(IPreparedModelCallback* callback, PrepareModelResult result) { if (!result.has_value()) { const auto& [message, status] = result.error(); LOG(ERROR) << message; const auto aidlCode = utils::convert(status).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback, aidlCode, nullptr); } else { auto preparedModel = std::move(result).value(); auto aidlPreparedModel = adaptPreparedModel(std::move(preparedModel)); callback->notify(ErrorStatus::NONE, std::move(aidlPreparedModel)); notify(callback, ErrorStatus::NONE, std::move(aidlPreparedModel)); } } Loading Loading @@ -284,7 +294,7 @@ ndk::ScopedAStatus Device::prepareModel(const Model& model, ExecutionPreference if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading @@ -300,7 +310,7 @@ ndk::ScopedAStatus Device::prepareModelFromCache( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading @@ -317,7 +327,7 @@ ndk::ScopedAStatus Device::prepareModelWithConfig( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); callback->notify(aidlCode, nullptr); notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast<int32_t>(aidlCode), message.c_str()); } Loading