diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-08 23:25:45 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-08 23:25:45 +0000 |
| commit | 0ef08c828d7e98484256c2a1424a7c2650111f39 (patch) | |
| tree | 1a9ec76ed3102e5ac5c149111486f301e4d52c83 | |
| parent | 1d3a299feb7444df52d63d550e037ab005638d90 (diff) | |
| parent | b095226d9286245c7d05088a441c2cff43d2ae65 (diff) | |
| download | android_hardware_interfaces-0ef08c828d7e98484256c2a1424a7c2650111f39.tar.gz android_hardware_interfaces-0ef08c828d7e98484256c2a1424a7c2650111f39.tar.bz2 android_hardware_interfaces-0ef08c828d7e98484256c2a1424a7c2650111f39.zip | |
Snap for 5622519 from b095226d9286245c7d05088a441c2cff43d2ae65 to pi-platform-release
Change-Id: Ica34e89bfee2be3a58c1a0a251bd43ed9adf534b
9 files changed, 235 insertions, 46 deletions
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 22b738256..2a464d58f 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -671,6 +671,7 @@ public: HalStreamConfiguration *halStreamConfig /*out*/, bool *supportsPartialResults /*out*/, uint32_t *partialResultCount /*out*/); + bool isDepthOnly(camera_metadata_t* staticMeta); static Status getAvailableOutputStreams(camera_metadata_t *staticMeta, std::vector<AvailableStream> &outputStreams, const AvailableStream *threshold = nullptr); @@ -682,6 +683,10 @@ public: std::unordered_set<std::string> *physicalIds/*out*/); static Status getSupportedKeys(camera_metadata_t *staticMeta, uint32_t tagId, std::unordered_set<int32_t> *requestIDs/*out*/); + static void fillOutputStreams(camera_metadata_ro_entry_t* entry, + std::vector<AvailableStream>& outputStreams, + const AvailableStream *threshold = nullptr, + const int32_t availableConfigOutputTag = 0u); static void constructFilteredSettings(const sp<ICameraDeviceSession>& session, const std::unordered_set<int32_t>& availableKeys, RequestTemplate reqTemplate, android::hardware::camera::common::V1_0::helper::CameraMetadata* defaultSettings/*out*/, @@ -2521,14 +2526,24 @@ TEST_F(CameraHidlTest, configureStreamsAvailableOutputs) { int32_t streamId = 0; for (auto& it : outputStreams) { V3_2::Stream stream3_2; - bool isJpeg = static_cast<PixelFormat>(it.format) == PixelFormat::BLOB; + V3_2::DataspaceFlags dataspaceFlag = 0; + switch (static_cast<PixelFormat>(it.format)) { + case PixelFormat::BLOB: + dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF); + break; + case PixelFormat::Y16: + dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH); + break; + default: + dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN); + } stream3_2 = {streamId, StreamType::OUTPUT, static_cast<uint32_t>(it.width), static_cast<uint32_t>(it.height), static_cast<PixelFormat>(it.format), GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, - (isJpeg) ? static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF) : 0, + dataspaceFlag, StreamRotation::ROTATION_0}; ::android::hardware::hidl_vec<V3_2::Stream> streams3_2 = {stream3_2}; ::android::hardware::camera::device::V3_4::StreamConfiguration config3_4; @@ -2962,6 +2977,14 @@ TEST_F(CameraHidlTest, configureStreamsPreviewStillOutputs) { openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4); + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + free_camera_metadata(staticMeta); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + outputBlobStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputBlobStreams, @@ -3230,6 +3253,14 @@ TEST_F(CameraHidlTest, configureStreamsVideoStillOutputs) { openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4); + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + free_camera_metadata(staticMeta); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + outputBlobStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputBlobStreams, @@ -4135,38 +4166,56 @@ TEST_F(CameraHidlTest, flushEmpty) { Status CameraHidlTest::getAvailableOutputStreams(camera_metadata_t *staticMeta, std::vector<AvailableStream> &outputStreams, const AvailableStream *threshold) { + AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast<int32_t>(PixelFormat::Y16)}; if (nullptr == staticMeta) { return Status::ILLEGAL_ARGUMENT; } - camera_metadata_ro_entry entry; - int rc = find_camera_metadata_ro_entry(staticMeta, - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &entry); - if ((0 != rc) || (0 != (entry.count % 4))) { + camera_metadata_ro_entry scalarEntry; + camera_metadata_ro_entry depthEntry; + int foundScalar = find_camera_metadata_ro_entry(staticMeta, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &scalarEntry); + int foundDepth = find_camera_metadata_ro_entry(staticMeta, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, &depthEntry); + if ((0 != foundScalar || (0 != (scalarEntry.count % 4))) && + (0 != foundDepth || (0 != (depthEntry.count % 4)))) { return Status::ILLEGAL_ARGUMENT; } - for (size_t i = 0; i < entry.count; i+=4) { - if (ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT == - entry.data.i32[i + 3]) { + if(foundScalar == 0 && (0 == (scalarEntry.count % 4))) { + fillOutputStreams(&scalarEntry, outputStreams, threshold, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT); + } + + if(foundDepth == 0 && (0 == (depthEntry.count % 4))) { + fillOutputStreams(&depthEntry, outputStreams, &depthPreviewThreshold, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT); + } + + return Status::OK; +} + +void CameraHidlTest::fillOutputStreams(camera_metadata_ro_entry_t* entry, + std::vector<AvailableStream>& outputStreams, const AvailableStream* threshold, + const int32_t availableConfigOutputTag) { + for (size_t i = 0; i < entry->count; i+=4) { + if (availableConfigOutputTag == entry->data.i32[i + 3]) { if(nullptr == threshold) { - AvailableStream s = {entry.data.i32[i+1], - entry.data.i32[i+2], entry.data.i32[i]}; + AvailableStream s = {entry->data.i32[i+1], + entry->data.i32[i+2], entry->data.i32[i]}; outputStreams.push_back(s); } else { - if ((threshold->format == entry.data.i32[i]) && - (threshold->width >= entry.data.i32[i+1]) && - (threshold->height >= entry.data.i32[i+2])) { - AvailableStream s = {entry.data.i32[i+1], - entry.data.i32[i+2], threshold->format}; + if ((threshold->format == entry->data.i32[i]) && + (threshold->width >= entry->data.i32[i+1]) && + (threshold->height >= entry->data.i32[i+2])) { + AvailableStream s = {entry->data.i32[i+1], + entry->data.i32[i+2], threshold->format}; outputStreams.push_back(s); } } } - } - - return Status::OK; } // Get max jpeg buffer size in android.jpeg.maxSize @@ -4563,6 +4612,37 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t ASSERT_TRUE(ret.isOk()); } +bool CameraHidlTest::isDepthOnly(camera_metadata_t* staticMeta) { + camera_metadata_ro_entry scalarEntry; + camera_metadata_ro_entry depthEntry; + + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &scalarEntry); + if (rc == 0) { + for (uint32_t i = 0; i < scalarEntry.count; i++) { + if (scalarEntry.data.u8[i] == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE) { + return false; + } + } + } + + for (uint32_t i = 0; i < scalarEntry.count; i++) { + if (scalarEntry.data.u8[i] == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT) { + + rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, &depthEntry); + size_t i = 0; + if (rc == 0 && depthEntry.data.i32[i] == static_cast<int32_t>(PixelFormat::Y16)) { + // only Depth16 format is supported now + return true; + } + break; + } + } + + return false; +} + // Open a device session and configure a preview stream. void CameraHidlTest::configurePreviewStream(const std::string &name, int32_t deviceVersion, sp<ICameraProvider> provider, @@ -4638,11 +4718,20 @@ void CameraHidlTest::configurePreviewStream(const std::string &name, int32_t dev ASSERT_EQ(Status::OK, rc); ASSERT_FALSE(outputPreviewStreams.empty()); + V3_2::DataspaceFlags dataspaceFlag = 0; + switch (static_cast<PixelFormat>(outputPreviewStreams[0].format)) { + case PixelFormat::Y16: + dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH); + break; + default: + dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN); + } + V3_2::Stream stream3_2 = {0, StreamType::OUTPUT, static_cast<uint32_t> (outputPreviewStreams[0].width), static_cast<uint32_t> (outputPreviewStreams[0].height), static_cast<PixelFormat> (outputPreviewStreams[0].format), - GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0, StreamRotation::ROTATION_0}; + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, dataspaceFlag, StreamRotation::ROTATION_0}; ::android::hardware::hidl_vec<V3_2::Stream> streams3_2 = {stream3_2}; ::android::hardware::camera::device::V3_2::StreamConfiguration config3_2; ::android::hardware::camera::device::V3_4::StreamConfiguration config3_4; diff --git a/health/2.0/vts/functional/Android.bp b/health/2.0/vts/functional/Android.bp index 4ad01b98d..c4f2dc9e3 100644 --- a/health/2.0/vts/functional/Android.bp +++ b/health/2.0/vts/functional/Android.bp @@ -19,6 +19,7 @@ cc_test { defaults: ["VtsHalTargetTestDefaults"], srcs: ["VtsHalHealthV2_0TargetTest.cpp"], static_libs: [ + "libgflags", "android.hardware.health@1.0", "android.hardware.health@2.0", ], diff --git a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp index c5431e45c..7bb47fdd1 100644 --- a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp +++ b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp @@ -17,11 +17,14 @@ #define LOG_TAG "health_hidl_hal_test" #include <mutex> +#include <set> +#include <string> #include <VtsHalHidlTargetTestBase.h> #include <android-base/logging.h> #include <android/hardware/health/2.0/IHealth.h> #include <android/hardware/health/2.0/types.h> +#include <gflags/gflags.h> using ::testing::AssertionFailure; using ::testing::AssertionResult; @@ -29,6 +32,41 @@ using ::testing::AssertionSuccess; using ::testing::VtsHalHidlTargetTestBase; using ::testing::VtsHalHidlTargetTestEnvBase; +DEFINE_bool(force, false, "Force test healthd even when the default instance is present."); + +// If GTEST_SKIP is not implemented, use our own skipping mechanism +#ifndef GTEST_SKIP +static std::mutex gSkippedTestsMutex; +static std::set<std::string> gSkippedTests; +static std::string GetCurrentTestName() { + const auto& info = ::testing::UnitTest::GetInstance()->current_test_info(); +#ifdef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + std::string test_suite = info->test_suite_name(); +#else + std::string test_suite = info->test_case_name(); +#endif + return test_suite + "." + info->name(); +} + +#define GTEST_SKIP() \ + do { \ + std::unique_lock<std::mutex> lock(gSkippedTestsMutex); \ + gSkippedTests.insert(GetCurrentTestName()); \ + return; \ + } while (0) + +#define SKIP_IF_SKIPPED() \ + do { \ + std::unique_lock<std::mutex> lock(gSkippedTestsMutex); \ + if (gSkippedTests.find(GetCurrentTestName()) != gSkippedTests.end()) { \ + std::cerr << "[ SKIPPED ] " << GetCurrentTestName() << std::endl; \ + return; \ + } \ + } while (0) +#else +#define SKIP_IF_SKIPPED() +#endif + namespace android { namespace hardware { namespace health { @@ -57,6 +95,14 @@ class HealthHidlTest : public ::testing::VtsHalHidlTargetTestBase { public: virtual void SetUp() override { std::string serviceName = HealthHidlEnvironment::Instance()->getServiceName<IHealth>(); + + if (serviceName == "backup" && !FLAGS_force && + ::testing::VtsHalHidlTargetTestBase::getService<IHealth>() != nullptr) { + LOG(INFO) << "Skipping tests on healthd because the default instance is present. " + << "Use --force if you really want to test healthd."; + GTEST_SKIP(); + } + LOG(INFO) << "get service with name:" << serviceName; ASSERT_FALSE(serviceName.empty()); mHealth = ::testing::VtsHalHidlTargetTestBase::getService<IHealth>(serviceName); @@ -111,6 +157,7 @@ AssertionResult isAllOk(const Return<Result>& r) { * unregisterCallback, and update. */ TEST_F(HealthHidlTest, Callbacks) { + SKIP_IF_SKIPPED(); using namespace std::chrono_literals; sp<Callback> firstCallback = new Callback(); sp<Callback> secondCallback = new Callback(); @@ -147,6 +194,7 @@ TEST_F(HealthHidlTest, Callbacks) { } TEST_F(HealthHidlTest, UnregisterNonExistentCallback) { + SKIP_IF_SKIPPED(); sp<Callback> callback = new Callback(); auto ret = mHealth->unregisterCallback(callback); ASSERT_OK(ret); @@ -228,6 +276,7 @@ bool verifyHealthInfo(const HealthInfo& health_info) { * interface IHealth. */ TEST_F(HealthHidlTest, Properties) { + SKIP_IF_SKIPPED(); EXPECT_OK(mHealth->getChargeCounter([](auto result, auto value) { EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), value > 0); })); @@ -269,6 +318,7 @@ int main(int argc, char** argv) { ::testing::AddGlobalTestEnvironment(HealthHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv); HealthHidlEnvironment::Instance()->init(&argc, argv); + gflags::ParseCommandLineFlags(&argc, &argv, true /* remove flags */); int status = RUN_ALL_TESTS(); LOG(INFO) << "Test result = " << status; return status; diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp index 34a96a0ce..29be2a09b 100644 --- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp +++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp @@ -387,17 +387,28 @@ void changeStateLoadedtoIdle(sp<IOmxNode> omxNode, sp<CodecObserver> observer, OMX_StateIdle); ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); + OMX_PARAM_PORTDEFINITIONTYPE portDefInput; + OMX_PARAM_PORTDEFINITIONTYPE portDefOutput; + status = getPortParam(omxNode, OMX_IndexParamPortDefinition, kPortIndexInput, &portDefInput); + EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); + status = getPortParam(omxNode, OMX_IndexParamPortDefinition, kPortIndexOutput, &portDefOutput); + EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); + // Dont switch states until the ports are populated - status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); - ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + if (portDefInput.nBufferCountActual || portDefOutput.nBufferCountActual) { + status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); + ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + } // allocate buffers on input port ASSERT_NO_FATAL_FAILURE(allocatePortBuffers( omxNode, iBuffer, kPortIndexInput, pm[0], allocGrap)); // Dont switch states until the ports are populated - status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); - ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + if (portDefOutput.nBufferCountActual) { + status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); + ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + } // allocate buffers on output port ASSERT_NO_FATAL_FAILURE(allocatePortBuffers( @@ -430,9 +441,18 @@ void changeStateIdletoLoaded(sp<IOmxNode> omxNode, sp<CodecObserver> observer, OMX_StateLoaded); ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); + OMX_PARAM_PORTDEFINITIONTYPE portDefInput; + OMX_PARAM_PORTDEFINITIONTYPE portDefOutput; + status = getPortParam(omxNode, OMX_IndexParamPortDefinition, kPortIndexInput, &portDefInput); + EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); + status = getPortParam(omxNode, OMX_IndexParamPortDefinition, kPortIndexOutput, &portDefOutput); + EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); + // dont change state until all buffers are freed - status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); - ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + if (portDefInput.nBufferCountActual || portDefOutput.nBufferCountActual) { + status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); + ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + } for (size_t i = 0; i < iBuffer->size(); ++i) { status = omxNode->freeBuffer(kPortIndexInput, (*iBuffer)[i].id); @@ -440,8 +460,10 @@ void changeStateIdletoLoaded(sp<IOmxNode> omxNode, sp<CodecObserver> observer, } // dont change state until all buffers are freed - status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); - ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + if (portDefOutput.nBufferCountActual) { + status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer); + ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::TIMED_OUT); + } for (size_t i = 0; i < oBuffer->size(); ++i) { status = omxNode->freeBuffer(kPortIndexOutput, (*oBuffer)[i].id); diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp index 7750a12fa..222358374 100644 --- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp +++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp @@ -115,6 +115,7 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase { } if (compClass == unknown_class) disableTest = true; isSecure = false; + mTunnel = false; size_t suffixLen = strlen(".secure"); if (strlen(gEnv->getComponent().c_str()) >= suffixLen) { isSecure = @@ -122,6 +123,18 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase { strlen(gEnv->getComponent().c_str()) - suffixLen, ".secure"); } + if (compClass == video_decoder) { + omxNode->configureVideoTunnelMode( + 1, OMX_TRUE, 0, + [&](android::hardware::media::omx::V1_0::Status _s, + const ::android::hardware::hidl_handle& sidebandHandle) { + (void)sidebandHandle; + if (_s == android::hardware::media::omx::V1_0::Status::OK) + this->mTunnel = true; + }); + } + // NOTES: secure components are not covered in these tests. + // we are disabling tests for them if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } @@ -149,6 +162,7 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase { sp<CodecObserver> observer; sp<IOmxNode> omxNode; standardCompClass compClass; + bool mTunnel; bool isSecure; bool disableTest; @@ -991,7 +1005,8 @@ TEST_F(ComponentHidlTest, PortEnableDisable_Idle) { ASSERT_NO_FATAL_FAILURE( changeStateLoadedtoIdle(omxNode, observer, &pBuffer[0], &pBuffer[1], kPortIndexInput, kPortIndexOutput, portMode)); - for (size_t i = portBase; i < portBase + 2; i++) { + int range = mTunnel ? 1 : 2; + for (size_t i = portBase; i < portBase + range; i++) { status = omxNode->sendCommand(toRawCommandType(OMX_CommandPortDisable), i); ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); @@ -1104,7 +1119,8 @@ TEST_F(ComponentHidlTest, PortEnableDisable_Execute) { dispatchOutputBuffer(omxNode, &pBuffer[1], i, portMode[1])); } - for (size_t i = portBase; i < portBase + 2; i++) { + int range = mTunnel ? 1 : 2; + for (size_t i = portBase; i < portBase + range; i++) { status = omxNode->sendCommand(toRawCommandType(OMX_CommandPortDisable), i); ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp index 1db9f7531..df048c6bf 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -153,7 +153,17 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { ".secure"); } if (isSecure) disableTest = true; + omxNode->configureVideoTunnelMode( + 1, OMX_TRUE, 0, + [&](android::hardware::media::omx::V1_0::Status _s, + const ::android::hardware::hidl_handle& sidebandHandle) { + (void)sidebandHandle; + if (_s == android::hardware::media::omx::V1_0::Status::OK) + this->disableTest = true; + }); if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; + // NOTES: secure and tunneled components are not covered in these tests. + // we are disabling tests for them } virtual void TearDown() override { diff --git a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp index da78f410d..1d79ff61a 100644 --- a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp +++ b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp @@ -26,6 +26,10 @@ TEST_F(SapHidlTest, connectReq) { sap->connectReq(token, maxMsgSize); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(sapCb->sapResponseToken, token); + + // Modem side need time for connect to finish. Adding a waiting time to prevent + // disconnect being requested right after connect request. + sleep(1); } /* diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp index d16f1e777..14d592707 100644 --- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp +++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp @@ -348,8 +348,8 @@ TEST_F(WifiChipHidlTest, GetDebugHostWakeReasonStats) { /* * CreateApIface - * Configures the chip in AP mode and ensures that only 1 iface creation - * succeeds. The 2nd iface creation should be rejected. + * Configures the chip in AP mode and ensures that at least 1 iface creation + * succeeds. */ TEST_F(WifiChipHidlTest, CreateApIface) { configureChipForIfaceType(IfaceType::AP, true); @@ -357,8 +357,6 @@ TEST_F(WifiChipHidlTest, CreateApIface) { sp<IWifiApIface> iface; EXPECT_EQ(WifiStatusCode::SUCCESS, createApIface(&iface)); EXPECT_NE(nullptr, iface.get()); - - EXPECT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createApIface(&iface)); } /* @@ -443,8 +441,8 @@ TEST_F(WifiChipHidlTest, RemoveApIface) { /* * CreateNanIface - * Configures the chip in NAN mode and ensures that only 1 iface creation - * succeeds. The 2nd iface creation should be rejected. + * Configures the chip in NAN mode and ensures that at least 1 iface creation + * succeeds. */ TEST_F(WifiChipHidlTest, CreateNanIface) { if (!gEnv->isNanOn) return; @@ -453,8 +451,6 @@ TEST_F(WifiChipHidlTest, CreateNanIface) { sp<IWifiNanIface> iface; ASSERT_EQ(WifiStatusCode::SUCCESS, createNanIface(&iface)); EXPECT_NE(nullptr, iface.get()); - - EXPECT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createNanIface(&iface)); } /* @@ -543,8 +539,8 @@ TEST_F(WifiChipHidlTest, RemoveNanIface) { /* * CreateP2pIface - * Configures the chip in P2P mode and ensures that only 1 iface creation - * succeeds. The 2nd iface creation should be rejected. + * Configures the chip in P2P mode and ensures that at least 1 iface creation + * succeeds. */ TEST_F(WifiChipHidlTest, CreateP2pIface) { configureChipForIfaceType(IfaceType::P2P, true); @@ -552,8 +548,6 @@ TEST_F(WifiChipHidlTest, CreateP2pIface) { sp<IWifiP2pIface> iface; EXPECT_EQ(WifiStatusCode::SUCCESS, createP2pIface(&iface)); EXPECT_NE(nullptr, iface.get()); - - EXPECT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createP2pIface(&iface)); } /* @@ -638,8 +632,8 @@ TEST_F(WifiChipHidlTest, RemoveP2pIface) { /* * CreateStaIface - * Configures the chip in STA mode and ensures that only 1 iface creation - * succeeds. The 2nd iface creation should be rejected. + * Configures the chip in STA mode and ensures that at least 1 iface creation + * succeeds. */ TEST_F(WifiChipHidlTest, CreateStaIface) { configureChipForIfaceType(IfaceType::STA, true); @@ -647,8 +641,6 @@ TEST_F(WifiChipHidlTest, CreateStaIface) { sp<IWifiStaIface> iface; EXPECT_EQ(WifiStatusCode::SUCCESS, createStaIface(&iface)); EXPECT_NE(nullptr, iface.get()); - - EXPECT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createStaIface(&iface)); } /* diff --git a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp index a3410287e..3ced328c0 100644 --- a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp +++ b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp @@ -249,6 +249,11 @@ TEST_F(WifiStaIfaceHidlTest, EnableNDOffload) { * code. */ TEST_F(WifiStaIfaceHidlTest, SetScanningMacOui) { + if (!isCapabilitySupported( + IWifiStaIface::StaIfaceCapabilityMask::SCAN_RAND)) { + // No-op if SetScanningMacOui is not supported. + return; + } const android::hardware::hidl_array<uint8_t, 3> kOui{ std::array<uint8_t, 3>{{0x10, 0x22, 0x33}}}; EXPECT_EQ(WifiStatusCode::SUCCESS, |
