From e5f54157a4ccc1b78c041055fea5b8d005ffd29b Mon Sep 17 00:00:00 2001 From: Mengjie Xie Date: Thu, 11 Jul 2024 10:25:07 +0800 Subject: [PATCH 1/4] Case finished without waiting for hal result In VTS case RadioNeteworkTest#setEmergencyMode, Case finishes without waiting for the result of exitEmergencyMode. When the response is back, destroyed mutex will be used, It will lead case end abnormally. So, waiting for the response of exitEmergencyMode is necessary. Bug: 352533464 Test: run VTS case RadioNetworkTest#setEmergencyMode (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:80f66789017ed8c3b3b9d038f67446f58d80ea60) Merged-In: I52c527195b71e112275d74c80d0f9c91e42b3041 Change-Id: I52c527195b71e112275d74c80d0f9c91e42b3041 --- radio/aidl/vts/radio_network_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index ec2a29c677..914cad0cd2 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -2171,6 +2171,14 @@ TEST_P(RadioNetworkTest, setEmergencyMode) { // exit emergency mode for other tests serial = GetRandomSerialNumber(); radio_network->exitEmergencyMode(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); } /* From 29e12ff7c23ea72058958c4744585f0e2ae8b54d Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Tue, 30 Jul 2024 10:02:03 -0700 Subject: [PATCH 2/4] Camera: VTS: Adjust test to handle optional readoutTimestamp support With readout timestamp support becomes optional in b/309543399, we need to adjust the VTS test to handle it. Test: vendor testing Bug: 354875531 Change-Id: I552b223f7834df83b8c0bae9f23ab7393a42b64a --- .../hardware/camera/device/ShutterMsg.aidl | 3 ++ camera/provider/aidl/vts/camera_aidl_test.cpp | 35 ++++++++++++++----- camera/provider/aidl/vts/camera_aidl_test.h | 9 +++-- camera/provider/aidl/vts/device_cb.cpp | 15 ++++---- camera/provider/aidl/vts/device_cb.h | 2 +- 5 files changed, 41 insertions(+), 23 deletions(-) diff --git a/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl index 24ae1a0292..f5489d4c76 100644 --- a/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl +++ b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl @@ -40,6 +40,9 @@ parcelable ShutterMsg { * as timestamp, and for a rolling shutter sensor, the value must be * timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time * skew of the cropped lines on the top. + * + * If ANDROID_SENSOR_READOUT_TIMESTAMP is set to NOT_SUPPORTED, this field + * will be ignored by the camera framework. */ long readoutTimestamp; } diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 1ad5af92d9..f905011806 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -456,6 +456,22 @@ Status CameraAidlTest::isLogicalMultiCamera(const camera_metadata_t* staticMeta) return ret; } +bool CameraAidlTest::isReadoutTimestampSupported(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry readoutTimestampEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_SENSOR_READOUT_TIMESTAMP, + &readoutTimestampEntry); + if (rc != 0) { + ALOGI("%s: Failed to find ANDROID_SENSOR_READOUT_TIMESTAMP", __FUNCTION__); + return true; + } + if (readoutTimestampEntry.count == 1 && !readoutTimestampEntry.data.u8[0]) { + ALOGI("%s: readout timestamp not supported", __FUNCTION__); + return false; + } + ALOGI("%s: readout timestamp supported", __FUNCTION__); + return true; +} + void CameraAidlTest::verifyLogicalCameraResult(const camera_metadata_t* staticMetadata, const std::vector& resultMetadata) { camera_metadata_t* metadata = (camera_metadata_t*)resultMetadata.data(); @@ -2383,13 +2399,13 @@ void CameraAidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); ASSERT_EQ(testStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); - // shutterReadoutTimestamp must be available, and it must + // shutterReadoutTimestamp, if supported, must // be >= shutterTimestamp + exposureTime, // and < shutterTimestamp + exposureTime + rollingShutterSkew / 2. - ASSERT_TRUE(inflightReq->shutterReadoutTimestampValid); ASSERT_FALSE(inflightReq->collectedResult.isEmpty()); - if (inflightReq->collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { + if (mSupportReadoutTimestamp && + inflightReq->collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { camera_metadata_entry_t exposureTimeResult = inflightReq->collectedResult.find(ANDROID_SENSOR_EXPOSURE_TIME); nsecs_t exposureToReadout = @@ -2904,13 +2920,14 @@ void CameraAidlTest::processPreviewStabilizationCaptureRequestInternal( ASSERT_FALSE(inflightReq->errorCodeValid); ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); ASSERT_EQ(testStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); - ASSERT_TRUE(inflightReq->shutterReadoutTimestampValid); - nsecs_t readoutTimestamp = inflightReq->shutterReadoutTimestamp; + nsecs_t captureTimestamp = mSupportReadoutTimestamp + ? inflightReq->shutterReadoutTimestamp + : inflightReq->shutterTimestamp; if (previewStabilizationOn) { // Here we collect the time difference between the buffer ready - // timestamp - notify readout timestamp. - // timeLag = buffer ready timestamp - notify readout timestamp. + // timestamp - notify timestamp. + // timeLag = buffer ready timestamp - notify timestamp. // timeLag(previewStabilization) must be <= // timeLag(stabilization off) + 1 frame duration. auto it = cameraDeviceToTimeLag.find(name); @@ -2921,12 +2938,12 @@ void CameraAidlTest::processPreviewStabilizationCaptureRequestInternal( ASSERT_TRUE(it != cameraDeviceToTimeLag.end()); nsecs_t previewStabOnLagTime = - inflightReq->resultOutputBuffers[0].timeStamp - readoutTimestamp; + inflightReq->resultOutputBuffers[0].timeStamp - captureTimestamp; ASSERT_TRUE(previewStabOnLagTime <= (it->second + frameDuration)); } else { // Fill in the buffer ready timestamp - notify timestamp; cameraDeviceToTimeLag[std::string(name)] = - inflightReq->resultOutputBuffers[0].timeStamp - readoutTimestamp; + inflightReq->resultOutputBuffers[0].timeStamp - captureTimestamp; } } diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h index 782794b6aa..9edbf41d42 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.h +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -346,6 +346,8 @@ class CameraAidlTest : public ::testing::TestWithParam { static Status isOfflineSessionSupported(const camera_metadata_t* staticMeta); + static bool isReadoutTimestampSupported(const camera_metadata_t* staticMeta); + static Status getPhysicalCameraIds(const camera_metadata_t* staticMeta, std::unordered_set* physicalIds /*out*/); @@ -456,8 +458,6 @@ class CameraAidlTest : public ::testing::TestWithParam { struct InFlightRequest { // Set by notify() SHUTTER call. nsecs_t shutterTimestamp; - - bool shutterReadoutTimestampValid; nsecs_t shutterReadoutTimestamp; bool errorCodeValid; @@ -523,7 +523,6 @@ class CameraAidlTest : public ::testing::TestWithParam { InFlightRequest() : shutterTimestamp(0), - shutterReadoutTimestampValid(false), shutterReadoutTimestamp(0), errorCodeValid(false), errorCode(ErrorCode::ERROR_BUFFER), @@ -541,7 +540,6 @@ class CameraAidlTest : public ::testing::TestWithParam { InFlightRequest(ssize_t numBuffers, bool hasInput, bool partialResults, int32_t partialCount, std::shared_ptr queue = nullptr) : shutterTimestamp(0), - shutterReadoutTimestampValid(false), shutterReadoutTimestamp(0), errorCodeValid(false), errorCode(ErrorCode::ERROR_BUFFER), @@ -561,7 +559,6 @@ class CameraAidlTest : public ::testing::TestWithParam { const std::unordered_set& extraPhysicalResult, std::shared_ptr queue = nullptr) : shutterTimestamp(0), - shutterReadoutTimestampValid(false), shutterReadoutTimestamp(0), errorCodeValid(false), errorCode(ErrorCode::ERROR_BUFFER), @@ -631,6 +628,8 @@ class CameraAidlTest : public ::testing::TestWithParam { HandleImporter mHandleImporter; + bool mSupportReadoutTimestamp; + friend class DeviceCb; friend class SimpleDeviceCb; friend class TorchProviderCb; diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp index 8a8b925806..bfd1cd1318 100644 --- a/camera/provider/aidl/vts/device_cb.cpp +++ b/camera/provider/aidl/vts/device_cb.cpp @@ -32,10 +32,11 @@ const int64_t kBufferReturnTimeoutSec = 1; DeviceCb::DeviceCb(CameraAidlTest* parent, camera_metadata_t* staticMeta) : mParent(parent) { mStaticMetadata = staticMeta; + parent->mSupportReadoutTimestamp = CameraAidlTest::isReadoutTimestampSupported(staticMeta); } ScopedAStatus DeviceCb::notify(const std::vector& msgs) { - std::vector> readoutTimestamps; + std::vector readoutTimestamps; size_t count = msgs.size(); readoutTimestamps.resize(count); @@ -44,11 +45,11 @@ ScopedAStatus DeviceCb::notify(const std::vector& msgs) { const NotifyMsg& msg = msgs[i]; switch (msg.getTag()) { case NotifyMsg::Tag::error: - readoutTimestamps[i] = {false, 0}; + readoutTimestamps[i] = 0; break; case NotifyMsg::Tag::shutter: const auto& shutter = msg.get(); - readoutTimestamps[i] = {true, shutter.readoutTimestamp}; + readoutTimestamps[i] = shutter.readoutTimestamp; break; } } @@ -446,9 +447,8 @@ bool DeviceCb::processCaptureResultLocked( return notify; } -ScopedAStatus DeviceCb::notifyHelper( - const std::vector& msgs, - const std::vector>& readoutTimestamps) { +ScopedAStatus DeviceCb::notifyHelper(const std::vector& msgs, + const std::vector& readoutTimestamps) { std::lock_guard l(mParent->mLock); for (size_t i = 0; i < msgs.size(); i++) { @@ -514,8 +514,7 @@ ScopedAStatus DeviceCb::notifyHelper( } auto& r = itr->second; r->shutterTimestamp = msg.get().timestamp; - r->shutterReadoutTimestampValid = readoutTimestamps[i].first; - r->shutterReadoutTimestamp = readoutTimestamps[i].second; + r->shutterReadoutTimestamp = readoutTimestamps[i]; break; } } diff --git a/camera/provider/aidl/vts/device_cb.h b/camera/provider/aidl/vts/device_cb.h index 3ae7d10596..d839ab4ba1 100644 --- a/camera/provider/aidl/vts/device_cb.h +++ b/camera/provider/aidl/vts/device_cb.h @@ -60,7 +60,7 @@ class DeviceCb : public BnCameraDeviceCallback { bool processCaptureResultLocked(const CaptureResult& results, std::vector physicalCameraMetadata); ScopedAStatus notifyHelper(const std::vector& msgs, - const std::vector>& readoutTimestamps); + const std::vector& readoutTimestamps); CameraAidlTest* mParent; // Parent object From f519f2e32161a6e6b0d02edf3868574461d94d45 Mon Sep 17 00:00:00 2001 From: sandeepjs Date: Thu, 11 Jul 2024 14:57:08 +0000 Subject: [PATCH 3/4] update vts setSimCardPower test cases to handle different MEP types Bug: 351698476 Test: VtsHalRadioTargetTest Change-Id: I233a12514afb39de32ba72e350d0a5dc94c98daf (cherry picked from commit 2be3b9a0ca71887af74f0e218a2f508e38999795) --- radio/aidl/vts/radio_sim_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index 06654c2982..e9b68cc465 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -118,7 +118,14 @@ TEST_P(RadioSimTest, setSimCardPower) { EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState); if (CardStatus::STATE_PRESENT == slotStatus.cardState) { ASSERT_TRUE(slotStatus.portInfo[0].portActive); - EXPECT_EQ(0, cardStatus.slotMap.portId); + if (cardStatus.supportedMepMode == aidl::android::hardware::radio::config:: + MultipleEnabledProfilesMode::MEP_A1 || + cardStatus.supportedMepMode == aidl::android::hardware::radio::config:: + MultipleEnabledProfilesMode::MEP_A2) { + EXPECT_EQ(1, cardStatus.slotMap.portId); + } else { + EXPECT_EQ(0, cardStatus.slotMap.portId); + } } } } From 965ff77e74730130aa9ac52877648b3456f09d92 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 24 Jul 2024 14:39:05 -0700 Subject: [PATCH 4/4] VtsBluetooth: Update advertising set requirements The requirements for advertising sets are the same in the published VSR requirements for TV and other Android devices, so there should be no difference in the test. Bug: 353619486 Test: mma -j32 (cherry picked from https://android-review.googlesource.com/q/commit:864c9048977fdd27f8aab8ec478833768d7514a3) Merged-In: I48189896138da4efacbe1ce8e46f4267e956771f Change-Id: I48189896138da4efacbe1ce8e46f4267e956771f Bug: 350030122 --- bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp index aaf436f4aa..dcb5fac53c 100644 --- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp +++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -68,8 +67,8 @@ using ::bluetooth::hci::PacketView; using ::bluetooth::hci::ReadLocalVersionInformationBuilder; using ::bluetooth::hci::ReadLocalVersionInformationCompleteView; -static constexpr uint8_t kMinLeAdvSetForBt5 = 16; -static constexpr uint8_t kMinLeAdvSetForBt5FoTv = 10; +static constexpr uint8_t kMinLeAdvSetForBt5 = 10; +static constexpr uint8_t kMinLeAdvSetForBt5ForTv = 10; static constexpr uint8_t kMinLeResolvingListForBt5 = 8; static constexpr size_t kNumHciCommandsBandwidth = 100; @@ -1036,7 +1035,7 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { auto num_adv_set = num_adv_set_view.GetNumberSupportedAdvertisingSets(); if (isTv() && get_vsr_api_level() == __ANDROID_API_U__) { - ASSERT_GE(num_adv_set, kMinLeAdvSetForBt5FoTv); + ASSERT_GE(num_adv_set, kMinLeAdvSetForBt5ForTv); } else { ASSERT_GE(num_adv_set, kMinLeAdvSetForBt5); }