diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-17 01:21:16 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-17 01:21:16 +0000 |
commit | 3664193b5b996e8790c5840d7d7629270ea5c283 (patch) | |
tree | 63085c23d941629d65c443ec9a4d08252128997a | |
parent | 351ea81b967e1ff844998e3cbf79257551f2a98e (diff) | |
parent | 25d40250659b36c727b8cab47b4f29d57b213b5d (diff) |
Snap for 10338099 from 25d40250659b36c727b8cab47b4f29d57b213b5d to udc-release
Change-Id: I03800730172536f75b0f3ceabba6a28104ee423d
-rw-r--r-- | automotive/evs/1.0/vts/functional/FrameHandler.cpp | 12 | ||||
-rw-r--r-- | contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp | 12 |
2 files changed, 17 insertions, 7 deletions
diff --git a/automotive/evs/1.0/vts/functional/FrameHandler.cpp b/automotive/evs/1.0/vts/functional/FrameHandler.cpp index 6a01a44dfe..4233430478 100644 --- a/automotive/evs/1.0/vts/functional/FrameHandler.cpp +++ b/automotive/evs/1.0/vts/functional/FrameHandler.cpp @@ -133,6 +133,9 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) { // Local flag we use to keep track of when the stream is stopping bool timeToStop = false; + // Another local flag telling whether or not current frame is displayed. + bool frameDisplayed = false; + if (bufferArg.memHandle.getNativeHandle() == nullptr) { // Signal that the last frame has been received and the stream is stopped timeToStop = true; @@ -172,9 +175,7 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) { } else { // Everything looks good! // Keep track so tests or watch dogs can monitor progress - mLock.lock(); - mFramesDisplayed++; - mLock.unlock(); + frameDisplayed = true; } } } @@ -197,12 +198,15 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) { } - // Update our received frame count and notify anybody who cares that things have changed + // Update frame counters and notify anybody who cares that things have changed. mLock.lock(); if (timeToStop) { mRunning = false; } else { mFramesReceived++; + if (frameDisplayed) { + mFramesDisplayed++; + } } mLock.unlock(); mSignal.notify_all(); diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 89a9e23a77..c1cc07cf51 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -385,9 +385,15 @@ TEST_P(ContextHubAidl, TestInvalidHostConnection) { TEST_P(ContextHubAidl, TestNanSessionStateChange) { NanSessionStateUpdate update; update.state = true; - ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); - update.state = false; - ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); + Status status = contextHub->onNanSessionStateChanged(update); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + update.state = false; + ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); + } } std::string PrintGeneratedTest(const testing::TestParamInfo<ContextHubAidl::ParamType>& info) { |