summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automotive/audiocontrol/1.0/vts/functional/Android.bp5
-rw-r--r--automotive/audiocontrol/1.0/vts/functional/VtsHalAudioControlV1_0TargetTest.cpp42
-rw-r--r--automotive/audiocontrol/2.0/types.hal2
-rw-r--r--automotive/can/1.0/vts/functional/Android.bp5
-rw-r--r--automotive/evs/1.1/IEvsCamera.hal18
-rw-r--r--automotive/evs/1.1/default/EvsCamera.cpp8
-rw-r--r--automotive/evs/1.1/default/EvsCamera.h2
-rw-r--r--automotive/evs/1.1/types.hal3
-rw-r--r--automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp137
-rw-r--r--boot/1.1/vts/functional/Android.bp6
-rw-r--r--broadcastradio/1.0/vts/functional/Android.bp5
-rw-r--r--broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp58
-rw-r--r--broadcastradio/1.1/vts/functional/Android.bp5
-rw-r--r--broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp42
-rw-r--r--broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/environment-utils.h41
-rw-r--r--broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/hal-1.x-enum-utils.h38
-rw-r--r--current.txt6
-rw-r--r--graphics/composer/2.2/default/android.hardware.graphics.composer@2.2-service.rc2
-rw-r--r--radio/1.0/vts/functional/radio_hidl_hal_icc.cpp4
-rw-r--r--radio/1.0/vts/functional/radio_hidl_hal_misc.cpp8
-rw-r--r--radio/1.2/vts/functional/radio_hidl_hal_api.cpp8
-rw-r--r--radio/1.3/vts/functional/radio_hidl_hal_api.cpp10
-rw-r--r--usb/1.2/vts/functional/Android.bp6
-rw-r--r--usb/1.2/vts/functional/VtsHalUsbV1_2TargetTest.cpp50
-rw-r--r--wifi/1.0/vts/functional/Android.bp3
-rw-r--r--wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp21
-rw-r--r--wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp2
-rw-r--r--wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp19
-rw-r--r--wifi/1.0/vts/functional/wifi_hidl_test_utils.h23
-rw-r--r--wifi/1.1/vts/functional/Android.bp1
-rw-r--r--wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp21
-rw-r--r--wifi/1.2/vts/functional/Android.bp2
-rw-r--r--wifi/1.2/vts/functional/VtsHalWifiV1_2TargetTest.cpp21
-rw-r--r--wifi/1.3/vts/functional/Android.bp1
-rw-r--r--wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp21
-rw-r--r--wifi/1.4/vts/functional/Android.bp1
-rw-r--r--wifi/1.4/vts/functional/VtsHalWifiV1_4TargetTest.cpp21
-rw-r--r--wifi/1.4/vts/functional/wifi_ap_iface_hidl_test.cpp2
-rw-r--r--wifi/hostapd/1.0/vts/functional/Android.bp1
-rw-r--r--wifi/hostapd/1.0/vts/functional/VtsHalWifiHostapdV1_0TargetTest.cpp21
-rw-r--r--wifi/hostapd/1.1/vts/functional/Android.bp1
-rw-r--r--wifi/hostapd/1.1/vts/functional/VtsHalWifiHostapdV1_1TargetTest.cpp21
-rw-r--r--wifi/hostapd/1.2/vts/functional/Android.bp1
-rw-r--r--wifi/hostapd/1.2/vts/functional/VtsHalWifiHostapdV1_2TargetTest.cpp21
-rw-r--r--wifi/supplicant/1.0/vts/functional/Android.bp1
-rw-r--r--wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantP2pV1_0TargetTest.cpp4
-rw-r--r--wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp21
-rw-r--r--wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp44
-rw-r--r--wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h60
-rw-r--r--wifi/supplicant/1.1/vts/functional/Android.bp1
-rw-r--r--wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp21
-rw-r--r--wifi/supplicant/1.2/vts/functional/Android.bp2
-rw-r--r--wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantP2pV1_2TargetTest.cpp4
-rw-r--r--wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp21
-rw-r--r--wifi/supplicant/1.3/vts/functional/Android.bp1
-rw-r--r--wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp21
56 files changed, 342 insertions, 595 deletions
diff --git a/automotive/audiocontrol/1.0/vts/functional/Android.bp b/automotive/audiocontrol/1.0/vts/functional/Android.bp
index 3cb6340ee8..1bb8e88fbc 100644
--- a/automotive/audiocontrol/1.0/vts/functional/Android.bp
+++ b/automotive/audiocontrol/1.0/vts/functional/Android.bp
@@ -25,5 +25,8 @@ cc_test {
static_libs: [
"android.hardware.automotive.audiocontrol@1.0",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/automotive/audiocontrol/1.0/vts/functional/VtsHalAudioControlV1_0TargetTest.cpp b/automotive/audiocontrol/1.0/vts/functional/VtsHalAudioControlV1_0TargetTest.cpp
index fc0deb94c3..de1ec02072 100644
--- a/automotive/audiocontrol/1.0/vts/functional/VtsHalAudioControlV1_0TargetTest.cpp
+++ b/automotive/audiocontrol/1.0/vts/functional/VtsHalAudioControlV1_0TargetTest.cpp
@@ -25,11 +25,12 @@
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
-#include <android/hardware/automotive/audiocontrol/1.0/types.h>
#include <android/hardware/automotive/audiocontrol/1.0/IAudioControl.h>
+#include <android/hardware/automotive/audiocontrol/1.0/types.h>
#include <android/log.h>
-
-#include <VtsHalHidlTargetTestBase.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
using namespace ::android::hardware::automotive::audiocontrol::V1_0;
using ::android::hardware::Return;
@@ -40,30 +41,12 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::sp;
-
-// Boiler plate for test harness
-class CarAudioControlHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static CarAudioControlHidlEnvironment* Instance() {
- static CarAudioControlHidlEnvironment* instance = new CarAudioControlHidlEnvironment;
- return instance;
- }
-
- virtual void registerTestServices() override { registerTestService<IAudioControl>(); }
- private:
- CarAudioControlHidlEnvironment() {}
-};
-
-
// The main test class for the automotive AudioControl HAL
-class CarAudioControlHidlTest : public ::testing::VtsHalHidlTargetTestBase {
-public:
+class CarAudioControlHidlTest : public ::testing::TestWithParam<std::string> {
+ public:
virtual void SetUp() override {
// Make sure we can connect to the driver
- pAudioControl = ::testing::VtsHalHidlTargetTestBase::getService<IAudioControl>(
- CarAudioControlHidlEnvironment::Instance()->
- getServiceName<IAudioControl>());
+ pAudioControl = IAudioControl::getService(GetParam());
ASSERT_NE(pAudioControl.get(), nullptr);
}
@@ -82,7 +65,7 @@ public:
* fader actually works. The only thing we can do is exercise the HAL and if the HAL crashes,
* we _might_ get a test failure if that breaks the connection to the driver.
*/
-TEST_F(CarAudioControlHidlTest, FaderExercise) {
+TEST_P(CarAudioControlHidlTest, FaderExercise) {
ALOGI("Fader exercise test (silent)");
// Set the fader all the way to the back
@@ -104,7 +87,7 @@ TEST_F(CarAudioControlHidlTest, FaderExercise) {
/*
* Balance exercise test.
*/
-TEST_F(CarAudioControlHidlTest, BalanceExercise) {
+TEST_P(CarAudioControlHidlTest, BalanceExercise) {
ALOGI("Balance exercise test (silent)");
// Set the balance all the way to the left
@@ -126,7 +109,7 @@ TEST_F(CarAudioControlHidlTest, BalanceExercise) {
/*
* Context mapping test.
*/
-TEST_F(CarAudioControlHidlTest, ContextMapping) {
+TEST_P(CarAudioControlHidlTest, ContextMapping) {
ALOGI("Context mapping test");
int bus = -1;
@@ -156,3 +139,8 @@ TEST_F(CarAudioControlHidlTest, ContextMapping) {
bus = pAudioControl->getBusForContext((ContextNumber)~0);
EXPECT_EQ(bus, -1);
}
+
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, CarAudioControlHidlTest,
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(IAudioControl::descriptor)),
+ android::hardware::PrintInstanceNameToString); \ No newline at end of file
diff --git a/automotive/audiocontrol/2.0/types.hal b/automotive/audiocontrol/2.0/types.hal
index 65b0988487..80d9ee1867 100644
--- a/automotive/audiocontrol/2.0/types.hal
+++ b/automotive/audiocontrol/2.0/types.hal
@@ -19,7 +19,7 @@ package android.hardware.automotive.audiocontrol@2.0;
/**
* Changes in audio focus that can be experienced
*/
-enum AudioFocusChange : uint32_t {
+enum AudioFocusChange : int32_t {
NONE = 0,
GAIN = 1,
GAIN_TRANSIENT = 2,
diff --git a/automotive/can/1.0/vts/functional/Android.bp b/automotive/can/1.0/vts/functional/Android.bp
index e3e770b047..d020750f3a 100644
--- a/automotive/can/1.0/vts/functional/Android.bp
+++ b/automotive/can/1.0/vts/functional/Android.bp
@@ -28,7 +28,10 @@ cc_defaults {
"android.hardware.automotive.can@vts-utils-lib",
"libgmock",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
cc_test {
diff --git a/automotive/evs/1.1/IEvsCamera.hal b/automotive/evs/1.1/IEvsCamera.hal
index 38e6c4242c..3e7ac2b299 100644
--- a/automotive/evs/1.1/IEvsCamera.hal
+++ b/automotive/evs/1.1/IEvsCamera.hal
@@ -215,4 +215,22 @@ interface IEvsCamera extends @1.0::IEvsCamera {
*/
setExtendedInfo_1_1(uint32_t opaqueIdentifier, vec<uint8_t> opaqueValue)
generates (EvsResult result);
+
+ /**
+ * Import external buffers to capture frames
+ *
+ * This API must be called with a physical camera device identifier.
+ *
+ * @param buffers A list of buffers allocated by the caller. EvsCamera
+ * will use these buffers to capture frames, in addition to
+ * other buffers already in its buffer pool.
+ * @return result EvsResult::OK if it succeeds to import buffers.
+ * EvsResult::UNDERLYING_SERVICE_ERROR if this is called
+ * for logical camera devices or EVS fails to import
+ * buffers.
+ * delta The amount of buffer pool size changes after importing
+ * given buffers.
+ */
+ importExternalBuffers(vec<BufferDesc> buffers)
+ generates (EvsResult result, int32_t delta);
};
diff --git a/automotive/evs/1.1/default/EvsCamera.cpp b/automotive/evs/1.1/default/EvsCamera.cpp
index 5196c9532b..0e69ed408b 100644
--- a/automotive/evs/1.1/default/EvsCamera.cpp
+++ b/automotive/evs/1.1/default/EvsCamera.cpp
@@ -354,6 +354,14 @@ Return<void> EvsCamera::getExtendedInfo_1_1(uint32_t opaqueIdentifier,
}
+Return<void>
+EvsCamera::importExternalBuffers(const hidl_vec<BufferDesc_1_1>& /* buffers */,
+ importExternalBuffers_cb _hidl_cb) {
+ ALOGW("%s is not implemented yet.", __FUNCTION__);
+ _hidl_cb(EvsResult::UNDERLYING_SERVICE_ERROR, 0);
+ return {};
+}
+
bool EvsCamera::setAvailableFrames_Locked(unsigned bufferCount) {
if (bufferCount < 1) {
diff --git a/automotive/evs/1.1/default/EvsCamera.h b/automotive/evs/1.1/default/EvsCamera.h
index 0fa83b428d..6163a34e08 100644
--- a/automotive/evs/1.1/default/EvsCamera.h
+++ b/automotive/evs/1.1/default/EvsCamera.h
@@ -82,6 +82,8 @@ public:
const hidl_vec<uint8_t>& opaqueValue) override;
Return<void> getExtendedInfo_1_1(uint32_t opaqueIdentifier,
getExtendedInfo_1_1_cb _hidl_cb) override;
+ Return<void> importExternalBuffers(const hidl_vec<BufferDesc_1_1>& buffers,
+ importExternalBuffers_cb _hidl_cb) override;
static sp<EvsCamera> Create(const char *deviceName);
static sp<EvsCamera> Create(const char *deviceName,
diff --git a/automotive/evs/1.1/types.hal b/automotive/evs/1.1/types.hal
index b34e7e7d65..1f69f09b5b 100644
--- a/automotive/evs/1.1/types.hal
+++ b/automotive/evs/1.1/types.hal
@@ -70,6 +70,9 @@ struct BufferDesc {
*/
int64_t timestamp;
+ /**
+ * Frame metadata. This is opaque to EVS manager.
+ */
vec<uint8_t> metadata;
};
diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
index 368a6d4d2d..6a386c3080 100644
--- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
+++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
@@ -50,6 +50,8 @@ static const float kNanoToSeconds = 0.000000001f;
#include <system/camera_metadata.h>
#include <ui/DisplayConfig.h>
#include <ui/DisplayState.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
@@ -66,6 +68,7 @@ using ::android::hardware::hidl_string;
using ::android::sp;
using ::android::wp;
using ::android::hardware::camera::device::V3_2::Stream;
+using ::android::hardware::automotive::evs::V1_1::BufferDesc;
using ::android::hardware::automotive::evs::V1_0::DisplayDesc;
using ::android::hardware::automotive::evs::V1_0::DisplayState;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
@@ -2231,6 +2234,140 @@ TEST_P(EvsHidlTest, LogicalCameraMetadata) {
/*
+ * CameraStreamExternalBuffering:
+ * This is same with CameraStreamBuffering except frame buffers are allocated by
+ * the test client and then imported by EVS framework.
+ */
+TEST_P(EvsHidlTest, CameraStreamExternalBuffering) {
+ LOG(INFO) << "Starting CameraStreamExternalBuffering test";
+
+ // Arbitrary constant (should be > 1 and less than crazy)
+ static const unsigned int kBuffersToHold = 6;
+
+ // Get the camera list
+ loadCameraList();
+
+ // Using null stream configuration makes EVS uses the default resolution and
+ // output format.
+ Stream nullCfg = {};
+
+ // Acquire the graphics buffer allocator
+ android::GraphicBufferAllocator& alloc(android::GraphicBufferAllocator::get());
+ const auto usage = GRALLOC_USAGE_HW_TEXTURE |
+ GRALLOC_USAGE_SW_READ_RARELY |
+ GRALLOC_USAGE_SW_WRITE_OFTEN;
+ const auto format = HAL_PIXEL_FORMAT_RGBA_8888;
+ const auto width = 640;
+ const auto height = 360;
+
+ // Allocate buffers to use
+ hidl_vec<BufferDesc> buffers;
+ for (auto i = 0; i < kBuffersToHold; ++i) {
+ unsigned pixelsPerLine;
+ buffer_handle_t memHandle = nullptr;
+ android::status_t result = alloc.allocate(width,
+ height,
+ format,
+ 1,
+ usage,
+ &memHandle,
+ &pixelsPerLine,
+ 0,
+ "EvsApp");
+ if (result != android::NO_ERROR) {
+ LOG(ERROR) << __FUNCTION__ << " failed to allocate memory.";
+ } else {
+ BufferDesc buf;
+ AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<AHardwareBuffer_Desc *>(&buf.buffer.description);
+ pDesc->width = width;
+ pDesc->height = height;
+ pDesc->layers = 1;
+ pDesc->format = format;
+ pDesc->usage = usage;
+ pDesc->stride = pixelsPerLine;
+ buf.buffer.nativeHandle = memHandle;
+ buf.bufferId = i; // Unique number to identify this buffer
+ buffers[i] = buf;
+ }
+ }
+
+ // Test each reported camera
+ for (auto&& cam: cameraInfo) {
+ bool isLogicalCam = false;
+ getPhysicalCameraIds(cam.v1.cameraId, isLogicalCam);
+
+ sp<IEvsCamera_1_1> pCam =
+ IEvsCamera_1_1::castFrom(pEnumerator->openCamera_1_1(cam.v1.cameraId, nullCfg))
+ .withDefault(nullptr);
+ ASSERT_NE(pCam, nullptr);
+
+ // Store a camera handle for a clean-up
+ activeCameras.push_back(pCam);
+
+ // Request to import buffers
+ EvsResult result = EvsResult::OK;
+ int delta = 0;
+ pCam->importExternalBuffers(buffers,
+ [&] (auto _result, auto _delta) {
+ result = _result;
+ delta = _delta;
+ });
+ if (isLogicalCam) {
+ EXPECT_EQ(result, EvsResult::UNDERLYING_SERVICE_ERROR);
+ continue;
+ }
+
+ EXPECT_EQ(result, EvsResult::OK);
+ EXPECT_GE(delta, 0);
+
+ // Set up a frame receiver object which will fire up its own thread.
+ sp<FrameHandler> frameHandler = new FrameHandler(pCam, cam,
+ nullptr,
+ FrameHandler::eNoAutoReturn);
+
+ // Start the camera's video stream
+ bool startResult = frameHandler->startStream();
+ ASSERT_TRUE(startResult);
+
+ // Check that the video stream stalls once we've gotten exactly the number of buffers
+ // we requested since we told the frameHandler not to return them.
+ sleep(1); // 1 second should be enough for at least 5 frames to be delivered worst case
+ unsigned framesReceived = 0;
+ frameHandler->getFramesCounters(&framesReceived, nullptr);
+ ASSERT_EQ(kBuffersToHold, framesReceived) << "Stream didn't stall at expected buffer limit";
+
+
+ // Give back one buffer
+ bool didReturnBuffer = frameHandler->returnHeldBuffer();
+ EXPECT_TRUE(didReturnBuffer);
+
+ // Once we return a buffer, it shouldn't take more than 1/10 second to get a new one
+ // filled since we require 10fps minimum -- but give a 10% allowance just in case.
+ usleep(110 * kMillisecondsToMicroseconds);
+ frameHandler->getFramesCounters(&framesReceived, nullptr);
+ EXPECT_EQ(kBuffersToHold+1, framesReceived) << "Stream should've resumed";
+
+ // Even when the camera pointer goes out of scope, the FrameHandler object will
+ // keep the stream alive unless we tell it to shutdown.
+ // Also note that the FrameHandle and the Camera have a mutual circular reference, so
+ // we have to break that cycle in order for either of them to get cleaned up.
+ frameHandler->shutdown();
+
+ // Explicitly release the camera
+ pEnumerator->closeCamera(pCam);
+ activeCameras.clear();
+ }
+
+ // Release buffers
+ for (auto& b : buffers) {
+ alloc.free(b.buffer.nativeHandle);
+ }
+ buffers.resize(0);
+}
+
+
+/*
* UltrasonicsArrayOpenClean:
* Opens each ultrasonics arrays reported by the enumerator and then explicitly closes it via a
* call to closeUltrasonicsArray. Then repeats the test to ensure all ultrasonics arrays
diff --git a/boot/1.1/vts/functional/Android.bp b/boot/1.1/vts/functional/Android.bp
index 49ea09a15e..9f0c74a482 100644
--- a/boot/1.1/vts/functional/Android.bp
+++ b/boot/1.1/vts/functional/Android.bp
@@ -23,6 +23,8 @@ cc_test {
"android.hardware.boot@1.1",
"libgmock",
],
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "vts",
+ ],
}
-
diff --git a/broadcastradio/1.0/vts/functional/Android.bp b/broadcastradio/1.0/vts/functional/Android.bp
index 9ba9fbe209..2a4f9420ec 100644
--- a/broadcastradio/1.0/vts/functional/Android.bp
+++ b/broadcastradio/1.0/vts/functional/Android.bp
@@ -22,5 +22,8 @@ cc_test {
"android.hardware.broadcastradio@1.0",
"android.hardware.broadcastradio@vts-utils-lib",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
index 90c8463755..9897ab7af5 100644
--- a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
+++ b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
@@ -15,11 +15,13 @@
*/
#define LOG_TAG "BroadcastRadioHidlHalTest"
-#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include <cutils/native_handle.h>
#include <cutils/properties.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
#include <hidl/HidlTransportSupport.h>
+#include <hidl/ServiceManagement.h>
#include <utils/threads.h>
#include <android/hardware/broadcastradio/1.0/IBroadcastRadio.h>
@@ -27,28 +29,28 @@
#include <android/hardware/broadcastradio/1.0/ITuner.h>
#include <android/hardware/broadcastradio/1.0/ITunerCallback.h>
#include <android/hardware/broadcastradio/1.0/types.h>
-#include <broadcastradio-vts-utils/environment-utils.h>
+#include <broadcastradio-vts-utils/hal-1.x-enum-utils.h>
-using ::android::sp;
-using ::android::Mutex;
using ::android::Condition;
+using ::android::Mutex;
+using ::android::sp;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory;
-using ::android::hardware::broadcastradio::V1_0::IBroadcastRadio;
-using ::android::hardware::broadcastradio::V1_0::ITuner;
-using ::android::hardware::broadcastradio::V1_0::ITunerCallback;
-using ::android::hardware::broadcastradio::V1_0::Result;
-using ::android::hardware::broadcastradio::V1_0::Class;
-using ::android::hardware::broadcastradio::V1_0::Properties;
using ::android::hardware::broadcastradio::V1_0::Band;
using ::android::hardware::broadcastradio::V1_0::BandConfig;
+using ::android::hardware::broadcastradio::V1_0::Class;
using ::android::hardware::broadcastradio::V1_0::Direction;
-using ::android::hardware::broadcastradio::V1_0::ProgramInfo;
+using ::android::hardware::broadcastradio::V1_0::IBroadcastRadio;
+using ::android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory;
+using ::android::hardware::broadcastradio::V1_0::ITuner;
+using ::android::hardware::broadcastradio::V1_0::ITunerCallback;
using ::android::hardware::broadcastradio::V1_0::MetaData;
using ::android::hardware::broadcastradio::V1_0::MetadataKey;
using ::android::hardware::broadcastradio::V1_0::MetadataType;
-using ::android::hardware::broadcastradio::vts::BroadcastRadioHidlEnvironment;
+using ::android::hardware::broadcastradio::V1_0::ProgramInfo;
+using ::android::hardware::broadcastradio::V1_0::Properties;
+using ::android::hardware::broadcastradio::V1_0::Result;
+using ::android::hardware::broadcastradio::V1_0::vts::RadioClassFromString;
#define RETURN_IF_SKIPPED \
if (skipped) { \
@@ -56,19 +58,19 @@ using ::android::hardware::broadcastradio::vts::BroadcastRadioHidlEnvironment;
return; \
}
-static BroadcastRadioHidlEnvironment<IBroadcastRadioFactory>* gEnv = nullptr;
// The main test class for Broadcast Radio HIDL HAL.
-class BroadcastRadioHidlTest : public ::testing::VtsHalHidlTargetTestBase,
- public ::testing::WithParamInterface<Class> {
- protected:
+class BroadcastRadioHidlTest
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ protected:
virtual void SetUp() override {
ASSERT_EQ(nullptr, mRadio.get());
- radioClass = GetParam();
+ radioClass = RadioClassFromString(std::get<1>(GetParam()));
+
skipped = false;
sp<IBroadcastRadioFactory> factory =
- getService<IBroadcastRadioFactory>(gEnv->getServiceName<IBroadcastRadioFactory>());
+ IBroadcastRadioFactory::getService(std::get<0>(GetParam()));
ASSERT_NE(nullptr, factory.get());
Result connectResult;
@@ -727,16 +729,8 @@ TEST_P(BroadcastRadioHidlTest, IbImagesOnly) {
}
INSTANTIATE_TEST_CASE_P(
- BroadcastRadioHidlTestCases,
- BroadcastRadioHidlTest,
- ::testing::Values(Class::AM_FM, Class::SAT, Class::DT));
-
-int main(int argc, char** argv) {
- gEnv = new BroadcastRadioHidlEnvironment<IBroadcastRadioFactory>;
- ::testing::AddGlobalTestEnvironment(gEnv);
- ::testing::InitGoogleTest(&argc, argv);
- gEnv->init(&argc, argv);
- int status = RUN_ALL_TESTS();
- ALOGI("Test result = %d", status);
- return status;
-}
+ PerInstance, BroadcastRadioHidlTest,
+ testing::Combine(testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ IBroadcastRadioFactory::descriptor)),
+ ::testing::Values("AM_FM", "SAT", "DT")),
+ android::hardware::PrintInstanceTupleNameToString<>); \ No newline at end of file
diff --git a/broadcastradio/1.1/vts/functional/Android.bp b/broadcastradio/1.1/vts/functional/Android.bp
index 0a02a694c5..661439aa67 100644
--- a/broadcastradio/1.1/vts/functional/Android.bp
+++ b/broadcastradio/1.1/vts/functional/Android.bp
@@ -25,5 +25,8 @@ cc_test {
"android.hardware.broadcastradio@vts-utils-lib",
"libgmock",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
index 6687731965..4833beb5bb 100644
--- a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
+++ b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
@@ -16,7 +16,6 @@
#define LOG_TAG "broadcastradio.vts"
-#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
@@ -25,13 +24,16 @@
#include <android/hardware/broadcastradio/1.1/types.h>
#include <broadcastradio-utils-1x/Utils.h>
#include <broadcastradio-vts-utils/call-barrier.h>
-#include <broadcastradio-vts-utils/environment-utils.h>
+#include <broadcastradio-vts-utils/hal-1.x-enum-utils.h>
#include <broadcastradio-vts-utils/mock-timeout.h>
#include <broadcastradio-vts-utils/pointer-utils.h>
#include <cutils/native_handle.h>
#include <cutils/properties.h>
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
#include <hidl/HidlTransportSupport.h>
+#include <hidl/ServiceManagement.h>
#include <utils/threads.h>
#include <chrono>
@@ -51,6 +53,7 @@ using testing::DoAll;
using testing::Invoke;
using testing::SaveArg;
+using broadcastradio::V1_0::vts::RadioClassFromString;
using broadcastradio::vts::CallBarrier;
using V1_0::BandConfig;
using V1_0::Class;
@@ -59,7 +62,6 @@ using V1_0::MetadataKey;
using V1_0::MetadataType;
using broadcastradio::vts::clearAndWait;
-using broadcastradio::vts::BroadcastRadioHidlEnvironment;
static constexpr auto kConfigTimeout = 10s;
static constexpr auto kConnectModuleTimeout = 1s;
@@ -93,11 +95,9 @@ struct TunerCallbackMock : public ITunerCallback {
MOCK_TIMEOUT_METHOD1(currentProgramInfoChanged, Return<void>(const ProgramInfo&));
};
-static BroadcastRadioHidlEnvironment<IBroadcastRadioFactory>* gEnv = nullptr;
-
-class BroadcastRadioHalTest : public ::testing::VtsHalHidlTargetTestBase,
- public ::testing::WithParamInterface<Class> {
- protected:
+class BroadcastRadioHalTest
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ protected:
virtual void SetUp() override;
virtual void TearDown() override;
@@ -120,11 +120,10 @@ class BroadcastRadioHalTest : public ::testing::VtsHalHidlTargetTestBase,
};
void BroadcastRadioHalTest::SetUp() {
- radioClass = GetParam();
+ radioClass = RadioClassFromString(std::get<1>(GetParam()));
// lookup HIDL service
- auto factory =
- getService<IBroadcastRadioFactory>(gEnv->getServiceName<IBroadcastRadioFactory>());
+ auto factory = IBroadcastRadioFactory::getService(std::get<0>(GetParam()));
ASSERT_NE(nullptr, factory.get());
// connect radio module
@@ -601,24 +600,15 @@ TEST_P(BroadcastRadioHalTest, VerifyIdentifiersFormat) {
} while (nextBand());
}
-INSTANTIATE_TEST_CASE_P(BroadcastRadioHalTestCases, BroadcastRadioHalTest,
- ::testing::Values(Class::AM_FM, Class::SAT, Class::DT));
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, BroadcastRadioHalTest,
+ testing::Combine(testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ IBroadcastRadioFactory::descriptor)),
+ ::testing::Values("AM_FM", "SAT", "DT")),
+ android::hardware::PrintInstanceTupleNameToString<>);
} // namespace vts
} // namespace V1_1
} // namespace broadcastradio
} // namespace hardware
} // namespace android
-
-int main(int argc, char** argv) {
- using android::hardware::broadcastradio::V1_1::vts::gEnv;
- using android::hardware::broadcastradio::V1_1::IBroadcastRadioFactory;
- using android::hardware::broadcastradio::vts::BroadcastRadioHidlEnvironment;
- gEnv = new BroadcastRadioHidlEnvironment<IBroadcastRadioFactory>;
- ::testing::AddGlobalTestEnvironment(gEnv);
- ::testing::InitGoogleTest(&argc, argv);
- gEnv->init(&argc, argv);
- int status = RUN_ALL_TESTS();
- ALOGI("Test result = %d", status);
- return status;
-}
diff --git a/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/environment-utils.h b/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/environment-utils.h
deleted file mode 100644
index 274e6322b8..0000000000
--- a/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/environment-utils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ANDROID_HARDWARE_BROADCASTRADIO_VTS_ENVIRONMENT_UTILS
-#define ANDROID_HARDWARE_BROADCASTRADIO_VTS_ENVIRONMENT_UTILS
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-namespace android {
-namespace hardware {
-namespace broadcastradio {
-namespace vts {
-
-// Test environment for BroadcastRadio HIDL HAL.
-template <typename... T>
-class BroadcastRadioHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- virtual void registerTestServices() override {
- using expander = int[];
- (void)expander{0, (registerTestService<T>(), 0)...};
- }
-};
-
-} // namespace vts
-} // namespace broadcastradio
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_BROADCASTRADIO_VTS_ENVIRONMENT_UTILS
diff --git a/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/hal-1.x-enum-utils.h b/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/hal-1.x-enum-utils.h
new file mode 100644
index 0000000000..6059ef8fdb
--- /dev/null
+++ b/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/hal-1.x-enum-utils.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+namespace android::hardware::broadcastradio::V1_0::vts {
+
+using android::hardware::broadcastradio::V1_0::Class;
+
+/**
+ * Convert a string of Class name to its enum value. Fail the test if the enum
+ * value is not found.
+ *
+ * @param className string value of a Class enum.
+ * @return Class enum that matches the string value.
+ */
+Class RadioClassFromString(std::string className) {
+ if (className == "AM_FM") return Class::AM_FM;
+ if (className == "SAT") return Class::SAT;
+ if (className == "DT") return Class::DT;
+ // Fail the test run.
+ CHECK(false) << "Class name not found: " << className;
+ // Return some arbitrary enum.
+ return Class::AM_FM;
+}
+} // namespace android::hardware::broadcastradio::V1_0::vts
diff --git a/current.txt b/current.txt
index 183d00637b..2677eb116a 100644
--- a/current.txt
+++ b/current.txt
@@ -635,20 +635,20 @@ ca515ff4b63c80cf5ad7b3395c997c57d6c56157361f6c367d1c96f23cc4860a android.hardwar
4bc4e8087f5c389f013370ed68bc8a1a29cb2f203237937697f35e005a5ad0b4 android.hardware.automotive.audiocontrol@2.0::IAudioControl
37ef585d6687cb31e35c67ab456140d70edba9c4333ce5a6ddd70e636e985773 android.hardware.automotive.audiocontrol@2.0::ICloseHandle
3cf3e5e48ba2642052bbccc1aa4e8bb142933ac960ff40eeedd16e4fe452e7a5 android.hardware.automotive.audiocontrol@2.0::IFocusListener
-d06fc14b325beeef06bd39de8f178f490d9e9095255626866071aab42be1fc40 android.hardware.automotive.audiocontrol@2.0::types
+44c03f3341939524b5f5acb6680f8a91924d02e335a32840d56597616db7f1ea android.hardware.automotive.audiocontrol@2.0::types
949a2582c9efa3f6f631f56120eae3f02313f251dbf9246c327e419cdf0652a2 android.hardware.automotive.can@1.0::ICanBus
43cddb1907a30343bced68946884416ea25ab14ae2df4709357528b2bedba84c android.hardware.automotive.can@1.0::ICanController
272e826492b27b0dbdeda408e84a41ae43e98f29e57995b6452ded270aae4eee android.hardware.automotive.can@1.0::ICanErrorListener
07e387bd8bc0e4df5f372515ed960a0b1ae74ea7231d4490a0bb09b07046e4f1 android.hardware.automotive.can@1.0::ICanMessageListener
2166132d6c247630a193217b4338074f634d6691b1ed6796cb26b3812e90b46e android.hardware.automotive.can@1.0::ICloseHandle
83355471a3b6d7f777d3f129714585ffb77d9b6f8a3d0365741969631efb81b2 android.hardware.automotive.can@1.0::types
-8afd93d525cf17818e3d46e72f30debeaacc6fb166a59a8e25272f2baeb0ef7a android.hardware.automotive.evs@1.1::IEvsCamera
+50bfbeef15d7451bd07e4ad460fbcb7ff80521b89bb8049035c0d458b4125ae4 android.hardware.automotive.evs@1.1::IEvsCamera
89ff5ab18b3069f21a57f559b290caa50670f0ae1b74178f630183aef39b496b android.hardware.automotive.evs@1.1::IEvsCameraStream
4c67f768067a0aceac74381f6f62e778ab3b6a18f47db3c9b98c58190ef5619d android.hardware.automotive.evs@1.1::IEvsDisplay
87958d728d7c0ee9b9391ab4a072b097914921a7b38f7dc3df427f933a5b528e android.hardware.automotive.evs@1.1::IEvsEnumerator
f53b4e8de6209c6d0fa9036005671b34a2f98328b51423d3a5137a43bf42c84d android.hardware.automotive.evs@1.1::IEvsUltrasonicsArray
0460bacbde906a846a3d71b2b7b33d6927cac3ff072e523ffac7853577464406 android.hardware.automotive.evs@1.1::IEvsUltrasonicsArrayStream
-8a156203892de3cfa47baaccabef3c45b3315cae93b332357598d60896b1ac7f android.hardware.automotive.evs@1.1::types
+3e374b5c4777f959f62a320abb3b9edca8874e24e383dbb19c66d224f151b363 android.hardware.automotive.evs@1.1::types
4e4904c4067dadae974ddf90351f362331dcd04bba1d890d313cc8ba91f68c15 android.hardware.automotive.sv@1.0::ISurroundView2dSession
63336e9d03f545020ff2982ff76d9d8c44fa76ad476293b5ef6732cbbd71e61b android.hardware.automotive.sv@1.0::ISurroundView3dSession
b7015428cd52ce8192d13bfcbf2c4455cda3727d57f2aac80d65a1747104f5ac android.hardware.automotive.sv@1.0::ISurroundViewService
diff --git a/graphics/composer/2.2/default/android.hardware.graphics.composer@2.2-service.rc b/graphics/composer/2.2/default/android.hardware.graphics.composer@2.2-service.rc
index 4a0bc4db17..289a91ca3d 100644
--- a/graphics/composer/2.2/default/android.hardware.graphics.composer@2.2-service.rc
+++ b/graphics/composer/2.2/default/android.hardware.graphics.composer@2.2-service.rc
@@ -1,6 +1,4 @@
service vendor.hwcomposer-2-2 /vendor/bin/hw/android.hardware.graphics.composer@2.2-service
- interface android.hardware.graphics.composer@2.1::IComposer default
- interface android.hardware.graphics.composer@2.2::IComposer default
class hal animation
user system
group graphics drmrpc
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index 60cb2fecda..9568524f4f 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -177,9 +177,11 @@ TEST_P(RadioHidlTest, changeIccPin2ForApp) {
}
/*
+ * The following test is disabled due to b/109889468
+ *
* Test IRadio.getImsiForApp() for the response returned.
*/
-TEST_P(RadioHidlTest, getImsiForApp) {
+TEST_P(RadioHidlTest, DISABLED_getImsiForApp) {
serial = GetRandomSerialNumber();
// Check success returned while getting imsi for 3GPP and 3GPP2 apps only
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 9b6cc96cf0..7228fb086b 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -629,9 +629,11 @@ TEST_P(RadioHidlTest, getHardwareConfig) {
}
/*
+ * The following test is disabled due to b/64734869
+ *
* Test IRadio.requestShutdown() for the response returned.
*/
-TEST_P(RadioHidlTest, requestShutdown) {
+TEST_P(RadioHidlTest, DISABLED_requestShutdown) {
serial = GetRandomSerialNumber();
radio->requestShutdown(serial);
@@ -756,9 +758,11 @@ TEST_P(RadioHidlTest, getModemActivityInfo) {
}
/*
+ * The following test is disabled due to b/79930549
+ *
* Test IRadio.setAllowedCarriers() for the response returned.
*/
-TEST_P(RadioHidlTest, setAllowedCarriers) {
+TEST_P(RadioHidlTest, DISABLED_setAllowedCarriers) {
serial = GetRandomSerialNumber();
CarrierRestrictions carriers;
memset(&carriers, 0, sizeof(carriers));
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
index 7464307a98..c81a8d9795 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
@@ -299,9 +299,11 @@ TEST_P(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity2) {
}
/*
+ * The following test is disabled due to b/112206766
+ *
* Test IRadio.startNetworkScan() with valid periodicity
*/
-TEST_P(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
+TEST_P(RadioHidlTest_v1_2, DISABLED_startNetworkScan_GoodRequest1) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
@@ -333,9 +335,11 @@ TEST_P(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
}
/*
+ * The following test is disabled due to b/112206766
+ *
* Test IRadio.startNetworkScan() with valid periodicity and plmns
*/
-TEST_P(RadioHidlTest_v1_2, startNetworkScan_GoodRequest2) {
+TEST_P(RadioHidlTest_v1_2, DISABLED_startNetworkScan_GoodRequest2) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
diff --git a/radio/1.3/vts/functional/radio_hidl_hal_api.cpp b/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
index ca64305bfe..1a01b284b5 100644
--- a/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
@@ -16,6 +16,7 @@
#include <radio_hidl_hal_utils_v1_3.h>
#include <vector>
+#include "VtsCoreUtil.h"
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
@@ -25,6 +26,15 @@
TEST_P(RadioHidlTest_v1_3, enableModem) {
serial = GetRandomSerialNumber();
+ bool isMultiSimEnabled =
+ testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config",
+ "dsds") ||
+ testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "tsts");
+ if (!isMultiSimEnabled) {
+ ALOGI("enableModem, no need to test in single SIM mode");
+ return;
+ }
+
bool responseToggle = radioRsp_v1_3->enableModemResponseToggle;
Return<void> res = radio_v1_3->enableModem(serial, true);
ASSERT_OK(res);
diff --git a/usb/1.2/vts/functional/Android.bp b/usb/1.2/vts/functional/Android.bp
index 761d37f184..d6aaf2d9aa 100644
--- a/usb/1.2/vts/functional/Android.bp
+++ b/usb/1.2/vts/functional/Android.bp
@@ -23,6 +23,8 @@ cc_test {
"android.hardware.usb@1.1",
"android.hardware.usb@1.2",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
-
diff --git a/usb/1.2/vts/functional/VtsHalUsbV1_2TargetTest.cpp b/usb/1.2/vts/functional/VtsHalUsbV1_2TargetTest.cpp
index 7b3dea938e..5f901cd4f6 100644
--- a/usb/1.2/vts/functional/VtsHalUsbV1_2TargetTest.cpp
+++ b/usb/1.2/vts/functional/VtsHalUsbV1_2TargetTest.cpp
@@ -22,8 +22,10 @@
#include <android/hardware/usb/1.2/types.h>
#include <VtsHalHidlTargetCallbackBase.h>
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
+
#include <log/log.h>
#include <stdlib.h>
#include <chrono>
@@ -139,24 +141,12 @@ class UsbCallback : public ::testing::VtsHalHidlTargetCallbackBase<UsbClientCall
};
};
-// Test environment for Usb HIDL HAL.
-class UsbHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static UsbHidlEnvironment* Instance() {
- static UsbHidlEnvironment* instance = new UsbHidlEnvironment;
- return instance;
- }
-
- virtual void registerTestServices() override { registerTestService<IUsb>(); }
-};
-
// The main test class for the USB hidl HAL
-class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- public:
+class UsbHidlTest : public ::testing::TestWithParam<std::string> {
+ public:
virtual void SetUp() override {
ALOGI(__FUNCTION__);
- usb = ::testing::VtsHalHidlTargetTestBase::getService<IUsb>();
+ usb = IUsb::getService(GetParam());
ASSERT_NE(usb, nullptr);
usb_cb_2 = new UsbCallback(kCallbackIdentifier);
@@ -182,7 +172,7 @@ class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase {
* Callback oject is created and registered.
* Check to see if the hidl transaction succeeded.
*/
-TEST_F(UsbHidlTest, setCallback) {
+TEST_P(UsbHidlTest, setCallback) {
usb_cb_1 = new UsbCallback(1);
ASSERT_NE(usb_cb_1, nullptr);
Return<void> ret = usb->setCallback(usb_cb_1);
@@ -195,7 +185,7 @@ TEST_F(UsbHidlTest, setCallback) {
* HAL service should call notifyPortStatusChange_1_2
* instead of notifyPortStatusChange of V1_0/V1_1 interface
*/
-TEST_F(UsbHidlTest, queryPortStatus) {
+TEST_P(UsbHidlTest, queryPortStatus) {
Return<void> ret = usb->queryPortStatus();
ASSERT_TRUE(ret.isOk());
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_2);
@@ -211,7 +201,7 @@ TEST_F(UsbHidlTest, queryPortStatus) {
* Check if supportedContaminantProtectionModes changes across queryPortStatus
* call.
*/
-TEST_F(UsbHidlTest, checkSupportedContaminantProtectionModes) {
+TEST_P(UsbHidlTest, checkSupportedContaminantProtectionModes) {
Return<void> ret = usb->queryPortStatus();
ASSERT_TRUE(ret.isOk());
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_2);
@@ -243,7 +233,7 @@ TEST_F(UsbHidlTest, checkSupportedContaminantProtectionModes) {
* enableContaminantPresenceDetection should not enable/disable
* contaminantPresenceProtection.
*/
-TEST_F(UsbHidlTest, presenceDetectionSupportedCheck) {
+TEST_P(UsbHidlTest, presenceDetectionSupportedCheck) {
Return<void> ret = usb->queryPortStatus();
ASSERT_TRUE(ret.isOk());
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_2);
@@ -272,7 +262,7 @@ TEST_F(UsbHidlTest, presenceDetectionSupportedCheck) {
/*
* enableContaminantPresenceDetection should succeed atleast 90% when supported.
*/
-TEST_F(UsbHidlTest, contaminantPresenceDetectionStability) {
+TEST_P(UsbHidlTest, contaminantPresenceDetectionStability) {
int successCount = 0;
bool currentStatus;
bool supported = true;
@@ -309,7 +299,7 @@ TEST_F(UsbHidlTest, contaminantPresenceDetectionStability) {
* enableContaminantPresenceProtection should not enable/disable
* contaminantPresenceProtection.
*/
-TEST_F(UsbHidlTest, presenceProtectionSupportedCheck) {
+TEST_P(UsbHidlTest, presenceProtectionSupportedCheck) {
Return<void> ret = usb->queryPortStatus();
ASSERT_TRUE(ret.isOk());
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_2);
@@ -338,7 +328,7 @@ TEST_F(UsbHidlTest, presenceProtectionSupportedCheck) {
/*
* enableContaminantPresenceProtection should succeed atleast 90% when supported.
*/
-TEST_F(UsbHidlTest, contaminantPresenceProtectionStability) {
+TEST_P(UsbHidlTest, contaminantPresenceProtectionStability) {
int successCount = 0;
bool currentStatus;
bool supported = true;
@@ -370,11 +360,7 @@ TEST_F(UsbHidlTest, contaminantPresenceProtectionStability) {
if (!supported) EXPECT_GE(successCount, 9);
}
-int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(UsbHidlEnvironment::Instance());
- ::testing::InitGoogleTest(&argc, argv);
- UsbHidlEnvironment::Instance()->init(&argc, argv);
- int status = RUN_ALL_TESTS();
- ALOGI("Test result = %d", status);
- return status;
-}
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, UsbHidlTest,
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(IUsb::descriptor)),
+ android::hardware::PrintInstanceNameToString);
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index bf77503c93..2242510933 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -38,7 +38,6 @@ cc_test {
name: "VtsHalWifiV1_0TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_0TargetTest.cpp",
"wifi_chip_hidl_test.cpp",
"wifi_p2p_iface_hidl_test.cpp",
"wifi_rtt_controller_hidl_test.cpp",
@@ -61,7 +60,6 @@ cc_test {
name: "VtsHalWifiNanV1_0TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_0TargetTest.cpp",
"wifi_chip_hidl_nan_test.cpp",
"wifi_nan_iface_hidl_test.cpp",
],
@@ -79,7 +77,6 @@ cc_test {
name: "VtsHalWifiApV1_0TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_0TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
"wifi_chip_hidl_ap_test.cpp",
],
diff --git a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
deleted file mode 100644
index 128dae5a87..0000000000
--- a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
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 2ea8841170..53131cee78 100644
--- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
@@ -44,8 +44,6 @@ using ::android::hardware::wifi::V1_0::WifiDebugRingBufferVerboseLevel;
using ::android::hardware::wifi::V1_0::WifiStatus;
using ::android::hardware::wifi::V1_0::WifiStatusCode;
-extern WifiHidlEnvironment* gEnv;
-
namespace {
constexpr WifiDebugRingBufferVerboseLevel kDebugRingBufferVerboseLvl =
WifiDebugRingBufferVerboseLevel::VERBOSE;
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
index 26e4821984..c1542dcb59 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
@@ -41,8 +41,6 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::wifi_system::InterfaceTool;
-extern WifiHidlEnvironment* gEnv;
-
namespace {
constexpr uint32_t kHalStartRetryMaxCount = 5;
constexpr uint32_t kHalStartRetryIntervalInMs = 2;
@@ -93,21 +91,8 @@ bool configureChipToSupportIfaceTypeInternal(const sp<IWifiChip>& wifi_chip,
}
} // namespace
-sp<IWifi> getWifi(const std::string& instance_name) {
- if ((!gEnv && instance_name.empty()) || (gEnv && !instance_name.empty())) {
- ALOGE("instance_name and gEnv must have one and only one set.");
- return nullptr;
- }
- if (gEnv) {
- return ::testing::VtsHalHidlTargetTestBase::getService<IWifi>(
- gEnv->getServiceName<IWifi>());
- } else {
- return IWifi::getService(instance_name);
- }
-}
-
sp<IWifiChip> getWifiChip(const std::string& instance_name) {
- sp<IWifi> wifi = getWifi(instance_name);
+ sp<IWifi> wifi = IWifi::getService(instance_name);
if (!wifi.get()) {
return nullptr;
}
@@ -217,7 +202,7 @@ bool configureChipToSupportIfaceType(const sp<IWifiChip>& wifi_chip,
}
void stopWifi(const std::string& instance_name) {
- sp<IWifi> wifi = getWifi(instance_name);
+ sp<IWifi> wifi = IWifi::getService(instance_name);
ASSERT_NE(wifi, nullptr);
HIDL_INVOKE(wifi, stop);
}
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
index 866013417f..d22ed77cd9 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
@@ -31,19 +31,16 @@
// Note: We only have a single instance of each of these objects currently.
// These helper functions should be modified to return vectors if we support
// multiple instances.
-// TODO(b/143892896): Remove the default value as part of the cleanup.
-android::sp<android::hardware::wifi::V1_0::IWifi> getWifi(
- const std::string& instance_name = "");
android::sp<android::hardware::wifi::V1_0::IWifiChip> getWifiChip(
- const std::string& instance_name = "");
+ const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiApIface> getWifiApIface(
- const std::string& instance_name = "");
+ const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiNanIface> getWifiNanIface(
- const std::string& instance_name = "");
+ const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiP2pIface> getWifiP2pIface(
- const std::string& instance_name = "");
+ const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiStaIface> getWifiStaIface(
- const std::string& instance_name = "");
+ const std::string& instance_name);
// Configure the chip in a mode to support the creation of the provided
// iface type.
bool configureChipToSupportIfaceType(
@@ -51,12 +48,4 @@ bool configureChipToSupportIfaceType(
android::hardware::wifi::V1_0::IfaceType type,
android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
// Used to trigger IWifi.stop() at the end of every test.
-void stopWifi(const std::string& instance_name = "");
-
-class WifiHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- protected:
- virtual void HidlSetUp() override {
- stopWifi();
- sleep(5);
- }
-};
+void stopWifi(const std::string& instance_name);
diff --git a/wifi/1.1/vts/functional/Android.bp b/wifi/1.1/vts/functional/Android.bp
index 775031e683..d34ae222d9 100644
--- a/wifi/1.1/vts/functional/Android.bp
+++ b/wifi/1.1/vts/functional/Android.bp
@@ -18,7 +18,6 @@ cc_test {
name: "VtsHalWifiV1_1TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_1TargetTest.cpp",
"wifi_chip_hidl_test.cpp"],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
diff --git a/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp b/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp
deleted file mode 100644
index 4b62b15699..0000000000
--- a/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr;
diff --git a/wifi/1.2/vts/functional/Android.bp b/wifi/1.2/vts/functional/Android.bp
index f43e49ef12..d3de5cfc67 100644
--- a/wifi/1.2/vts/functional/Android.bp
+++ b/wifi/1.2/vts/functional/Android.bp
@@ -18,7 +18,6 @@ cc_test {
name: "VtsHalWifiV1_2TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_2TargetTest.cpp",
"wifi_chip_hidl_test.cpp",
"wifi_sta_iface_hidl_test.cpp",
],
@@ -38,7 +37,6 @@ cc_test {
name: "VtsHalWifiNanV1_2TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_2TargetTest.cpp",
"wifi_nan_iface_hidl_test.cpp",
],
static_libs: [
diff --git a/wifi/1.2/vts/functional/VtsHalWifiV1_2TargetTest.cpp b/wifi/1.2/vts/functional/VtsHalWifiV1_2TargetTest.cpp
deleted file mode 100644
index 52c7a4ad0d..0000000000
--- a/wifi/1.2/vts/functional/VtsHalWifiV1_2TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
diff --git a/wifi/1.3/vts/functional/Android.bp b/wifi/1.3/vts/functional/Android.bp
index fe9c791ec8..457de2973a 100644
--- a/wifi/1.3/vts/functional/Android.bp
+++ b/wifi/1.3/vts/functional/Android.bp
@@ -18,7 +18,6 @@ cc_test {
name: "VtsHalWifiV1_3TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_3TargetTest.cpp",
"wifi_chip_hidl_test.cpp",
"wifi_sta_iface_hidl_test.cpp",
],
diff --git a/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp b/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp
deleted file mode 100644
index 52c7a4ad0d..0000000000
--- a/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
diff --git a/wifi/1.4/vts/functional/Android.bp b/wifi/1.4/vts/functional/Android.bp
index d857be10ed..7e74cbd5de 100644
--- a/wifi/1.4/vts/functional/Android.bp
+++ b/wifi/1.4/vts/functional/Android.bp
@@ -19,7 +19,6 @@ cc_test {
name: "VtsHalWifiApV1_4TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiV1_4TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
"wifi_chip_hidl_test.cpp",
"wifi_nan_iface_hidl_test.cpp",
diff --git a/wifi/1.4/vts/functional/VtsHalWifiV1_4TargetTest.cpp b/wifi/1.4/vts/functional/VtsHalWifiV1_4TargetTest.cpp
deleted file mode 100644
index 7e0f3cdc47..0000000000
--- a/wifi/1.4/vts/functional/VtsHalWifiV1_4TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
diff --git a/wifi/1.4/vts/functional/wifi_ap_iface_hidl_test.cpp b/wifi/1.4/vts/functional/wifi_ap_iface_hidl_test.cpp
index 3507d3074a..aff0ef741f 100644
--- a/wifi/1.4/vts/functional/wifi_ap_iface_hidl_test.cpp
+++ b/wifi/1.4/vts/functional/wifi_ap_iface_hidl_test.cpp
@@ -30,8 +30,6 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
using ::android::hardware::wifi::V1_4::IWifi;
using ::android::hardware::wifi::V1_4::IWifiApIface;
-extern WifiHidlEnvironment* gEnv;
-
/**
* Fixture to use for all STA Iface HIDL interface tests.
*/
diff --git a/wifi/hostapd/1.0/vts/functional/Android.bp b/wifi/hostapd/1.0/vts/functional/Android.bp
index b53d002680..e966d7e817 100644
--- a/wifi/hostapd/1.0/vts/functional/Android.bp
+++ b/wifi/hostapd/1.0/vts/functional/Android.bp
@@ -36,7 +36,6 @@ cc_test {
name: "VtsHalWifiHostapdV1_0TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiHostapdV1_0TargetTest.cpp",
"hostapd_hidl_test.cpp",
],
static_libs: [
diff --git a/wifi/hostapd/1.0/vts/functional/VtsHalWifiHostapdV1_0TargetTest.cpp b/wifi/hostapd/1.0/vts/functional/VtsHalWifiHostapdV1_0TargetTest.cpp
deleted file mode 100644
index 4b62b15699..0000000000
--- a/wifi/hostapd/1.0/vts/functional/VtsHalWifiHostapdV1_0TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr;
diff --git a/wifi/hostapd/1.1/vts/functional/Android.bp b/wifi/hostapd/1.1/vts/functional/Android.bp
index c963fe33a3..8670f2fe97 100644
--- a/wifi/hostapd/1.1/vts/functional/Android.bp
+++ b/wifi/hostapd/1.1/vts/functional/Android.bp
@@ -18,7 +18,6 @@ cc_test {
name: "VtsHalWifiHostapdV1_1TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiHostapdV1_1TargetTest.cpp",
"hostapd_hidl_test.cpp",
],
static_libs: [
diff --git a/wifi/hostapd/1.1/vts/functional/VtsHalWifiHostapdV1_1TargetTest.cpp b/wifi/hostapd/1.1/vts/functional/VtsHalWifiHostapdV1_1TargetTest.cpp
deleted file mode 100644
index 7e0f3cdc47..0000000000
--- a/wifi/hostapd/1.1/vts/functional/VtsHalWifiHostapdV1_1TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
diff --git a/wifi/hostapd/1.2/vts/functional/Android.bp b/wifi/hostapd/1.2/vts/functional/Android.bp
index 50cfdee612..4f4a741bf3 100644
--- a/wifi/hostapd/1.2/vts/functional/Android.bp
+++ b/wifi/hostapd/1.2/vts/functional/Android.bp
@@ -18,7 +18,6 @@ cc_test {
name: "VtsHalWifiHostapdV1_2TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiHostapdV1_2TargetTest.cpp",
"hostapd_hidl_test.cpp",
],
static_libs: [
diff --git a/wifi/hostapd/1.2/vts/functional/VtsHalWifiHostapdV1_2TargetTest.cpp b/wifi/hostapd/1.2/vts/functional/VtsHalWifiHostapdV1_2TargetTest.cpp
deleted file mode 100644
index 7e0f3cdc47..0000000000
--- a/wifi/hostapd/1.2/vts/functional/VtsHalWifiHostapdV1_2TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-::testing::VtsHalHidlTargetTestEnvBase* gEnv = nullptr; \ No newline at end of file
diff --git a/wifi/supplicant/1.0/vts/functional/Android.bp b/wifi/supplicant/1.0/vts/functional/Android.bp
index 80139060f1..a05cc6bfa8 100644
--- a/wifi/supplicant/1.0/vts/functional/Android.bp
+++ b/wifi/supplicant/1.0/vts/functional/Android.bp
@@ -36,7 +36,6 @@ cc_test {
name: "VtsHalWifiSupplicantV1_0TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiSupplicantV1_0TargetTest.cpp",
"supplicant_hidl_test.cpp",
"supplicant_sta_iface_hidl_test.cpp",
"supplicant_sta_network_hidl_test.cpp",
diff --git a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantP2pV1_0TargetTest.cpp b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantP2pV1_0TargetTest.cpp
index a1327071bc..01840e27cf 100644
--- a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantP2pV1_0TargetTest.cpp
+++ b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantP2pV1_0TargetTest.cpp
@@ -17,10 +17,6 @@
#include <VtsCoreUtil.h>
#include "supplicant_hidl_test_utils.h"
-// TODO(b/143892896): Remove this line after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;
-
int main(int argc, char** argv) {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.direct"))
return 0;
diff --git a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
deleted file mode 100644
index f582cc1ff6..0000000000
--- a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "supplicant_hidl_test_utils.h"
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index d0df4a42a1..6fe6fc5936 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -50,8 +50,6 @@ using ::android::hidl::manager::V1_0::IServiceNotification;
using ::android::wifi_system::InterfaceTool;
using ::android::wifi_system::SupplicantManager;
-extern WifiSupplicantHidlEnvironment* gEnv;
-
namespace {
// Helper function to initialize the driver and firmware to STA mode
@@ -176,12 +174,6 @@ void stopSupplicant(const std::string& wifi_instance_name) {
ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-void startSupplicantAndWaitForHidlService() {
- startSupplicantAndWaitForHidlService("",
- gEnv->getServiceName<ISupplicant>());
-}
-
void startSupplicantAndWaitForHidlService(
const std::string& wifi_instance_name,
const std::string& supplicant_instance_name) {
@@ -240,21 +232,6 @@ void addSupplicantP2pIface_1_1(const sp<ISupplicant>& supplicant) {
});
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-sp<ISupplicant> getSupplicant() {
- sp<ISupplicant> supplicant =
- ::testing::VtsHalHidlTargetTestBase::getService<ISupplicant>(
- gEnv->getServiceName<ISupplicant>());
- // For 1.1 supplicant, we need to add interfaces at initialization.
- if (is_1_1(supplicant)) {
- addSupplicantStaIface_1_1(supplicant);
- if (gEnv->isP2pOn) {
- addSupplicantP2pIface_1_1(supplicant);
- }
- }
- return supplicant;
-}
-
sp<ISupplicant> getSupplicant(const std::string& supplicant_instance_name,
bool isP2pOn) {
sp<ISupplicant> supplicant =
@@ -269,12 +246,6 @@ sp<ISupplicant> getSupplicant(const std::string& supplicant_instance_name,
return supplicant;
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-sp<ISupplicantStaIface> getSupplicantStaIface() {
- sp<ISupplicant> supplicant = getSupplicant();
- return getSupplicantStaIface(supplicant);
-}
-
sp<ISupplicantStaIface> getSupplicantStaIface(
const sp<ISupplicant>& supplicant) {
if (!supplicant.get()) {
@@ -300,11 +271,6 @@ sp<ISupplicantStaIface> getSupplicantStaIface(
return sta_iface;
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-sp<ISupplicantStaNetwork> createSupplicantStaNetwork() {
- return createSupplicantStaNetwork(getSupplicant());
-}
-
sp<ISupplicantStaNetwork> createSupplicantStaNetwork(
const sp<ISupplicant>& supplicant) {
sp<ISupplicantStaIface> sta_iface = getSupplicantStaIface(supplicant);
@@ -327,11 +293,6 @@ sp<ISupplicantStaNetwork> createSupplicantStaNetwork(
return sta_network;
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-sp<ISupplicantP2pIface> getSupplicantP2pIface() {
- return getSupplicantP2pIface(getSupplicant());
-}
-
sp<ISupplicantP2pIface> getSupplicantP2pIface(
const sp<ISupplicant>& supplicant) {
if (!supplicant.get()) {
@@ -357,11 +318,6 @@ sp<ISupplicantP2pIface> getSupplicantP2pIface(
return p2p_iface;
}
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-bool turnOnExcessiveLogging() {
- return turnOnExcessiveLogging(getSupplicant());
-}
-
bool turnOnExcessiveLogging(const sp<ISupplicant>& supplicant) {
if (!supplicant.get()) {
return false;
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
index 40ad695152..1ccf0919aa 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
@@ -28,12 +28,9 @@
#include "wifi_hidl_test_utils.h"
// Used to stop the android wifi framework before every test.
-void stopWifiFramework();
void stopWifiFramework(const std::string& wifi_instance_name);
-void startWifiFramework();
void startWifiFramework(const std::string& wifi_instance_name);
-void stopSupplicant();
void stopSupplicant(const std::string& wifi_instance_name);
// Used to configure the chip, driver and start wpa_supplicant before every
// test.
@@ -63,63 +60,6 @@ bool turnOnExcessiveLogging(
const android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicant>&
supplicant);
-// TODO(b/143892896): Remove old APIs after all supplicant tests are updated.
-void startSupplicantAndWaitForHidlService();
-android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicant>
-getSupplicant();
-android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface>
-getSupplicantStaIface();
-android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork>
-createSupplicantStaNetwork();
-android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface>
-getSupplicantP2pIface();
-
bool turnOnExcessiveLogging();
-class WifiSupplicantHidlEnvironment
- : public ::testing::VtsHalHidlTargetTestEnvBase {
- protected:
- virtual void HidlSetUp() override { stopSupplicant(); }
- virtual void HidlTearDown() override {
- startSupplicantAndWaitForHidlService();
- }
-
- public:
- // Whether P2P feature is supported on the device.
- bool isP2pOn = true;
-
- void usage(char* me, char* arg) {
- fprintf(stderr,
- "unrecognized option: %s\n\n"
- "usage: %s <gtest options> <test options>\n\n"
- "test options are:\n\n"
- "-P, --p2p_on: Whether P2P feature is supported\n",
- arg, me);
- }
-
- int initFromOptions(int argc, char** argv) {
- static struct option options[] = {{"p2p_off", no_argument, 0, 'P'},
- {0, 0, 0, 0}};
-
- int c;
- while ((c = getopt_long(argc, argv, "P", options, NULL)) >= 0) {
- switch (c) {
- case 'P':
- isP2pOn = false;
- break;
- default:
- usage(argv[0], argv[optind]);
- return 2;
- }
- }
-
- if (optind < argc) {
- usage(argv[0], argv[optind]);
- return 2;
- }
-
- return 0;
- }
-};
-
#endif /* SUPPLICANT_HIDL_TEST_UTILS_H */
diff --git a/wifi/supplicant/1.1/vts/functional/Android.bp b/wifi/supplicant/1.1/vts/functional/Android.bp
index 6bcfa8ab5f..90a3e872fb 100644
--- a/wifi/supplicant/1.1/vts/functional/Android.bp
+++ b/wifi/supplicant/1.1/vts/functional/Android.bp
@@ -37,7 +37,6 @@ cc_test {
name: "VtsHalWifiSupplicantV1_1TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiSupplicantV1_1TargetTest.cpp",
"supplicant_hidl_test.cpp",
"supplicant_sta_iface_hidl_test.cpp",
"supplicant_sta_network_hidl_test.cpp",
diff --git a/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp b/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp
deleted file mode 100644
index f582cc1ff6..0000000000
--- a/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "supplicant_hidl_test_utils.h"
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;
diff --git a/wifi/supplicant/1.2/vts/functional/Android.bp b/wifi/supplicant/1.2/vts/functional/Android.bp
index 22dec84123..80f3658edd 100644
--- a/wifi/supplicant/1.2/vts/functional/Android.bp
+++ b/wifi/supplicant/1.2/vts/functional/Android.bp
@@ -39,7 +39,6 @@ cc_test {
name: "VtsHalWifiSupplicantV1_2TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiSupplicantV1_2TargetTest.cpp",
"supplicant_sta_iface_hidl_test.cpp",
"supplicant_sta_network_hidl_test.cpp",
],
@@ -68,7 +67,6 @@ cc_test {
name: "VtsHalWifiSupplicantP2pV1_2TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiSupplicantP2pV1_2TargetTest.cpp",
"supplicant_p2p_iface_hidl_test.cpp",
],
static_libs: [
diff --git a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantP2pV1_2TargetTest.cpp b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantP2pV1_2TargetTest.cpp
index 22bf1db45c..7edec475d7 100644
--- a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantP2pV1_2TargetTest.cpp
+++ b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantP2pV1_2TargetTest.cpp
@@ -17,10 +17,6 @@
#include <VtsCoreUtil.h>
#include "supplicant_hidl_test_utils.h"
-// TODO(b/143892896): Remove this line after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;
-
int main(int argc, char** argv) {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.direct"))
return 0;
diff --git a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
deleted file mode 100644
index 9dbeee104f..0000000000
--- a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "supplicant_hidl_test_utils.h"
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;
diff --git a/wifi/supplicant/1.3/vts/functional/Android.bp b/wifi/supplicant/1.3/vts/functional/Android.bp
index 3dabe7cd93..00a0bf7ee1 100644
--- a/wifi/supplicant/1.3/vts/functional/Android.bp
+++ b/wifi/supplicant/1.3/vts/functional/Android.bp
@@ -41,7 +41,6 @@ cc_test {
name: "VtsHalWifiSupplicantV1_3TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
- "VtsHalWifiSupplicantV1_3TargetTest.cpp",
"supplicant_sta_iface_hidl_test.cpp",
"supplicant_sta_network_hidl_test.cpp",
],
diff --git a/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp b/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp
deleted file mode 100644
index 9dbeee104f..0000000000
--- a/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "supplicant_hidl_test_utils.h"
-
-// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
-// updated.
-WifiSupplicantHidlEnvironment* gEnv = nullptr;