Merge "hostapd: Add SAE Support"
diff --git a/automotive/can/1.0/ICanController.hal b/automotive/can/1.0/ICanController.hal
index 2c7494a..0c6f53e 100644
--- a/automotive/can/1.0/ICanController.hal
+++ b/automotive/can/1.0/ICanController.hal
@@ -97,8 +97,8 @@
*/
BAD_ADDRESS,
- /** Provided baud rate is not supported by the hardware. */
- BAD_BAUDRATE,
+ /** Provided bit rate is not supported by the hardware. */
+ BAD_BITRATE,
};
/**
@@ -152,13 +152,13 @@
} interfaceId;
/**
- * Baud rate for CAN communication.
+ * Bit rate for CAN communication.
*
- * Typical baud rates are: 100000, 125000, 250000, 500000.
+ * Typical bit rates are: 100000, 125000, 250000, 500000.
*
* For virtual interfaces this value is ignored.
*/
- uint32_t baudrate;
+ uint32_t bitrate;
};
/**
diff --git a/automotive/can/1.0/default/CanBusNative.cpp b/automotive/can/1.0/default/CanBusNative.cpp
index 047b090..ef04d01 100644
--- a/automotive/can/1.0/default/CanBusNative.cpp
+++ b/automotive/can/1.0/default/CanBusNative.cpp
@@ -22,8 +22,8 @@
namespace android::hardware::automotive::can::V1_0::implementation {
-CanBusNative::CanBusNative(const std::string& ifname, uint32_t baudrate)
- : CanBus(ifname), mBaudrate(baudrate) {}
+CanBusNative::CanBusNative(const std::string& ifname, uint32_t bitrate)
+ : CanBus(ifname), mBitrate(bitrate) {}
ICanController::Result CanBusNative::preUp() {
if (!netdevice::exists(mIfname)) {
@@ -31,7 +31,7 @@
return ICanController::Result::BAD_ADDRESS;
}
- if (mBaudrate == 0) {
+ if (mBitrate == 0) {
// interface is already up and we just want to register it
return ICanController::Result::OK;
}
@@ -41,9 +41,9 @@
return ICanController::Result::UNKNOWN_ERROR;
}
- if (!netdevice::can::setBitrate(mIfname, mBaudrate)) {
- LOG(ERROR) << "Can't set bitrate " << mBaudrate << " for " << mIfname;
- return ICanController::Result::BAD_BAUDRATE;
+ if (!netdevice::can::setBitrate(mIfname, mBitrate)) {
+ LOG(ERROR) << "Can't set bitrate " << mBitrate << " for " << mIfname;
+ return ICanController::Result::BAD_BITRATE;
}
return ICanController::Result::OK;
diff --git a/automotive/can/1.0/default/CanBusNative.h b/automotive/can/1.0/default/CanBusNative.h
index 7eda683..04d7194 100644
--- a/automotive/can/1.0/default/CanBusNative.h
+++ b/automotive/can/1.0/default/CanBusNative.h
@@ -21,13 +21,13 @@
namespace android::hardware::automotive::can::V1_0::implementation {
struct CanBusNative : public CanBus {
- CanBusNative(const std::string& ifname, uint32_t baudrate);
+ CanBusNative(const std::string& ifname, uint32_t bitrate);
protected:
virtual ICanController::Result preUp() override;
private:
- const uint32_t mBaudrate;
+ const uint32_t mBitrate;
};
} // namespace android::hardware::automotive::can::V1_0::implementation
diff --git a/automotive/can/1.0/default/CanBusSlcan.cpp b/automotive/can/1.0/default/CanBusSlcan.cpp
index e42005b..0feee8f 100644
--- a/automotive/can/1.0/default/CanBusSlcan.cpp
+++ b/automotive/can/1.0/default/CanBusSlcan.cpp
@@ -71,7 +71,7 @@
if (kBitrate != 0) {
const auto lookupIt = slcanprotocol::kBitrateCommands.find(kBitrate);
if (lookupIt == slcanprotocol::kBitrateCommands.end()) {
- return ICanController::Result::BAD_BAUDRATE;
+ return ICanController::Result::BAD_BITRATE;
}
canBitrateCommand = lookupIt->second;
}
diff --git a/automotive/can/1.0/default/CanController.cpp b/automotive/can/1.0/default/CanController.cpp
index cd17dd8..fb648c1 100644
--- a/automotive/can/1.0/default/CanController.cpp
+++ b/automotive/can/1.0/default/CanController.cpp
@@ -61,7 +61,7 @@
if (config.iftype == ICanController::InterfaceType::SOCKETCAN) {
// TODO(b/135918744): support serialno
if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) {
- busService = new CanBusNative(config.interfaceId.address(), config.baudrate);
+ busService = new CanBusNative(config.interfaceId.address(), config.bitrate);
} else {
return ICanController::Result::BAD_ADDRESS;
}
@@ -73,7 +73,7 @@
}
} else if (config.iftype == ICanController::InterfaceType::SLCAN) {
if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) {
- busService = new CanBusSlcan(config.interfaceId.address(), config.baudrate);
+ busService = new CanBusSlcan(config.interfaceId.address(), config.bitrate);
} else {
return ICanController::Result::BAD_ADDRESS;
}
diff --git a/automotive/can/1.0/tools/canhalctrl.cpp b/automotive/can/1.0/tools/canhalctrl.cpp
index 5c9849b..5494ba3 100644
--- a/automotive/can/1.0/tools/canhalctrl.cpp
+++ b/automotive/can/1.0/tools/canhalctrl.cpp
@@ -29,12 +29,12 @@
static void usage() {
std::cerr << "CAN bus HAL Control tool" << std::endl;
std::cerr << std::endl << "usage:" << std::endl << std::endl;
- std::cerr << "canhalctrl up <bus name> <type> <interface> [baudrate]" << std::endl;
+ std::cerr << "canhalctrl up <bus name> <type> <interface> [bitrate]" << std::endl;
std::cerr << "where:" << std::endl;
std::cerr << " bus name - name under which ICanBus will be published" << std::endl;
std::cerr << " type - one of: virtual, socketcan, slcan, indexed" << std::endl;
std::cerr << " interface - hardware identifier (like can0, vcan0, /dev/ttyUSB0)" << std::endl;
- std::cerr << " baudrate - such as 100000, 125000, 250000, 500000" << std::endl;
+ std::cerr << " bitrate - such as 100000, 125000, 250000, 500000" << std::endl;
std::cerr << std::endl;
std::cerr << "canhalctrl down <bus name>" << std::endl;
std::cerr << "where:" << std::endl;
@@ -59,7 +59,7 @@
}
static int up(const std::string& busName, ICanController::InterfaceType type,
- const std::string& interface, uint32_t baudrate) {
+ const std::string& interface, uint32_t bitrate) {
bool anySupported = false;
for (auto&& service : getControlServices()) {
auto ctrl = ICanController::getService(service);
@@ -74,7 +74,7 @@
ICanController::BusConfiguration config = {};
config.name = busName;
config.iftype = type;
- config.baudrate = baudrate;
+ config.bitrate = bitrate;
if (type == ICanController::InterfaceType::INDEXED) {
config.interfaceId.index(std::stol(interface));
@@ -146,12 +146,12 @@
return -1;
}
- long long baudrate = 0;
+ long long bitrate = 0;
if (argc == 4) {
- baudrate = std::stoll(argv[3]);
+ bitrate = std::stoll(argv[3]);
}
- return up(busName, *type, interface, baudrate);
+ return up(busName, *type, interface, bitrate);
} else if (cmd == "down") {
if (argc != 1) {
std::cerr << "Invalid number of arguments to down command: " << argc << std::endl;
diff --git a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
index 9bc789a..b2edd78 100644
--- a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
+++ b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp
@@ -172,7 +172,7 @@
ICanController::BusConfiguration config = {};
config.name = "compattestsrv";
config.iftype = iftype;
- config.baudrate = 125000;
+ config.bitrate = 125000;
// using random-ish addresses, which may not be valid - we can't test the success case
if (iddisc == IdDisc::address) {
diff --git a/current.txt b/current.txt
index b19bd10..0fec290 100644
--- a/current.txt
+++ b/current.txt
@@ -648,7 +648,7 @@
9e59fffceed0dd72a9799e04505db5f777bbbea1af0695ba4107ef6d967c6fda android.hardware.neuralnetworks@1.3::IDevice
258825966435b3ed08832055bb736d81516013e405f161d9ccde9a90cfcdde83 android.hardware.neuralnetworks@1.3::IPreparedModel
94e803236398bed1febb11cc21051bc42ec003700139b099d6c479e02a7ca3c3 android.hardware.neuralnetworks@1.3::IPreparedModelCallback
-618a628f8c94d6f6e4cb401b69fa50ccb8b82191ea434e3a071252289b4f312c android.hardware.neuralnetworks@1.3::types
+f3c1e7298da628a755b452cd3325e8d0fe867a2debb873069baab6a27434a72d android.hardware.neuralnetworks@1.3::types
3e01d4446cd69fd1c48f8572efd97487bc179564b32bd795800b97bbe10be37b android.hardware.wifi@1.4::IWifi
42e72d7c8fd843d2611ffb9142bfae61dcdb5325860c6602825863f086a91bff android.hardware.wifi.hostapd@1.2::IHostapd
11f6448d15336361180391c8ebcdfd2d7cf77b3782d577e594d583aadc9c2877 android.hardware.wifi.hostapd@1.2::types
@@ -657,6 +657,9 @@
342a8e12db4dca643f2755eb4167e8f103d96502053a25a1f51f42107a4530f1 android.hardware.wifi.supplicant@1.3::ISupplicantStaIfaceCallback
8835e9799cddf7c239f60beff467cbdf164331f70a8b6c06ed78982d7810d835 android.hardware.wifi.supplicant@1.3::ISupplicantStaNetwork
91015479f5a0fba9872e98d3cca4680995de64f42ae71461b4b7e5acc5a196ab android.hardware.wifi.supplicant@1.3::types
+##
+# BEGIN Radio HAL Merge Conflict Avoidance Buffer - STOPSHIP if present
+##
2c0587a1e83facba604949c31163486f21eb5b47a29c8f29119a47d3bd052103 android.hardware.radio@1.5::types
b5cfa87882b416105fe01e8a40a856d36c93d64f1103d77e12b1281cea13b0bd android.hardware.radio@1.5::IRadio
bc59237dbd93949238081f762710552e76670cb648c0e198138551460ac54b1e android.hardware.radio@1.5::IRadioIndication
@@ -665,5 +668,8 @@
b27ab0cd40b0b078cdcd024bfe1061c4c4c065f3519eeb9347fa359a3268a5ae android.hardware.radio.config@1.3::IRadioConfig
742360c775313438b0f82256eac62fb5bbc76a6ae6f388573f3aa142fb2c1eea android.hardware.radio.config@1.3::IRadioConfigIndication
7683fed9d253956071f18b152e6be657719536f98d9b534433d5e411bcde5061 android.hardware.radio.config@1.3::IRadioConfigResponse
-c411dc16855fcb786cd5e08fe2889acbd72fd54217bd27fe0373813de230ce5f android.hardware.soundtrigger@2.3::types
-5abad7b54d3400fab633cb7a36ffc1747e037bf805d3d9e3517cb6aabf26b002 android.hardware.soundtrigger@2.3::ISoundTriggerHw
+##
+# END Radio HAL Merge Conflict Avoidance Buffer - STOPSHIP if present
+##
+b46d358537168c478762c3d34d5fe1555a3fcd89cd1f43621350ada395e6f795 android.hardware.soundtrigger@2.3::types
+15924fbf38b3c282299a37e48c72405c97e322f844f815081db6acbca22d4165 android.hardware.soundtrigger@2.3::ISoundTriggerHw
diff --git a/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h b/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
index d3b29bb..e0e1394 100644
--- a/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
+++ b/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
@@ -294,9 +294,6 @@
(brightness < 0.0f && brightness != -1.0f)) {
return Error::BAD_PARAMETER;
}
- if (!mDispatch.setDisplayBrightness) {
- return Error::UNSUPPORTED;
- }
int32_t error = mDispatch.setDisplayBrightness(mDevice, display, brightness);
return static_cast<Error>(error);
}
@@ -307,6 +304,13 @@
return false;
}
+ if (!BaseType2_1::initDispatch(HWC2_FUNCTION_GET_DISPLAY_CAPABILITIES,
+ &mDispatch.getDisplayCapabilities) ||
+ !BaseType2_1::initDispatch(HWC2_FUNCTION_SET_DISPLAY_BRIGHTNESS,
+ &mDispatch.setDisplayBrightness)) {
+ return false;
+ }
+
this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_IDENTIFICATION_DATA,
&mDispatch.getDisplayIdentificationData);
this->initOptionalDispatch(HWC2_FUNCTION_SET_LAYER_COLOR_TRANSFORM,
@@ -317,14 +321,10 @@
&mDispatch.setDisplayedContentSamplingEnabled);
this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE,
&mDispatch.getDisplayedContentSample);
- this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_CAPABILITIES,
- &mDispatch.getDisplayCapabilities);
this->initOptionalDispatch(HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS,
&mDispatch.setLayerPerFrameMetadataBlobs);
this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_BRIGHTNESS_SUPPORT,
&mDispatch.getDisplayBrightnessSupport);
- this->initOptionalDispatch(HWC2_FUNCTION_SET_DISPLAY_BRIGHTNESS,
- &mDispatch.setDisplayBrightness);
return true;
}
diff --git a/graphics/composer/2.4/IComposerCallback.hal b/graphics/composer/2.4/IComposerCallback.hal
index fea24a1..f343cee 100644
--- a/graphics/composer/2.4/IComposerCallback.hal
+++ b/graphics/composer/2.4/IComposerCallback.hal
@@ -42,4 +42,14 @@
* @param updatedTimeline is the new timeline for the vsync period change.
*/
oneway onVsyncPeriodTimingChanged(Display display, VsyncPeriodChangeTimeline updatedTimeline);
+
+ /**
+ * Notifies the client that the conditions which previously led to returning
+ * SEAMLESS_NOT_POSSIBLE from setActiveConfigWithConstraints have changed and now seamless may
+ * be possible. Client should retry calling setActiveConfigWithConstraints.
+ *
+ * @param display is a display setActiveConfigWithConstraints previously failed with
+ * SEAMLESS_NOT_POSSIBLE.
+ */
+ oneway onSeamlessPossible(Display display);
};
diff --git a/graphics/composer/2.4/IComposerClient.hal b/graphics/composer/2.4/IComposerClient.hal
index 06b4c5e..1b8170b 100644
--- a/graphics/composer/2.4/IComposerClient.hal
+++ b/graphics/composer/2.4/IComposerClient.hal
@@ -185,6 +185,9 @@
* share the same config group as the current config.
* SEAMLESS_NOT_POSSIBLE when seamlessRequired was true but the display cannot achieve
* the vsync period change without a noticeable visual artifact.
+ * When the conditions change and it may be possible to change
+ * the vsync period seamlessly, onSeamlessPossible callback
+ * must be called to indicate that caller should retry.
* @return timeline is the timeline for the vsync period change.
*/
setActiveConfigWithConstraints(Display display, Config config,
diff --git a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerClient.h b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerClient.h
index dcd959d..d48a9e7 100644
--- a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerClient.h
+++ b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerClient.h
@@ -83,6 +83,12 @@
ret.description().c_str());
}
+ void onSeamlessPossible(Display display) override {
+ auto ret = mCallback->onSeamlessPossible(display);
+ ALOGE_IF(!ret.isOk(), "failed to send onSealmessPossible: %s",
+ ret.description().c_str());
+ }
+
protected:
const sp<IComposerCallback> mCallback;
V2_1::hal::ComposerResources* const mResources;
diff --git a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerHal.h b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerHal.h
index a1e56ae..bbc5405 100644
--- a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerHal.h
+++ b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerHal.h
@@ -49,6 +49,7 @@
VsyncPeriodNanos vsyncPeriodNanos) = 0;
virtual void onVsyncPeriodTimingChanged(Display display,
const VsyncPeriodChangeTimeline& timeline) = 0;
+ virtual void onSeamlessPossible(Display display) = 0;
};
virtual void registerEventCallback_2_4(EventCallback_2_4* callback) = 0;
diff --git a/graphics/composer/2.4/utils/passthrough/include/composer-passthrough/2.4/HwcHal.h b/graphics/composer/2.4/utils/passthrough/include/composer-passthrough/2.4/HwcHal.h
index a34572d..07d8607 100644
--- a/graphics/composer/2.4/utils/passthrough/include/composer-passthrough/2.4/HwcHal.h
+++ b/graphics/composer/2.4/utils/passthrough/include/composer-passthrough/2.4/HwcHal.h
@@ -61,10 +61,12 @@
BaseType2_1::mDispatch.registerCallback(
mDevice, HWC2_CALLBACK_VSYNC_2_4, this,
reinterpret_cast<hwc2_function_pointer_t>(vsync_2_4_Hook));
-
BaseType2_1::mDispatch.registerCallback(
mDevice, HWC2_CALLBACK_VSYNC_PERIOD_TIMING_CHANGED, this,
reinterpret_cast<hwc2_function_pointer_t>(vsyncPeriodTimingChangedHook));
+ BaseType2_1::mDispatch.registerCallback(
+ mDevice, HWC2_CALLBACK_SEAMLESS_POSSIBLE, this,
+ reinterpret_cast<hwc2_function_pointer_t>(seamlessPossibleHook));
}
void unregisterEventCallback_2_4() override {
@@ -80,6 +82,8 @@
BaseType2_1::mDispatch.registerCallback(mDevice, HWC2_CALLBACK_VSYNC_2_4, this, nullptr);
BaseType2_1::mDispatch.registerCallback(mDevice, HWC2_CALLBACK_VSYNC_PERIOD_TIMING_CHANGED,
this, nullptr);
+ BaseType2_1::mDispatch.registerCallback(mDevice, HWC2_CALLBACK_SEAMLESS_POSSIBLE, this,
+ nullptr);
mEventCallback_2_4 = nullptr;
}
@@ -220,12 +224,15 @@
return false;
}
+ if (!BaseType2_1::initDispatch(HWC2_FUNCTION_GET_DISPLAY_VSYNC_PERIOD,
+ &mDispatch.getDisplayVsyncPeriod) ||
+ !BaseType2_1::initDispatch(HWC2_FUNCTION_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS,
+ &mDispatch.setActiveConfigWithConstraints)) {
+ return false;
+ }
+
this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_CONNECTION_TYPE,
&mDispatch.getDisplayConnectionType);
- this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_VSYNC_PERIOD,
- &mDispatch.getDisplayVsyncPeriod);
- this->initOptionalDispatch(HWC2_FUNCTION_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS,
- &mDispatch.setActiveConfigWithConstraints);
this->initOptionalDispatch(HWC2_FUNCTION_SET_AUTO_LOW_LATENCY_MODE,
&mDispatch.setAutoLowLatencyMode);
this->initOptionalDispatch(HWC2_FUNCTION_GET_SUPPORTED_CONTENT_TYPES,
@@ -269,6 +276,11 @@
hal->mEventCallback_2_4->onVsyncPeriodTimingChanged(display, timeline);
}
+ static void seamlessPossibleHook(hwc2_callback_data_t callbackData, hwc2_display_t display) {
+ auto hal = static_cast<HwcHalImpl*>(callbackData);
+ hal->mEventCallback_2_4->onSeamlessPossible(display);
+ }
+
private:
struct {
HWC2_PFN_GET_DISPLAY_CONNECTION_TYPE getDisplayConnectionType;
diff --git a/health/2.1/README.md b/health/2.1/README.md
index 5a19d7b..bfcf13b 100644
--- a/health/2.1/README.md
+++ b/health/2.1/README.md
@@ -99,6 +99,11 @@
For example (replace `<device>` with the device name):
```
+# device/<manufacturer>/<device>/sepolicy/vendor/file_contexts
+# Required for charger to open passthrough implementation. Replace <device> with the proper device
+# name. File name must be consistent with `stem` of the implementation module.
+/vendor/lib(64)?/hw/android\.hardware\.health@2\.0-impl-2\.1-<device>\.so u:object_r:same_process_hal_file:s0
+
# device/<manufacturer>/<device>/sepolicy/vendor/hal_health_default.te
# Add device specific permissions to hal_health_default domain, especially
# if a device-specific libhealthd is used and/or device-specific storage related
diff --git a/neuralnetworks/1.3/types.hal b/neuralnetworks/1.3/types.hal
index 74c259c..62c5833 100644
--- a/neuralnetworks/1.3/types.hal
+++ b/neuralnetworks/1.3/types.hal
@@ -4747,7 +4747,7 @@
RESIZE_NEAREST_NEIGHBOR = @1.2::OperationType:RESIZE_NEAREST_NEIGHBOR,
/**
- * Quantized version of {@link OperationType:LSTM}.
+ * Quantized version of {@link OperationType::LSTM}.
*
* The input and the output use asymmetric quantized types, while the rest
* use symmetric ones.
diff --git a/neuralnetworks/1.3/types.t b/neuralnetworks/1.3/types.t
index e06f5d6..0d20d06 100644
--- a/neuralnetworks/1.3/types.t
+++ b/neuralnetworks/1.3/types.t
@@ -57,6 +57,8 @@
%insert Operation_1.2
+%insert Operation_1.3
+
/**
* DEPRECATED. Since NNAPI 1.2, extensions are the preferred alternative to
* OEM operation and data types.
diff --git a/neuralnetworks/1.3/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.3/vts/functional/GeneratedTestHarness.cpp
index e3c5376..eced063 100644
--- a/neuralnetworks/1.3/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.3/vts/functional/GeneratedTestHarness.cpp
@@ -500,7 +500,7 @@
class DynamicOutputShapeTest : public GeneratedTest {};
// Tag for the dynamic output shape tests
-class DISABLED_QuantizationCouplingTest : public GeneratedTest {};
+class QuantizationCouplingTest : public GeneratedTest {};
TEST_P(GeneratedTest, Test) {
Execute(kDevice, kTestModel, /*testKind=*/TestKind::GENERAL);
@@ -510,7 +510,7 @@
Execute(kDevice, kTestModel, /*testKind=*/TestKind::DYNAMIC_SHAPE);
}
-TEST_P(DISABLED_QuantizationCouplingTest, Test) {
+TEST_P(QuantizationCouplingTest, Test) {
Execute(kDevice, kTestModel, /*testKind=*/TestKind::QUANTIZATION_COUPLING);
}
@@ -520,7 +520,7 @@
INSTANTIATE_GENERATED_TEST(DynamicOutputShapeTest,
[](const TestModel& testModel) { return !testModel.expectFailure; });
-INSTANTIATE_GENERATED_TEST(DISABLED_QuantizationCouplingTest, [](const TestModel& testModel) {
+INSTANTIATE_GENERATED_TEST(QuantizationCouplingTest, [](const TestModel& testModel) {
return testModel.hasQuant8CoupledOperands() && testModel.operations.size() == 1;
});
diff --git a/soundtrigger/2.3/ISoundTriggerHw.hal b/soundtrigger/2.3/ISoundTriggerHw.hal
index 207b9b7..23aa36e 100644
--- a/soundtrigger/2.3/ISoundTriggerHw.hal
+++ b/soundtrigger/2.3/ISoundTriggerHw.hal
@@ -26,6 +26,18 @@
interface ISoundTriggerHw extends @2.2::ISoundTriggerHw {
/**
+ * Retrieve extended implementation properties.
+ * The returned properties includes what is returned from the
+ * getProperties along with expanded implementation details.
+ *
+ * @return retval Operation completion status: 0 in case of success,
+ * -ENODEV in case of initialization error.
+ * @return properties A Properties structure containing implementation
+ * description and capabilities.
+ */
+ getProperties_2_3() generates (int32_t retval, Properties properties);
+
+ /**
* Set a model specific parameter with the given value. This parameter
* will keep its value for the duration the model is loaded regardless of starting and stopping
* recognition. Once the model is unloaded, the value will be lost.
diff --git a/soundtrigger/2.3/default/SoundTriggerHw.cpp b/soundtrigger/2.3/default/SoundTriggerHw.cpp
index 4a39ab5..9fd8fe0 100644
--- a/soundtrigger/2.3/default/SoundTriggerHw.cpp
+++ b/soundtrigger/2.3/default/SoundTriggerHw.cpp
@@ -89,7 +89,7 @@
ALOGV("getProperties() mHwDevice %p", mHwDevice);
int ret;
struct sound_trigger_properties halProperties;
- ISoundTriggerHw::Properties properties;
+ V2_0::ISoundTriggerHw::Properties properties;
if (mHwDevice == NULL) {
ret = -ENODEV;
@@ -333,7 +333,7 @@
}
void SoundTriggerHw::convertPropertiesFromHal(
- ISoundTriggerHw::Properties* properties,
+ V2_0::ISoundTriggerHw::Properties* properties,
const struct sound_trigger_properties* halProperties) {
properties->implementor = halProperties->implementor;
properties->description = halProperties->description;
@@ -350,6 +350,16 @@
properties->powerConsumptionMw = halProperties->power_consumption_mw;
}
+void SoundTriggerHw::convertPropertiesFromHal(
+ V2_3::Properties* properties, const struct sound_trigger_properties_header* header) {
+ if (header->version >= SOUND_TRIGGER_DEVICE_API_VERSION_1_3) {
+ const struct sound_trigger_properties_extended_1_3* halProperties =
+ (const struct sound_trigger_properties_extended_1_3*)header;
+ convertPropertiesFromHal(&properties->base, &halProperties->base);
+ properties->supportedModelArch = halProperties->supported_model_arch;
+ }
+}
+
void SoundTriggerHw::convertTriggerPhraseToHal(struct sound_trigger_phrase* halTriggerPhrase,
const ISoundTriggerHw::Phrase* triggerPhrase) {
halTriggerPhrase->id = triggerPhrase->id;
@@ -708,6 +718,29 @@
// Begin V2_3 implementation
+Return<void> SoundTriggerHw::getProperties_2_3(ISoundTriggerHw::getProperties_2_3_cb _hidl_cb) {
+ ALOGV("getProperties_2_3() mHwDevice %p", mHwDevice);
+ int ret = 0;
+ V2_3::Properties properties;
+ const struct sound_trigger_properties_header* header;
+
+ if (mHwDevice == NULL) {
+ ret = -ENODEV;
+ goto exit;
+ }
+
+ header = mHwDevice->get_properties_extended(mHwDevice);
+
+ convertPropertiesFromHal(&properties, header);
+
+ ALOGV("getProperties_2_3 implementor %s supportedModelArch %s",
+ properties.base.implementor.c_str(), properties.supportedModelArch.c_str());
+
+exit:
+ _hidl_cb(ret, properties);
+ return Void();
+}
+
Return<int32_t> SoundTriggerHw::setParameter(V2_0::SoundModelHandle modelHandle,
ModelParameter modelParam, int32_t value) {
sp<SoundModelClient> client;
diff --git a/soundtrigger/2.3/default/SoundTriggerHw.h b/soundtrigger/2.3/default/SoundTriggerHw.h
index c82c9ea..078debb 100644
--- a/soundtrigger/2.3/default/SoundTriggerHw.h
+++ b/soundtrigger/2.3/default/SoundTriggerHw.h
@@ -85,6 +85,7 @@
Return<int32_t> getModelState(int32_t modelHandle) override;
// Methods from V2_3::ISoundTriggerHw follow.
+ Return<void> getProperties_2_3(getProperties_2_3_cb _hidl_cb) override;
Return<int32_t> setParameter(V2_0::SoundModelHandle modelHandle, ModelParameter modelParam,
int32_t value) override;
Return<void> getParameter(V2_0::SoundModelHandle modelHandle, ModelParameter modelParam,
@@ -156,6 +157,8 @@
void convertUuidToHal(sound_trigger_uuid_t* halUuid, const Uuid* uuid);
void convertPropertiesFromHal(V2_0::ISoundTriggerHw::Properties* properties,
const struct sound_trigger_properties* halProperties);
+ void convertPropertiesFromHal(V2_3::Properties* properties,
+ const struct sound_trigger_properties_header* header);
static sound_trigger_model_parameter_t convertModelParameterToHal(ModelParameter param);
void convertTriggerPhraseToHal(struct sound_trigger_phrase* halTriggerPhrase,
const V2_0::ISoundTriggerHw::Phrase* triggerPhrase);
diff --git a/soundtrigger/2.3/types.hal b/soundtrigger/2.3/types.hal
index c3a522b..6149126 100644
--- a/soundtrigger/2.3/types.hal
+++ b/soundtrigger/2.3/types.hal
@@ -17,6 +17,21 @@
package android.hardware.soundtrigger@2.3;
import android.hidl.safe_union@1.0::Monostate;
+import @2.0::ISoundTriggerHw.Properties;
+
+/**
+ * Extended implementation properties providing verbose implementation
+ * details.
+ */
+struct Properties {
+ @2.0::ISoundTriggerHw.Properties base;
+
+ /**
+ * String naming the architecture used for running the supported models.
+ * (eg. DSP architecture)
+ */
+ string supportedModelArch;
+};
/**
* Model specific parameters to be used with parameter set and get APIs
diff --git a/soundtrigger/2.3/vts/functional/VtsHalSoundtriggerV2_3TargetTest.cpp b/soundtrigger/2.3/vts/functional/VtsHalSoundtriggerV2_3TargetTest.cpp
index 202eb6c..ed38368 100644
--- a/soundtrigger/2.3/vts/functional/VtsHalSoundtriggerV2_3TargetTest.cpp
+++ b/soundtrigger/2.3/vts/functional/VtsHalSoundtriggerV2_3TargetTest.cpp
@@ -26,7 +26,9 @@
using ::android::sp;
using ::android::hardware::Return;
+using ::android::hardware::soundtrigger::V2_0::RecognitionMode;
using ::android::hardware::soundtrigger::V2_3::ISoundTriggerHw;
+using ::android::hardware::soundtrigger::V2_3::Properties;
/**
* Test class holding the instance of the SoundTriggerHW service to test.
@@ -53,6 +55,32 @@
*/
TEST_P(SoundTriggerHidlTest, ServiceIsInstantiated) {}
+/**
+ * Test ISoundTriggerHw::getProperties_2_3 method
+ *
+ * Verifies that:
+ * - the implementation implements the method
+ * - the method returns no error
+ * - the implementation supports at least one sound model and one key phrase
+ * - the implementation supports at least VOICE_TRIGGER recognition mode
+ */
+TEST_P(SoundTriggerHidlTest, GetProperties_2_3) {
+ Properties halProperties;
+ Return<void> hidlReturn;
+ int ret = -ENODEV;
+
+ hidlReturn = soundtrigger->getProperties_2_3([&](int rc, auto res) {
+ ret = rc;
+ halProperties = res;
+ });
+
+ EXPECT_TRUE(hidlReturn.isOk());
+ EXPECT_EQ(0, ret);
+ EXPECT_GT(halProperties.base.maxSoundModels, 0u);
+ EXPECT_GT(halProperties.base.maxKeyPhrases, 0u);
+ EXPECT_NE(0u, (halProperties.base.recognitionModes & (uint32_t)RecognitionMode::VOICE_TRIGGER));
+}
+
INSTANTIATE_TEST_SUITE_P(
PerInstance, SoundTriggerHidlTest,
testing::ValuesIn(android::hardware::getAllHalInstanceNames(ISoundTriggerHw::descriptor)),
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 d47e42f..d0df4a4 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
@@ -57,6 +57,11 @@
// Helper function to initialize the driver and firmware to STA mode
// using the vendor HAL HIDL interface.
void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
+ // Skip if wifi instance is not set.
+ if (wifi_instance_name == "") {
+ return;
+ }
+
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
ChipModeId mode_id;
EXPECT_TRUE(configureChipToSupportIfaceType(
@@ -66,6 +71,11 @@
// Helper function to deinitialize the driver and firmware
// using the vendor HAL HIDL interface.
void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
+ // Skip if wifi instance is not set.
+ if (wifi_instance_name == "") {
+ return;
+ }
+
stopWifi(wifi_instance_name);
}
diff --git a/wifi/supplicant/1.1/vts/functional/Android.bp b/wifi/supplicant/1.1/vts/functional/Android.bp
index 8457532..6bcfa8a 100644
--- a/wifi/supplicant/1.1/vts/functional/Android.bp
+++ b/wifi/supplicant/1.1/vts/functional/Android.bp
@@ -19,7 +19,7 @@
defaults: ["VtsHalTargetTestDefaults"],
srcs: ["supplicant_hidl_test_utils_1_1.cpp"],
export_include_dirs: [
- "."
+ ".",
],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
@@ -54,5 +54,8 @@
"libwifi-system",
"libwifi-system-iface",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts-core",
+ ],
}
diff --git a/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp b/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp
index 9063a3b..f582cc1 100644
--- a/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp
+++ b/wifi/supplicant/1.1/vts/functional/VtsHalWifiSupplicantV1_1TargetTest.cpp
@@ -14,45 +14,8 @@
* limitations under the License.
*/
-#include <android-base/logging.h>
-#include <android/hardware/wifi/1.1/IWifi.h>
-#include <android/hardware/wifi/supplicant/1.1/ISupplicant.h>
-
#include "supplicant_hidl_test_utils.h"
-#include "wifi_hidl_test_utils.h"
-class WifiSupplicantHidlEnvironment_1_1 : public WifiSupplicantHidlEnvironment {
- public:
- // get the test environment singleton
- static WifiSupplicantHidlEnvironment_1_1* Instance() {
- static WifiSupplicantHidlEnvironment_1_1* instance =
- new WifiSupplicantHidlEnvironment_1_1;
- return instance;
- }
- virtual void registerTestServices() override {
- registerTestService<::android::hardware::wifi::V1_0::IWifi>();
- registerTestService<::android::hardware::wifi::V1_1::IWifi>();
- registerTestService<
- ::android::hardware::wifi::supplicant::V1_0::ISupplicant>();
- registerTestService<
- ::android::hardware::wifi::supplicant::V1_1::ISupplicant>();
- }
-
- private:
- WifiSupplicantHidlEnvironment_1_1() {}
-};
-
-WifiSupplicantHidlEnvironment* gEnv =
- WifiSupplicantHidlEnvironment_1_1::Instance();
-
-int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(gEnv);
- ::testing::InitGoogleTest(&argc, argv);
- gEnv->init(&argc, argv);
- int status = gEnv->initFromOptions(argc, argv);
- if (status == 0) {
- int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
- }
- return status;
-}
+// TODO(b/143892896): Remove this file after wifi_hidl_test_utils.cpp is
+// updated.
+WifiSupplicantHidlEnvironment* gEnv = nullptr;
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
index 28f980c..24a7ec3 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
@@ -17,10 +17,12 @@
#include <android-base/logging.h>
#include <cutils/properties.h>
-#include <VtsHalHidlTargetTestBase.h>
-
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/supplicant/1.0/types.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicant.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include "supplicant_hidl_test_utils.h"
#include "supplicant_hidl_test_utils_1_1.h"
@@ -33,22 +35,11 @@
using ::android::hardware::wifi::supplicant::V1_1::ISupplicant;
using ::android::sp;
-extern WifiSupplicantHidlEnvironment* gEnv;
-
-class SupplicantHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+class SupplicantHidlTest : public SupplicantHidlTestBase {
public:
- virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- supplicant_ = getSupplicant_1_1();
- ASSERT_NE(supplicant_.get(), nullptr);
- }
-
- virtual void TearDown() override { stopSupplicant(); }
+ virtual void SetUp() override { SupplicantHidlTestBase::SetUp(); }
protected:
- // ISupplicant object used for all tests in this fixture.
- sp<ISupplicant> supplicant_;
-
std::string getWlan0IfaceName() {
std::array<char, PROPERTY_VALUE_MAX> buffer;
property_get("wifi.interface", buffer.data(), "wlan0");
@@ -65,7 +56,7 @@
/*
* AddStaInterface
*/
-TEST_F(SupplicantHidlTest, AddStaInterface) {
+TEST_P(SupplicantHidlTest, AddStaInterface) {
ISupplicant::IfaceInfo iface_info;
iface_info.name = getWlan0IfaceName();
iface_info.type = IfaceType::STA;
@@ -82,8 +73,8 @@
/*
* AddP2pInterface
*/
-TEST_F(SupplicantHidlTest, AddP2pInterface) {
- if (!gEnv->isP2pOn) return;
+TEST_P(SupplicantHidlTest, AddP2pInterface) {
+ if (isP2pOn_) return;
ISupplicant::IfaceInfo iface_info;
iface_info.name = getP2pIfaceName();
iface_info.type = IfaceType::P2P;
@@ -100,7 +91,7 @@
/*
* RemoveStaInterface
*/
-TEST_F(SupplicantHidlTest, RemoveStaInterface) {
+TEST_P(SupplicantHidlTest, RemoveStaInterface) {
ISupplicant::IfaceInfo iface_info;
iface_info.name = getWlan0IfaceName();
iface_info.type = IfaceType::STA;
@@ -122,8 +113,8 @@
/*
* RemoveP2pInterface
*/
-TEST_F(SupplicantHidlTest, RemoveP2pInterface) {
- if (!gEnv->isP2pOn) return;
+TEST_P(SupplicantHidlTest, RemoveP2pInterface) {
+ if (isP2pOn_) return;
ISupplicant::IfaceInfo iface_info;
iface_info.name = getP2pIfaceName();
iface_info.type = IfaceType::P2P;
@@ -146,6 +137,23 @@
* Terminate
* This terminates the service.
*/
-TEST_F(SupplicantHidlTest, Terminate) {
- supplicant_->terminate();
+TEST_P(SupplicantHidlTest, Terminate) { supplicant_->terminate(); }
+
+static std::vector<std::string> get_wifi_instances() {
+ std::vector<std::string> instances =
+ android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor);
+ // Also test when wifi instance is not set.
+ instances.push_back("");
+
+ return instances;
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantHidlTest,
+ testing::Combine(
+ testing::ValuesIn(get_wifi_instances()),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_1::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp
index 04a5ed9..b75a2fb 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include "supplicant_hidl_test_utils.h"
@@ -25,14 +24,19 @@
using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork;
using ::android::sp;
-sp<ISupplicant> getSupplicant_1_1() {
- return ISupplicant::castFrom(getSupplicant());
+sp<ISupplicant> getSupplicant_1_1(const std::string& supplicant_instance_name,
+ bool isP2pOn) {
+ return ISupplicant::castFrom(
+ getSupplicant(supplicant_instance_name, isP2pOn));
}
-sp<ISupplicantStaIface> getSupplicantStaIface_1_1() {
- return ISupplicantStaIface::castFrom(getSupplicantStaIface());
+sp<ISupplicantStaIface> getSupplicantStaIface_1_1(
+ const sp<ISupplicant>& supplicant) {
+ return ISupplicantStaIface::castFrom(getSupplicantStaIface(supplicant));
}
-sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_1() {
- return ISupplicantStaNetwork::castFrom(createSupplicantStaNetwork());
+sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_1(
+ const sp<ISupplicant>& supplicant) {
+ return ISupplicantStaNetwork::castFrom(
+ createSupplicantStaNetwork(supplicant));
}
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
index 1c13325..3629882 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
@@ -14,20 +14,52 @@
* limitations under the License.
*/
-#ifndef SUPPLICANT_HIDL_TEST_UTILS_1_1_H
-#define SUPPLICANT_HIDL_TEST_UTILS_1_1_H
+#pragma once
+#pragma clang diagnostic ignored "-Wweak-vtables"
+#include <VtsCoreUtil.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicant.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaIface.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaNetwork.h>
+#include <gtest/gtest.h>
android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>
- getSupplicant_1_1();
+getSupplicant_1_1(const std::string& supplicant_instance_name, bool isP2pOn);
android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface>
- getSupplicantStaIface_1_1();
+getSupplicantStaIface_1_1(
+ const android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>&
+ supplicant);
android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork>
- createSupplicantStaNetwork_1_1();
+createSupplicantStaNetwork_1_1(
+ const android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>&
+ supplicant);
-#endif /* SUPPLICANT_HIDL_TEST_UTILS_1_1_H */
+class SupplicantHidlTestBase
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ public:
+ virtual void SetUp() override {
+ wifi_v1_0_instance_name_ = std::get<0>(GetParam());
+ supplicant_v1_1_instance_name_ = std::get<1>(GetParam());
+ isP2pOn_ =
+ testing::deviceSupportsFeature("android.hardware.wifi.direct");
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+ supplicant_v1_1_instance_name_);
+ supplicant_ =
+ getSupplicant_1_1(supplicant_v1_1_instance_name_, isP2pOn_);
+ ASSERT_NE(supplicant_.get(), nullptr);
+ }
+
+ virtual void TearDown() override {
+ stopSupplicant(wifi_v1_0_instance_name_);
+ }
+
+ protected:
+ android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>
+ supplicant_;
+ bool isP2pOn_ = false;
+ std::string wifi_v1_0_instance_name_;
+ std::string supplicant_v1_1_instance_name_;
+};
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
index c5e6319..8a1aecc 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -16,9 +16,13 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
-
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaIface.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include "supplicant_hidl_test_utils.h"
#include "supplicant_hidl_test_utils_1_1.h"
@@ -29,26 +33,24 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface;
-using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIfaceCallback;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_1::ISupplicant;
+using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface;
+using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIfaceCallback;
-class SupplicantStaIfaceHidlTest
- : public ::testing::VtsHalHidlTargetTestBase {
- public:
- virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- EXPECT_TRUE(turnOnExcessiveLogging());
- sta_iface_ = getSupplicantStaIface_1_1();
- ASSERT_NE(sta_iface_.get(), nullptr);
- }
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
+ public:
+ virtual void SetUp() override {
+ SupplicantHidlTestBase::SetUp();
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ sta_iface_ = getSupplicantStaIface_1_1(supplicant_);
+ ASSERT_NE(sta_iface_.get(), nullptr);
+ }
- virtual void TearDown() override { stopSupplicant(); }
-
- protected:
- // ISupplicantStaIface object used for all tests in this fixture.
- sp<ISupplicantStaIface> sta_iface_;
+ protected:
+ // ISupplicantStaIface object used for all tests in this fixture.
+ sp<ISupplicantStaIface> sta_iface_;
};
class IfaceCallback : public ISupplicantStaIfaceCallback {
@@ -131,9 +133,19 @@
/*
* RegisterCallback_1_1
*/
-TEST_F(SupplicantStaIfaceHidlTest, RegisterCallback_1_1) {
- sta_iface_->registerCallback_1_1(
- new IfaceCallback(), [](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
- });
+TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_1) {
+ sta_iface_->registerCallback_1_1(
+ new IfaceCallback(), [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantStaIfaceHidlTest,
+ testing::Combine(
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor)),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_1::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
index fa52556..a4b7d40 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -16,8 +16,11 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaNetwork.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include "supplicant_hidl_test_utils.h"
#include "supplicant_hidl_test_utils_1_1.h"
@@ -26,27 +29,26 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_1::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork;
+
namespace {
constexpr uint8_t kTestIdentity[] = {0x45, 0x67, 0x98, 0x67, 0x56};
constexpr uint8_t kTestEncryptedIdentity[] = {0x35, 0x37, 0x58, 0x57, 0x26};
} // namespace
-class SupplicantStaNetworkHidlTest
- : public ::testing::VtsHalHidlTargetTestBase {
- public:
- virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- EXPECT_TRUE(turnOnExcessiveLogging());
- sta_network_ = createSupplicantStaNetwork_1_1();
- ASSERT_NE(sta_network_.get(), nullptr);
- }
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBase {
+ public:
+ virtual void SetUp() override {
+ SupplicantHidlTestBase::SetUp();
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ sta_network_ = createSupplicantStaNetwork_1_1(supplicant_);
+ ASSERT_NE(sta_network_.get(), nullptr);
+ }
- virtual void TearDown() override { stopSupplicant(); }
-
- protected:
- // ISupplicantStaNetwork object used for all tests in this fixture.
- sp<ISupplicantStaNetwork> sta_network_;
+ protected:
+ // ISupplicantStaNetwork object used for all tests in this fixture.
+ sp<ISupplicantStaNetwork> sta_network_;
};
/*
@@ -54,36 +56,49 @@
* Ensures that an instance of the ISupplicantStaNetwork proxy object is
* successfully created.
*/
-TEST(SupplicantStaNetworkHidlTestNoFixture, Create) {
- startSupplicantAndWaitForHidlService();
- EXPECT_NE(nullptr, createSupplicantStaNetwork_1_1().get());
- stopSupplicant();
+TEST_P(SupplicantStaNetworkHidlTest, Create) {
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+ supplicant_v1_1_instance_name_);
+ sp<ISupplicant> supplicant =
+ getSupplicant_1_1(supplicant_v1_1_instance_name_, isP2pOn_);
+ EXPECT_NE(nullptr, createSupplicantStaNetwork_1_1(supplicant).get());
}
/*
* Ensure that the encrypted imsi identity is set successfully.
*/
-TEST_F(SupplicantStaNetworkHidlTest, setEapEncryptedImsiIdentity) {
- std::vector<uint8_t> encrypted_identity(
- kTestEncryptedIdentity,
- kTestEncryptedIdentity + sizeof(kTestEncryptedIdentity));
- sta_network_->setEapEncryptedImsiIdentity(
- encrypted_identity, [](const SupplicantStatus &status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
- });
+TEST_P(SupplicantStaNetworkHidlTest, setEapEncryptedImsiIdentity) {
+ std::vector<uint8_t> encrypted_identity(
+ kTestEncryptedIdentity,
+ kTestEncryptedIdentity + sizeof(kTestEncryptedIdentity));
+ sta_network_->setEapEncryptedImsiIdentity(
+ encrypted_identity, [](const SupplicantStatus &status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
}
/*
* Ensure that the identity and the encrypted imsi identity are sent
* successfully.
*/
-TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapIdentityResponse_1_1) {
- sta_network_->sendNetworkEapIdentityResponse_1_1(
- std::vector<uint8_t>(kTestIdentity,
- kTestIdentity + sizeof(kTestIdentity)),
- std::vector<uint8_t>(kTestEncryptedIdentity,
- kTestIdentity + sizeof(kTestEncryptedIdentity)),
- [](const SupplicantStatus &status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
- });
+TEST_P(SupplicantStaNetworkHidlTest, SendNetworkEapIdentityResponse_1_1) {
+ sta_network_->sendNetworkEapIdentityResponse_1_1(
+ std::vector<uint8_t>(kTestIdentity,
+ kTestIdentity + sizeof(kTestIdentity)),
+ std::vector<uint8_t>(kTestEncryptedIdentity,
+ kTestIdentity + sizeof(kTestEncryptedIdentity)),
+ [](const SupplicantStatus &status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantStaNetworkHidlTest,
+ testing::Combine(
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor)),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_1::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
diff --git a/wifi/supplicant/1.2/vts/functional/Android.bp b/wifi/supplicant/1.2/vts/functional/Android.bp
index 7e9d4f6..9781074 100644
--- a/wifi/supplicant/1.2/vts/functional/Android.bp
+++ b/wifi/supplicant/1.2/vts/functional/Android.bp
@@ -19,7 +19,7 @@
defaults: ["VtsHalTargetTestDefaults"],
srcs: ["supplicant_hidl_test_utils_1_2.cpp"],
export_include_dirs: [
- "."
+ ".",
],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
@@ -58,7 +58,10 @@
"libwifi-system",
"libwifi-system-iface",
],
- test_suites: ["general-tests"],
+ test_suites: [
+ "general-tests",
+ "vts-core",
+ ],
}
cc_test {
@@ -82,5 +85,8 @@
"libwifi-system",
"libwifi-system-iface",
],
+ test_suites: [
+ "general-tests",
+ "vts-core",
+ ],
}
-
diff --git a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
index 267fa67..9dbeee1 100644
--- a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
+++ b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
@@ -14,47 +14,8 @@
* limitations under the License.
*/
-#include <android-base/logging.h>
-#include <android/hardware/wifi/1.1/IWifi.h>
-#include <android/hardware/wifi/supplicant/1.2/ISupplicant.h>
-
#include "supplicant_hidl_test_utils.h"
-#include "wifi_hidl_test_utils.h"
-class WifiSupplicantHidlEnvironment_1_2 : public WifiSupplicantHidlEnvironment {
- public:
- // get the test environment singleton
- static WifiSupplicantHidlEnvironment_1_2* Instance() {
- static WifiSupplicantHidlEnvironment_1_2* instance =
- new WifiSupplicantHidlEnvironment_1_2;
- return instance;
- }
- virtual void registerTestServices() override {
- registerTestService<::android::hardware::wifi::V1_0::IWifi>();
- registerTestService<::android::hardware::wifi::V1_1::IWifi>();
- registerTestService<
- ::android::hardware::wifi::supplicant::V1_0::ISupplicant>();
- registerTestService<
- ::android::hardware::wifi::supplicant::V1_1::ISupplicant>();
- registerTestService<
- ::android::hardware::wifi::supplicant::V1_2::ISupplicant>();
- }
-
- private:
- WifiSupplicantHidlEnvironment_1_2() {}
-};
-
-WifiSupplicantHidlEnvironment* gEnv =
- WifiSupplicantHidlEnvironment_1_2::Instance();
-
-int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(gEnv);
- ::testing::InitGoogleTest(&argc, argv);
- gEnv->init(&argc, argv);
- int status = gEnv->initFromOptions(argc, argv);
- if (status == 0) {
- int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
- }
- return status;
-}
+// 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/supplicant_hidl_test_utils_1_2.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp
index f270bff..480929a 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp
@@ -26,18 +26,24 @@
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork;
-sp<ISupplicant> getSupplicant_1_2() {
- return ISupplicant::castFrom(getSupplicant());
+sp<ISupplicant> getSupplicant_1_2(const std::string& supplicant_instance_name,
+ bool isP2pOn) {
+ return ISupplicant::castFrom(
+ getSupplicant(supplicant_instance_name, isP2pOn));
}
-sp<ISupplicantStaIface> getSupplicantStaIface_1_2() {
- return ISupplicantStaIface::castFrom(getSupplicantStaIface());
+sp<ISupplicantStaIface> getSupplicantStaIface_1_2(
+ const sp<ISupplicant>& supplicant) {
+ return ISupplicantStaIface::castFrom(getSupplicantStaIface(supplicant));
}
-sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_2() {
- return ISupplicantStaNetwork::castFrom(createSupplicantStaNetwork());
+sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_2(
+ const sp<ISupplicant>& supplicant) {
+ return ISupplicantStaNetwork::castFrom(
+ createSupplicantStaNetwork(supplicant));
}
-sp<ISupplicantP2pIface> getSupplicantP2pIface_1_2() {
- return ISupplicantP2pIface::castFrom(getSupplicantP2pIface());
+sp<ISupplicantP2pIface> getSupplicantP2pIface_1_2(
+ const sp<ISupplicant>& supplicant) {
+ return ISupplicantP2pIface::castFrom(getSupplicantP2pIface(supplicant));
}
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
index 8a7ccc5..5ecfdd4 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
@@ -14,24 +14,59 @@
* limitations under the License.
*/
-#ifndef SUPPLICANT_HIDL_TEST_UTILS_1_2_H
-#define SUPPLICANT_HIDL_TEST_UTILS_1_2_H
+#pragma once
+#pragma clang diagnostic ignored "-Wweak-vtables"
+#include <VtsCoreUtil.h>
#include <android/hardware/wifi/supplicant/1.2/ISupplicant.h>
#include <android/hardware/wifi/supplicant/1.2/ISupplicantP2pIface.h>
#include <android/hardware/wifi/supplicant/1.2/ISupplicantStaIface.h>
#include <android/hardware/wifi/supplicant/1.2/ISupplicantStaNetwork.h>
+#include <gtest/gtest.h>
android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>
-getSupplicant_1_2();
+getSupplicant_1_2(const std::string& supplicant_instance_name, bool isP2pOn);
android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantStaIface>
-getSupplicantStaIface_1_2();
+getSupplicantStaIface_1_2(
+ const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
+ supplicant);
android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork>
-createSupplicantStaNetwork_1_2();
+createSupplicantStaNetwork_1_2(
+ const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
+ supplicant);
android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface>
-getSupplicantP2pIface_1_2();
+getSupplicantP2pIface_1_2(
+ const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
+ supplicant);
-#endif /* SUPPLICANT_HIDL_TEST_UTILS_1_2_H */
+class SupplicantHidlTestBase
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ public:
+ virtual void SetUp() override {
+ wifi_v1_0_instance_name_ = std::get<0>(GetParam());
+ supplicant_v1_2_instance_name_ = std::get<1>(GetParam());
+ isP2pOn_ =
+ testing::deviceSupportsFeature("android.hardware.wifi.direct");
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+ supplicant_v1_2_instance_name_);
+ supplicant_ =
+ getSupplicant_1_2(supplicant_v1_2_instance_name_, isP2pOn_);
+ ASSERT_NE(supplicant_.get(), nullptr);
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ }
+
+ virtual void TearDown() override {
+ stopSupplicant(wifi_v1_0_instance_name_);
+ }
+
+ protected:
+ android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>
+ supplicant_;
+ bool isP2pOn_ = false;
+ std::string wifi_v1_0_instance_name_;
+ std::string supplicant_v1_2_instance_name_;
+};
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 1b78ac3..2b63ad0 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -18,7 +18,11 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/supplicant/1.2/ISupplicantP2pIface.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include "supplicant_hidl_test_utils.h"
#include "supplicant_hidl_test_utils_1_2.h"
@@ -26,6 +30,7 @@
using ::android::sp;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_2::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface;
namespace {
@@ -35,17 +40,15 @@
constexpr uint8_t kTestZeroMacAddr[] = {[0 ... 5] = 0x0};
} // namespace
-class SupplicantP2pIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBase {
public:
virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- EXPECT_TRUE(turnOnExcessiveLogging());
- p2p_iface_ = getSupplicantP2pIface_1_2();
+ SupplicantHidlTestBase::SetUp();
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ p2p_iface_ = getSupplicantP2pIface_1_2(supplicant_);
ASSERT_NE(p2p_iface_.get(), nullptr);
}
- virtual void TearDown() override { stopSupplicant(); }
-
protected:
// ISupplicantP2pIface object used for all tests in this fixture.
sp<ISupplicantP2pIface> p2p_iface_;
@@ -54,7 +57,7 @@
/*
* Verify that AddGroup_1_2 could create a group successfully.
*/
-TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_Success) {
+TEST_P(SupplicantP2pIfaceHidlTest, AddGroup_1_2_Success) {
std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
std::string passphrase = kTestPassphrase;
int freq = 0;
@@ -73,7 +76,7 @@
/*
* Verify that AddGroup_1_2 fails due to invalid SSID.
*/
-TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidSsid) {
+TEST_P(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidSsid) {
std::vector<uint8_t> ssid;
std::string passphrase = kTestPassphrase;
int freq = 0;
@@ -92,7 +95,7 @@
/*
* Verify that AddGroup_1_2 fails due to invalid passphrase.
*/
-TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidPassphrase) {
+TEST_P(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidPassphrase) {
std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
std::string passphrase = "1234";
int freq = 0;
@@ -111,7 +114,7 @@
/*
* Verify that AddGroup_1_2 fails due to invalid frequency.
*/
-TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidFrequency) {
+TEST_P(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidFrequency) {
std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
std::string passphrase = kTestPassphrase;
int freq = 9999;
@@ -134,7 +137,7 @@
/*
* Verify that setMacRandomization successes.
*/
-TEST_F(SupplicantP2pIfaceHidlTest, EnableMacRandomization) {
+TEST_P(SupplicantP2pIfaceHidlTest, EnableMacRandomization) {
p2p_iface_->setMacRandomization(true, [](const SupplicantStatus& status) {
if (!isMacRandomizationSupported(status)) return;
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -157,3 +160,13 @@
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantP2pIfaceHidlTest,
+ testing::Combine(
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor)),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_2::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 6272d30..8116c3f 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-#include <VtsHalHidlTargetTestBase.h>
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.h>
#include <android/hardware/wifi/supplicant/1.0/types.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaIfaceCallback.h>
@@ -24,7 +25,9 @@
#include <android/hardware/wifi/supplicant/1.2/types.h>
#include <android/hardware/wifi/supplicant/1.3/ISupplicantStaIface.h>
#include <android/hardware/wifi/supplicant/1.3/types.h>
+#include <hidl/GtestPrinter.h>
#include <hidl/HidlSupport.h>
+#include <hidl/ServiceManagement.h>
#include <hidl/Status.h>
#include "supplicant_hidl_test_utils.h"
@@ -42,6 +45,7 @@
using ::android::hardware::wifi::supplicant::V1_2::DppFailureCode;
using ::android::hardware::wifi::supplicant::V1_2::DppNetRole;
using ::android::hardware::wifi::supplicant::V1_2::DppProgressCode;
+using ::android::hardware::wifi::supplicant::V1_2::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaIfaceCallback;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork;
@@ -49,18 +53,16 @@
#define TIMEOUT_PERIOD 60
class IfaceDppCallback;
-class SupplicantStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
public:
virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- EXPECT_TRUE(turnOnExcessiveLogging());
- sta_iface_ = getSupplicantStaIface_1_2();
+ SupplicantHidlTestBase::SetUp();
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ sta_iface_ = getSupplicantStaIface_1_2(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
count_ = 0;
}
- virtual void TearDown() override { stopSupplicant(); }
-
enum DppCallbackType {
ANY_CALLBACK = -2,
INVALID = -1,
@@ -101,6 +103,7 @@
protected:
// ISupplicantStaIface object used for all tests in this fixture.
sp<ISupplicantStaIface> sta_iface_;
+
bool isDppSupported() {
uint32_t keyMgmtMask = 0;
@@ -254,7 +257,7 @@
/*
* RegisterCallback_1_2
*/
-TEST_F(SupplicantStaIfaceHidlTest, RegisterCallback_1_2) {
+TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_2) {
sta_iface_->registerCallback_1_2(
new IfaceCallback(), [](const SupplicantStatus& status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -264,7 +267,7 @@
/*
* GetKeyMgmtCapabilities
*/
-TEST_F(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
+TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities) {
sta_iface_->getKeyMgmtCapabilities(
[&](const SupplicantStatus& status, uint32_t keyMgmtMask) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -280,7 +283,7 @@
/*
* AddDppPeerUriAndRomveUri
*/
-TEST_F(SupplicantStaIfaceHidlTest, AddDppPeerUriAndRomveUri) {
+TEST_P(SupplicantStaIfaceHidlTest, AddDppPeerUriAndRomveUri) {
// We need to first get the key management capabilities from the device.
// If DPP is not supported, we just pass the test.
if (!isDppSupported()) {
@@ -312,7 +315,7 @@
/*
* StartDppEnrolleeInitiator
*/
-TEST_F(SupplicantStaIfaceHidlTest, StartDppEnrolleeInitiator) {
+TEST_P(SupplicantStaIfaceHidlTest, StartDppEnrolleeInitiator) {
// We need to first get the key management capabilities from the device.
// If DPP is not supported, we just pass the test.
if (!isDppSupported()) {
@@ -376,7 +379,7 @@
/*
* StartDppConfiguratorInitiator
*/
-TEST_F(SupplicantStaIfaceHidlTest, StartDppConfiguratorInitiator) {
+TEST_P(SupplicantStaIfaceHidlTest, StartDppConfiguratorInitiator) {
// We need to first get the key management capabilities from the device.
// If DPP is not supported, we just pass the test.
if (!isDppSupported()) {
@@ -443,3 +446,13 @@
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantStaIfaceHidlTest,
+ testing::Combine(
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor)),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_2::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
index ed421d7..4c3d808 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -16,8 +16,12 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
#include <android/hardware/wifi/supplicant/1.1/ISupplicantStaNetwork.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include "supplicant_hidl_test_utils.h"
#include "supplicant_hidl_test_utils_1_2.h"
@@ -26,24 +30,21 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_2::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork;
// namespace {
// constexpr uint8_t kTestIdentity[] = {0x45, 0x67, 0x98, 0x67, 0x56};
// constexpr uint8_t kTestEncryptedIdentity[] = {0x35, 0x37, 0x58, 0x57, 0x26};
//} // namespace
-class SupplicantStaNetworkHidlTest
- : public ::testing::VtsHalHidlTargetTestBase {
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBase {
public:
virtual void SetUp() override {
- startSupplicantAndWaitForHidlService();
- EXPECT_TRUE(turnOnExcessiveLogging());
- sta_network_ = createSupplicantStaNetwork_1_2();
+ SupplicantHidlTestBase::SetUp();
+ sta_network_ = createSupplicantStaNetwork_1_2(supplicant_);
ASSERT_NE(sta_network_.get(), nullptr);
}
- virtual void TearDown() override { stopSupplicant(); }
-
protected:
// ISupplicantStaNetwork object used for all tests in this fixture.
sp<ISupplicantStaNetwork> sta_network_;
@@ -52,7 +53,7 @@
/*
* SetGetSaePassword
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetSaePassword) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetSaePassword) {
std::string password = "topsecret";
sta_network_->setSaePassword(password, [](const SupplicantStatus &status) {
@@ -69,7 +70,7 @@
/*
* SetGetSaePasswordId
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetSaePasswordId) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetSaePasswordId) {
std::string passwordId = "id1";
sta_network_->setSaePasswordId(
@@ -87,7 +88,7 @@
/*
* SetGetGroupMgmtCipher
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetGroupMgmtCipher) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetGroupMgmtCipher) {
uint32_t groupMgmtCipher =
(uint32_t)ISupplicantStaNetwork::GroupMgmtCipherMask::BIP_GMAC_256;
@@ -107,7 +108,7 @@
/*
* SetGetKeyMgmt_1_2
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_2) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_2) {
uint32_t keyMgmt = (uint32_t)ISupplicantStaNetwork::KeyMgmtMask::SAE;
sta_network_->setKeyMgmt_1_2(keyMgmt, [](const SupplicantStatus &status) {
@@ -124,7 +125,7 @@
/*
* SetGetGroupCipher_1_2
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetGroupCipher_1_2) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetGroupCipher_1_2) {
uint32_t groupCipher =
(uint32_t)ISupplicantStaNetwork::GroupCipherMask::GCMP_256;
@@ -144,7 +145,7 @@
/*
* SetGetPairwiseCipher_1_2
*/
-TEST_F(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher_1_2) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher_1_2) {
uint32_t pairwiseCipher =
(uint32_t)ISupplicantStaNetwork::PairwiseCipherMask::GCMP_256;
@@ -164,7 +165,7 @@
/*
* EnableSuiteBEapOpenSslCiphers
*/
-TEST_F(SupplicantStaNetworkHidlTest, EnableSuiteBEapOpenSslCiphers) {
+TEST_P(SupplicantStaNetworkHidlTest, EnableSuiteBEapOpenSslCiphers) {
sta_network_->enableSuiteBEapOpenSslCiphers(
[](const SupplicantStatus &status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -179,7 +180,7 @@
/*
* EnableTlsSuiteBEapPhase1Param
*/
-TEST_F(SupplicantStaNetworkHidlTest, EnableTlsSuiteBEapPhase1Param) {
+TEST_P(SupplicantStaNetworkHidlTest, EnableTlsSuiteBEapPhase1Param) {
sta_network_->enableTlsSuiteBEapPhase1Param(
true, [](const SupplicantStatus &status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -190,3 +191,13 @@
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
+
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, SupplicantStaNetworkHidlTest,
+ testing::Combine(
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::V1_0::IWifi::descriptor)),
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ android::hardware::wifi::supplicant::V1_2::ISupplicant::
+ descriptor))),
+ android::hardware::PrintInstanceTupleNameToString<>);