Merge "[composer] Add createCommandWriter to command engine."
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 bab1ff5..0fec290 100644
--- a/current.txt
+++ b/current.txt
@@ -648,22 +648,28 @@
9e59fffceed0dd72a9799e04505db5f777bbbea1af0695ba4107ef6d967c6fda android.hardware.neuralnetworks@1.3::IDevice
258825966435b3ed08832055bb736d81516013e405f161d9ccde9a90cfcdde83 android.hardware.neuralnetworks@1.3::IPreparedModel
94e803236398bed1febb11cc21051bc42ec003700139b099d6c479e02a7ca3c3 android.hardware.neuralnetworks@1.3::IPreparedModelCallback
-35668befe89fc7f84d58fc1dab7dd3e4d6067c7eeccbae154fe36cd964dfaef7 android.hardware.neuralnetworks@1.3::types
+f3c1e7298da628a755b452cd3325e8d0fe867a2debb873069baab6a27434a72d android.hardware.neuralnetworks@1.3::types
3e01d4446cd69fd1c48f8572efd97487bc179564b32bd795800b97bbe10be37b android.hardware.wifi@1.4::IWifi
-7d136c169b62abdee0bb6abafb97638acd792ce2102dfccddaa5df98d4bd3df9 android.hardware.wifi.hostapd@1.2::IHostapd
+42e72d7c8fd843d2611ffb9142bfae61dcdb5325860c6602825863f086a91bff android.hardware.wifi.hostapd@1.2::IHostapd
11f6448d15336361180391c8ebcdfd2d7cf77b3782d577e594d583aadc9c2877 android.hardware.wifi.hostapd@1.2::types
a64467bae843569f0d465c5be7f0c7a5b987985b55a3ef4794dd5afc68538650 android.hardware.wifi.supplicant@1.3::ISupplicant
c72cb37b3f66ef65aeb5c6438a3fbe17bbe847fdf62d1a76eafd7f3a8a526105 android.hardware.wifi.supplicant@1.3::ISupplicantStaIface
342a8e12db4dca643f2755eb4167e8f103d96502053a25a1f51f42107a4530f1 android.hardware.wifi.supplicant@1.3::ISupplicantStaIfaceCallback
8835e9799cddf7c239f60beff467cbdf164331f70a8b6c06ed78982d7810d835 android.hardware.wifi.supplicant@1.3::ISupplicantStaNetwork
91015479f5a0fba9872e98d3cca4680995de64f42ae71461b4b7e5acc5a196ab android.hardware.wifi.supplicant@1.3::types
-d9044563a5ac5a17a239303b8dec1e51167761ac46e965f61e31654cc034d31b android.hardware.radio@1.5::types
-afa2d6cf4c0ba4b8482d5bcc097594ad5bc49be0bf3003034f75955cdaf66045 android.hardware.radio@1.5::IRadio
+##
+# 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
-f4888f9676890b43a459c6380f335fea7a6ad32ed3bafafeb018a88d6c0be8a4 android.hardware.radio@1.5::IRadioResponse
+ef10e15cdbe8ba63925302a95962d5679bbda6a4351400cc23e1589ca0e9f94b android.hardware.radio@1.5::IRadioResponse
55f0a15642869ec98a55ea0a5ac049d3e1a6245ff7750deb6bcb7182057eee83 android.hardware.radio.config@1.3::types
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/drm/1.0/default/CryptoPlugin.cpp b/drm/1.0/default/CryptoPlugin.cpp
index 8ddc380..2db3607 100644
--- a/drm/1.0/default/CryptoPlugin.cpp
+++ b/drm/1.0/default/CryptoPlugin.cpp
@@ -152,6 +152,7 @@
return Void();
}
+ base = static_cast<uint8_t *>(static_cast<void *>(destBase->getPointer()));
destPtr = static_cast<void *>(base + destination.nonsecureMemory.offset);
} else if (destination.type == BufferType::NATIVE_HANDLE) {
if (!secure) {
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 b70bd1b..62c5833 100644
--- a/neuralnetworks/1.3/types.hal
+++ b/neuralnetworks/1.3/types.hal
@@ -4747,6 +4747,135 @@
RESIZE_NEAREST_NEIGHBOR = @1.2::OperationType:RESIZE_NEAREST_NEIGHBOR,
/**
+ * Quantized version of {@link OperationType::LSTM}.
+ *
+ * The input and the output use asymmetric quantized types, while the rest
+ * use symmetric ones.
+ *
+ * Inputs:
+ * * 0: The input to the LSTM cell.
+ * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}
+ * Shape: [batchSize, inputSize]
+ * * 1: The input-to-input weights. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, inputSize]
+ * * 2: The input-to-forget weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, inputSize]
+ * * 3: The input-to-cell weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, inputSize]
+ * * 4: The input-to-output weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, inputSize]
+ * * 5: The recurrent-to-input weights. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, outputSize]
+ * * 6: The recurrent-to-forget weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, outputSize]
+ * * 7: The recurrent-to-cell weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, outputSize]
+ * * 8: The recurrent-to-output weights.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [numUnits, outputSize]
+ * * 9: The cell-to-input weights (for peephole). Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 10: The cell-to-forget weights (for peephole). Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 11: The cell-to-output weights (for peephole). Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 12: The input gate bias. Quantized with scale being the
+ * product of input and weights scales and zeroPoint equal to 0.
+ * Optional.
+ * Type: {@link OperandType::TENSOR_INT32}
+ * Shape: [numUnits]
+ * * 13: The forget gate bias. Quantized with scale being the
+ * product of input and weights scales and zeroPoint equal to 0.
+ * Type: {@link OperandType::TENSOR_INT32}
+ * Shape: [numUnits]
+ * * 14: The cell bias. Quantized with scale being the
+ * product of input and weights scales and zeroPoint equal to 0.
+ * Type: {@link OperandType::TENSOR_INT32}
+ * Shape: [numUnits]
+ * * 15: The output gate bias. Quantized with scale being the
+ * product of input and weights scales and zeroPoint equal to 0.
+ * Type: {@link OperandType::TENSOR_INT32}
+ * Shape: [numUnits]
+ * * 16: The projection weights. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT8_SYMM}
+ * Shape: [outputSize, numUnits]
+ * * 17: The projection bias. Quantized with scale being the
+ * product of input and weights scales and zeroPoint equal to 0.
+ * Optional.
+ * Type: {@link OperandType::TENSOR_INT32}
+ * Shape: [outputSize]
+ * * 18: The output from the previous time step.
+ * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}
+ * Shape: [batchSize, outputSize]
+ * * 19: The cell state from the previous time step.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [batchSize, numUnits]
+ * * 20: The input layer normalization weights. Used to rescale
+ * normalized inputs to activation at input gate. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 21: The forget layer normalization weights. Used to
+ * rescale normalized inputs to activation at forget gate. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 22: The cell layer normalization weights. Used to rescale
+ * normalized inputs to activation at cell gate. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 23: The output layer normalization weights. Used to
+ * rescale normalized inputs to activation at output gate. Optional.
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [numUnits]
+ * * 24: The cell clip. If provided the cell state is clipped
+ * by this value prior to the cell output activation. Optional.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 25: The projection clip. If provided and projection is enabled,
+ * this is used for clipping the projected values. Optional.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 26: The scale of the intermediate result of matmul,
+ * i.e. input to layer normalization, at input gate.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 27: The scale of the intermediate result of matmul,
+ * i.e. input to layer normalization, at forget gate.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 28: The scale of the intermediate result of matmul,
+ * i.e. input to layer normalization, at cell gate.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 29: The scale of the intermediate result of matmul,
+ * i.e. input to layer normalization, at output gate.
+ * Type: {@link OperandType::FLOAT32}.
+ * * 30: The zero point of the hidden state, i.e. input to
+ * projection.
+ * Type: {@link OperandType::INT32}.
+ * * 31: The scale of the hidden state, i.e. input to
+ * projection.
+ * Type: {@link OperandType::FLOAT32}.
+ *
+ * Outputs:
+ * * 0: The output state (out).
+ * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}
+ * Shape: [batchSize, outputSize]
+ * * 1: The cell state (out).
+ * Type: {@link OperandType::TENSOR_QUANT16_SYMM}
+ * Shape: [batchSize, numUnits]
+ * * 2: The output. This is effectively the same as the current
+ * "output state (out)" value.
+ * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}
+ * Shape: [batchSize, outputSize]
+ */
+ QUANTIZED_LSTM = 95,
+
+ /**
* DEPRECATED. Since NNAPI 1.2, extensions are the preferred alternative to
* OEM operation and data types.
*
@@ -4768,7 +4897,7 @@
enum OperationTypeRange : uint32_t {
BASE_MIN = 0,
FUNDAMENTAL_MIN = 0,
- FUNDAMENTAL_MAX = 94,
+ FUNDAMENTAL_MAX = 95,
OEM_MIN = 10000,
OEM_MAX = 10000,
BASE_MAX = 0xFFFF,
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/neuralnetworks/1.3/vts/functional/ValidateModel.cpp b/neuralnetworks/1.3/vts/functional/ValidateModel.cpp
index 14ab897..8395111 100644
--- a/neuralnetworks/1.3/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.3/vts/functional/ValidateModel.cpp
@@ -27,7 +27,6 @@
using V1_0::ErrorStatus;
using V1_0::OperandLifeTime;
using V1_1::ExecutionPreference;
-using V1_2::OperationTypeRange;
using V1_2::SymmPerChannelQuantParams;
using HidlToken =
hidl_array<uint8_t, static_cast<uint32_t>(V1_2::Constant::BYTE_SIZE_OF_CACHE_TOKEN)>;
diff --git a/radio/1.5/IRadio.hal b/radio/1.5/IRadio.hal
index fafc6e2..d0c5b0d 100644
--- a/radio/1.5/IRadio.hal
+++ b/radio/1.5/IRadio.hal
@@ -21,6 +21,7 @@
import @1.4::DataProfileInfo;
import @1.5::AccessNetwork;
import @1.5::DataProfileInfo;
+import @1.5::IndicationFilter;
import @1.5::LinkAddress;
import @1.5::NetworkScanRequest;
import @1.5::RadioAccessSpecifier;
@@ -219,4 +220,19 @@
*/
oneway setRadioPower_1_5(int32_t serial, bool powerOn, bool forEmergencyCall,
bool preferredForEmergencyCall);
+
+ /**
+ * Sets the indication filter.
+ *
+ * Prevents the reporting of specified unsolicited indications from the radio. This is used
+ * for power saving in instances when those indications are not needed. If unset, defaults to
+ * @1.2::IndicationFilter:ALL.
+ *
+ * @param serial Serial number of request.
+ * @param indicationFilter 32-bit bitmap of IndicationFilter. Bits set to 1 indicate the
+ * indications are enabled. See @1.5::IndicationFilter for the definition of each bit.
+ *
+ * Response callback is IRadioResponse.setIndicationFilterResponse()
+ */
+ oneway setIndicationFilter_1_5(int32_t serial, bitfield<IndicationFilter> indicationFilter);
};
diff --git a/radio/1.5/IRadioResponse.hal b/radio/1.5/IRadioResponse.hal
index 968948b..f1b7e71 100644
--- a/radio/1.5/IRadioResponse.hal
+++ b/radio/1.5/IRadioResponse.hal
@@ -145,4 +145,16 @@
* RadioError:INVALID_ARGUMENTS
*/
oneway setRadioPowerResponse_1_5(RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:SYSTEM_ERR
+ */
+ oneway setIndicationFilterResponse_1_5(RadioResponseInfo info);
};
diff --git a/radio/1.5/types.hal b/radio/1.5/types.hal
index 7d6ec41..12c27d0 100644
--- a/radio/1.5/types.hal
+++ b/radio/1.5/types.hal
@@ -27,6 +27,7 @@
import @1.2::CellIdentityWcdma;
import @1.2::CellIdentityTdscdma;
import @1.2::CellIdentityLte;
+import @1.2::IndicationFilter;
import @1.2::NetworkScanRequest;
import @1.4::AccessNetwork;
import @1.4::ApnTypes;
@@ -424,3 +425,8 @@
CellIdentityLte lte;
CellIdentityNr nr;
};
+
+enum IndicationFilter : @1.2::IndicationFilter {
+ /** Control the unsolicited sending of registration failure reports via onRegistrationFailed */
+ REGISTRATION_FAILURE = 1 << 5,
+};
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
index 49a315d..c3c9f54 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
+++ b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
@@ -551,6 +551,8 @@
Return<void> setDataProfileResponse_1_5(const RadioResponseInfo& info);
Return<void> setRadioPowerResponse_1_5(const RadioResponseInfo& info);
+
+ Return<void> setIndicationFilterResponse_1_5(const RadioResponseInfo& info);
};
/* Callback class for radio indication */
diff --git a/radio/1.5/vts/functional/radio_response.cpp b/radio/1.5/vts/functional/radio_response.cpp
index a0b3d5f..877945f 100644
--- a/radio/1.5/vts/functional/radio_response.cpp
+++ b/radio/1.5/vts/functional/radio_response.cpp
@@ -953,4 +953,10 @@
rspInfo = info;
parent_v1_5.notify(info.serial);
return Void();
-}
\ No newline at end of file
+}
+
+Return<void> RadioResponse_v1_5::setIndicationFilterResponse_1_5(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_v1_5.notify(info.serial);
+ return Void();
+}
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/hostapd/1.2/IHostapd.hal b/wifi/hostapd/1.2/IHostapd.hal
index b25ea97..5126d12 100644
--- a/wifi/hostapd/1.2/IHostapd.hal
+++ b/wifi/hostapd/1.2/IHostapd.hal
@@ -16,6 +16,7 @@
package android.hardware.wifi.hostapd@1.2;
+import @1.0::IHostapd.EncryptionType;
import @1.0::IHostapd.NetworkParams;
import @1.1::IHostapd;
import HostapdStatus;
@@ -27,6 +28,12 @@
* Top-level object for managing SoftAPs.
*/
interface IHostapd extends @1.1::IHostapd {
+ /** Possible Security types. */
+ enum EncryptionType : @1.0::IHostapd.EncryptionType {
+ WPA3_SAE_TRANSITION,
+ WPA3_SAE,
+ };
+
/**
* Band bitmMask to use for the SoftAp operations.
* A combinatoin of these bits are used to identify the allowed bands
@@ -57,6 +64,7 @@
* used with HE.
*/
bool enable80211AX;
+
/**
* Whether 6GHz band enabled or not on softAp.
* Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is
@@ -96,6 +104,21 @@
};
/**
+ * Parameters to specify the channel frequency range for ACS.
+ */
+ struct AcsFrequencyRange {
+ /**
+ * Channel Frequency (in MHz) at the start of the range.
+ */
+ uint32_t start;
+
+ /**
+ * Channel Frequency (in MHz) at the end of the range.
+ */
+ uint32_t end;
+ };
+
+ /**
* Parameters to control the channel selection for the interface.
*/
struct ChannelParams {
@@ -103,6 +126,15 @@
* Band to use for the SoftAp operations.
*/
bitfield<BandMask> bandMask;
+
+ /**
+ * This option can be used to specify the channel frequencies (in MHz) selected by ACS.
+ * If this is an empty list, all channels allowed in selected HW mode
+ * are specified implicitly.
+ * Note: channels may be overridden by firmware.
+ * Note: this option is ignored if ACS is disabled.
+ */
+ vec<AcsFrequencyRange> acsChannelFreqRangesMhz;
};
/**
@@ -113,13 +145,37 @@
* Baseline information as defined in HAL 1.1.
*/
@1.1::IHostapd.IfaceParams V1_1;
- /** Additional Hw mode params for the interface */
+
+ /**
+ * Additional Hw mode params for the interface
+ */
HwModeParams hwModeParams;
- /** Additional Channel params for the interface */
+
+ /**
+ * Additional Channel params for the interface
+ */
ChannelParams channelParams;
};
/**
+ * Parameters to use for setting up the access point network.
+ */
+ struct NetworkParams {
+ /**
+ * Baseline information as defined in HAL 1.0.
+ */
+ @1.0::IHostapd.NetworkParams V1_0;
+ /** Key management mask for the replace V1_0.encryptionType. */
+ EncryptionType encryptionType;
+ /**
+ * Passphrase for WPA3_SAE network, WPA3_SAE_TRANSITION and
+ * WPA2_PSK. Replaces @1.0::IHostapd.NetworkParams.pskPassphrase.
+ */
+ string passphrase;
+ };
+
+
+ /**
* Adds a new access point for hostapd to control.
*
* This should trigger the setup of an access point with the specified
@@ -135,7 +191,7 @@
* |HostapdStatusCode.FAILURE_IFACE_EXISTS|
*/
addAccessPoint_1_2(IfaceParams ifaceParams, NetworkParams nwParams)
- generates(HostapdStatus status);
+ generates (HostapdStatus status);
/**
* force one of the hotspot clients disconnect..
diff --git a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
index 8245f8f..9f57934 100644
--- a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
@@ -41,6 +41,9 @@
constexpr unsigned char kNwSsid[] = {'t', 'e', 's', 't', '1',
'2', '3', '4', '5'};
constexpr char kNwPassphrase[] = "test12345";
+constexpr char kInvalidMaxPskNwPassphrase[] =
+ "0123456789012345678901234567890123456789012345678901234567890123456789";
+constexpr char kInvalidMinPskNwPassphrase[] = "test";
constexpr int kIfaceChannel = 6;
constexpr int kIfaceInvalidChannel = 567;
constexpr uint8_t kTestZeroMacAddr[] = {[0 ... 5] = 0x0};
@@ -61,7 +64,7 @@
ASSERT_NE(hostapd_.get(), nullptr);
}
- virtual void TearDown() override { stopHostapd(wifi_instance_name_); }
+ virtual void TearDown() override { stopHostapd(hostapd_instance_name_); }
protected:
std::string getPrimaryWlanIfaceName() {
@@ -109,57 +112,83 @@
return iface_params_1_2;
}
- IHostapd::IfaceParams getIfaceParamsWithAcsAndChannelRange() {
+ IHostapd::IfaceParams getIfaceParamsWithAcsAndFreqRange() {
IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithAcs();
- ::android::hardware::wifi::hostapd::V1_1::IHostapd::ChannelParams
- channelParams;
- ::android::hardware::wifi::hostapd::V1_1::IHostapd::AcsChannelRange
- acsChannelRange;
- acsChannelRange.start = 1;
- acsChannelRange.end = 11;
- std::vector<
- ::android::hardware::wifi::hostapd::V1_1::IHostapd::AcsChannelRange>
- vec_acsChannelRange;
- vec_acsChannelRange.push_back(acsChannelRange);
- channelParams.acsChannelRanges = vec_acsChannelRange;
- iface_params_1_2.V1_1.channelParams = channelParams;
+ ::android::hardware::wifi::hostapd::V1_2::IHostapd::AcsFrequencyRange
+ acsFrequencyRange;
+ acsFrequencyRange.start = 2412;
+ acsFrequencyRange.end = 2462;
+ std::vector<::android::hardware::wifi::hostapd::V1_2::IHostapd::
+ AcsFrequencyRange>
+ vec_acsFrequencyRange;
+ vec_acsFrequencyRange.push_back(acsFrequencyRange);
+ iface_params_1_2.channelParams.acsChannelFreqRangesMhz =
+ vec_acsFrequencyRange;
return iface_params_1_2;
}
- IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidChannelRange() {
+ IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidFreqRange() {
IHostapd::IfaceParams iface_params_1_2 =
- getIfaceParamsWithAcsAndChannelRange();
- iface_params_1_2.V1_1.channelParams.acsChannelRanges[0].start = 222;
- iface_params_1_2.V1_1.channelParams.acsChannelRanges[0].end = 999;
+ getIfaceParamsWithAcsAndFreqRange();
+ iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].start = 222;
+ iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].end = 999;
return iface_params_1_2;
}
IHostapd::NetworkParams getOpenNwParams() {
- IHostapd::NetworkParams nw_params;
- nw_params.ssid =
+ IHostapd::NetworkParams nw_params_1_2;
+ ::android::hardware::wifi::hostapd::V1_0::IHostapd::NetworkParams
+ nw_params_1_0;
+ nw_params_1_0.ssid =
std::vector<uint8_t>(kNwSsid, kNwSsid + sizeof(kNwSsid));
- nw_params.isHidden = false;
- nw_params.encryptionType = IHostapd::EncryptionType::NONE;
- return nw_params;
+ nw_params_1_0.isHidden = false;
+ nw_params_1_2.V1_0 = nw_params_1_0;
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::NONE;
+ return nw_params_1_2;
}
IHostapd::NetworkParams getPskNwParams() {
- IHostapd::NetworkParams nw_params;
- nw_params.ssid =
- std::vector<uint8_t>(kNwSsid, kNwSsid + sizeof(kNwSsid));
- nw_params.isHidden = false;
- nw_params.encryptionType = IHostapd::EncryptionType::WPA2;
- nw_params.pskPassphrase = kNwPassphrase;
- return nw_params;
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::WPA2;
+ nw_params_1_2.passphrase = kNwPassphrase;
+ return nw_params_1_2;
}
IHostapd::NetworkParams getInvalidPskNwParams() {
- IHostapd::NetworkParams nw_params;
- nw_params.ssid =
- std::vector<uint8_t>(kNwSsid, kNwSsid + sizeof(kNwSsid));
- nw_params.isHidden = false;
- nw_params.encryptionType = IHostapd::EncryptionType::WPA2;
- return nw_params;
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::WPA2;
+ nw_params_1_2.passphrase = kInvalidMaxPskNwPassphrase;
+
+ return nw_params_1_2;
+ }
+
+ IHostapd::NetworkParams getSaeTransitionNwParams() {
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType =
+ IHostapd::EncryptionType::WPA3_SAE_TRANSITION;
+ nw_params_1_2.passphrase = kNwPassphrase;
+ return nw_params_1_2;
+ }
+
+ IHostapd::NetworkParams getInvalidSaeTransitionNwParams() {
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::WPA2;
+ nw_params_1_2.passphrase = kInvalidMinPskNwPassphrase;
+ return nw_params_1_2;
+ }
+
+ IHostapd::NetworkParams getSaeNwParams() {
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::WPA3_SAE;
+ nw_params_1_2.passphrase = kNwPassphrase;
+ return nw_params_1_2;
+ }
+
+ IHostapd::NetworkParams getInvalidSaeNwParams() {
+ IHostapd::NetworkParams nw_params_1_2 = getOpenNwParams();
+ nw_params_1_2.encryptionType = IHostapd::EncryptionType::WPA3_SAE;
+ nw_params_1_2.passphrase = "";
+ return nw_params_1_2;
}
IHostapd::IfaceParams getIfaceParamsWithInvalidChannel() {
@@ -186,13 +215,13 @@
}
/**
- * Adds an access point with PSK network config, ACS enabled & channel Range.
+ * Adds an access point with PSK network config, ACS enabled & frequency Range.
* Access point creation should pass.
*/
-TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndChannelRange) {
+TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) {
auto status =
HIDL_INVOKE(hostapd_, addAccessPoint_1_2,
- getIfaceParamsWithAcsAndChannelRange(), getPskNwParams());
+ getIfaceParamsWithAcsAndFreqRange(), getPskNwParams());
// TODO: b/140172237, fix this in R
// EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
}
@@ -201,9 +230,9 @@
* Adds an access point with invalid channel range.
* Access point creation should fail.
*/
-TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidChannelRange) {
+TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) {
auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2,
- getIfaceParamsWithAcsAndInvalidChannelRange(),
+ getIfaceParamsWithAcsAndInvalidFreqRange(),
getPskNwParams());
// TODO: b/140172237, fix this in R
// EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
@@ -241,18 +270,40 @@
}
/**
+ * Adds an access point with SAE Transition network config & ACS disabled.
+ * Access point creation should pass.
+ */
+TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(),
+ getSaeTransitionNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+}
+
+/**
+ * Adds an access point with SAE network config & ACS disabled.
+ * Access point creation should pass.
+ */
+TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) {
+ auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2,
+ getIfaceParamsWithoutAcs(), getSaeNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+}
+
+/**
* Adds & then removes an access point with PSK network config & ACS enabled.
* Access point creation & removal should pass.
*/
TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2,
- getIfaceParamsWithAcs(), getPskNwParams());
+ auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2,
+ getIfaceParamsWithAcs(), getPskNwParams());
// TODO: b/140172237, fix this in R
/*
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
- status =
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code);
+ auto status =
HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(android::hardware::wifi::hostapd::V1_0::HostapdStatusCode::SUCCESS,
+ status.code);
*/
}
@@ -294,6 +345,28 @@
}
/**
+ * Adds an access point with invalid SAE transition network config.
+ * Access point creation should fail.
+ */
+TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(),
+ getInvalidSaeTransitionNwParams());
+ EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+}
+
+/**
+ * Adds an access point with invalid SAE network config.
+ * Access point creation should fail.
+ */
+TEST_P(HostapdHidlTest, AddInvalidSaeAccessPointWithoutAcs) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(),
+ getInvalidSaeNwParams());
+ EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+}
+
+/**
* forceClientDisconnect should return FAILURE_IFACE_UNKNOWN
* when hotspot interface doesn't init..
*/
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<>);