Merge "add audioCapabilities to SoundTrigger properties"
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 2931495..4ae4213 100644
--- a/current.txt
+++ b/current.txt
@@ -650,7 +650,7 @@
 94e803236398bed1febb11cc21051bc42ec003700139b099d6c479e02a7ca3c3 android.hardware.neuralnetworks@1.3::IPreparedModelCallback
 f3c1e7298da628a755b452cd3325e8d0fe867a2debb873069baab6a27434a72d android.hardware.neuralnetworks@1.3::types
 3e01d4446cd69fd1c48f8572efd97487bc179564b32bd795800b97bbe10be37b android.hardware.wifi@1.4::IWifi
-514dc8b810658c45d7b0d34132b708cee2658ecedd9c7efc57d0d666ef182484 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
diff --git a/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h b/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h
index 53b9202..b173e2e 100644
--- a/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h
+++ b/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h
@@ -39,8 +39,10 @@
 // TODO own a CommandReaderBase rather than subclassing
 class ComposerCommandEngine : protected CommandReaderBase {
    public:
-    ComposerCommandEngine(ComposerHal* hal, ComposerResources* resources)
-        : mHal(hal), mResources(resources) {}
+     ComposerCommandEngine(ComposerHal* hal, ComposerResources* resources)
+         : mHal(hal), mResources(resources) {
+         mWriter = createCommandWriter(kWriterInitialSize);
+     }
 
     virtual ~ComposerCommandEngine() = default;
 
@@ -74,16 +76,16 @@
             return Error::BAD_PARAMETER;
         }
 
-        return mWriter.writeQueue(outQueueChanged, outCommandLength, outCommandHandles)
-                   ? Error::NONE
-                   : Error::NO_RESOURCES;
+        return mWriter->writeQueue(outQueueChanged, outCommandLength, outCommandHandles)
+                       ? Error::NONE
+                       : Error::NO_RESOURCES;
     }
 
-    const MQDescriptorSync<uint32_t>* getOutputMQDescriptor() { return mWriter.getMQDescriptor(); }
+    const MQDescriptorSync<uint32_t>* getOutputMQDescriptor() { return mWriter->getMQDescriptor(); }
 
     void reset() {
         CommandReaderBase::reset();
-        mWriter.reset();
+        mWriter->reset();
     }
 
    protected:
@@ -140,13 +142,17 @@
         }
     }
 
+    virtual std::unique_ptr<CommandWriterBase> createCommandWriter(size_t writerInitialSize) {
+        return std::make_unique<CommandWriterBase>(writerInitialSize);
+    }
+
     bool executeSelectDisplay(uint16_t length) {
         if (length != CommandWriterBase::kSelectDisplayLength) {
             return false;
         }
 
         mCurrentDisplay = read64();
-        mWriter.selectDisplay(mCurrentDisplay);
+        mWriter->selectDisplay(mCurrentDisplay);
 
         return true;
     }
@@ -174,7 +180,7 @@
 
         auto err = mHal->setColorTransform(mCurrentDisplay, matrix, transform);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -208,7 +214,7 @@
             close(fence);
         }
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -239,7 +245,7 @@
             close(fence);
         }
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -260,10 +266,10 @@
                                          &displayRequestMask, &requestedLayers, &requestMasks);
         mResources->setDisplayMustValidateState(mCurrentDisplay, false);
         if (err == Error::NONE) {
-            mWriter.setChangedCompositionTypes(changedLayers, compositionTypes);
-            mWriter.setDisplayRequests(displayRequestMask, requestedLayers, requestMasks);
+            mWriter->setChangedCompositionTypes(changedLayers, compositionTypes);
+            mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks);
         } else {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -283,9 +289,9 @@
                            ? Error::NOT_VALIDATED
                            : mHal->presentDisplay(mCurrentDisplay, &presentFence, &layers, &fences);
             if (err == Error::NONE) {
-                mWriter.setPresentOrValidateResult(1);
-                mWriter.setPresentFence(presentFence);
-                mWriter.setReleaseFences(layers, fences);
+                mWriter->setPresentOrValidateResult(1);
+                mWriter->setPresentFence(presentFence);
+                mWriter->setReleaseFences(layers, fences);
                 return true;
             }
         }
@@ -301,11 +307,11 @@
                                          &displayRequestMask, &requestedLayers, &requestMasks);
         mResources->setDisplayMustValidateState(mCurrentDisplay, false);
         if (err == Error::NONE) {
-            mWriter.setPresentOrValidateResult(0);
-            mWriter.setChangedCompositionTypes(changedLayers, compositionTypes);
-            mWriter.setDisplayRequests(displayRequestMask, requestedLayers, requestMasks);
+            mWriter->setPresentOrValidateResult(0);
+            mWriter->setChangedCompositionTypes(changedLayers, compositionTypes);
+            mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks);
         } else {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -318,7 +324,7 @@
 
         auto err = mHal->acceptDisplayChanges(mCurrentDisplay);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -334,10 +340,10 @@
         std::vector<int> fences;
         auto err = mHal->presentDisplay(mCurrentDisplay, &presentFence, &layers, &fences);
         if (err == Error::NONE) {
-            mWriter.setPresentFence(presentFence);
-            mWriter.setReleaseFences(layers, fences);
+            mWriter->setPresentFence(presentFence);
+            mWriter->setReleaseFences(layers, fences);
         } else {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -351,7 +357,7 @@
         auto err = mHal->setLayerCursorPosition(mCurrentDisplay, mCurrentLayer, readSigned(),
                                                 readSigned());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -382,7 +388,7 @@
             close(fence);
         }
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -397,7 +403,7 @@
         auto damage = readRegion(length / 4);
         auto err = mHal->setLayerSurfaceDamage(mCurrentDisplay, mCurrentLayer, damage);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -410,7 +416,7 @@
 
         auto err = mHal->setLayerBlendMode(mCurrentDisplay, mCurrentLayer, readSigned());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -423,7 +429,7 @@
 
         auto err = mHal->setLayerColor(mCurrentDisplay, mCurrentLayer, readColor());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -436,7 +442,7 @@
 
         auto err = mHal->setLayerCompositionType(mCurrentDisplay, mCurrentLayer, readSigned());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -449,7 +455,7 @@
 
         auto err = mHal->setLayerDataspace(mCurrentDisplay, mCurrentLayer, readSigned());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -462,7 +468,7 @@
 
         auto err = mHal->setLayerDisplayFrame(mCurrentDisplay, mCurrentLayer, readRect());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -475,7 +481,7 @@
 
         auto err = mHal->setLayerPlaneAlpha(mCurrentDisplay, mCurrentLayer, readFloat());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -496,7 +502,7 @@
             err = mHal->setLayerSidebandStream(mCurrentDisplay, mCurrentLayer, stream);
         }
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -509,7 +515,7 @@
 
         auto err = mHal->setLayerSourceCrop(mCurrentDisplay, mCurrentLayer, readFRect());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -522,7 +528,7 @@
 
         auto err = mHal->setLayerTransform(mCurrentDisplay, mCurrentLayer, readSigned());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -537,7 +543,7 @@
         auto region = readRegion(length / 4);
         auto err = mHal->setLayerVisibleRegion(mCurrentDisplay, mCurrentLayer, region);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -550,7 +556,7 @@
 
         auto err = mHal->setLayerZOrder(mCurrentDisplay, mCurrentLayer, read());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -579,12 +585,12 @@
         };
     }
 
-    ComposerHal* mHal;
-    ComposerResources* mResources;
-
     // 64KiB minus a small space for metadata such as read/write pointers
     static constexpr size_t kWriterInitialSize = 64 * 1024 / sizeof(uint32_t) - 16;
-    CommandWriterBase mWriter{kWriterInitialSize};
+
+    ComposerHal* mHal;
+    ComposerResources* mResources;
+    std::unique_ptr<CommandWriterBase> mWriter;
 
     Display mCurrentDisplay = 0;
     Layer mCurrentLayer = 0;
diff --git a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
index d9f6226..8d70ba2 100644
--- a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
+++ b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
@@ -49,6 +49,11 @@
         }
     }
 
+    std::unique_ptr<V2_1::CommandWriterBase> createCommandWriter(
+            size_t writerInitialSize) override {
+        return std::make_unique<CommandWriterBase>(writerInitialSize);
+    }
+
     bool executeSetLayerPerFrameMetadata(uint16_t length) {
         // (key, value) pairs
         if (length % 2 != 0) {
@@ -65,7 +70,7 @@
 
         auto err = mHal->setLayerPerFrameMetadata(mCurrentDisplay, mCurrentLayer, metadata);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -78,7 +83,7 @@
 
         auto err = mHal->setLayerFloatColor(mCurrentDisplay, mCurrentLayer, readFloatColor());
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
index 329dbed..02f6212 100644
--- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
+++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
@@ -50,6 +50,11 @@
         }
     }
 
+    std::unique_ptr<V2_1::CommandWriterBase> createCommandWriter(
+            size_t writerInitialSize) override {
+        return std::make_unique<CommandWriterBase>(writerInitialSize);
+    }
+
     bool executeSetLayerColorTransform(uint16_t length) {
         if (length != CommandWriterBase::kSetLayerColorTransformLength) {
             return false;
@@ -61,7 +66,7 @@
         }
         auto err = mHal->setLayerColorTransform(mCurrentDisplay, mCurrentLayer, matrix);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
 
         return true;
@@ -97,7 +102,7 @@
         }
         auto err = mHal->setLayerPerFrameMetadataBlobs(mCurrentDisplay, mCurrentLayer, metadata);
         if (err != Error::NONE) {
-            mWriter.setError(getCommandLoc(), err);
+            mWriter->setError(getCommandLoc(), err);
         }
         return true;
     }
@@ -111,8 +116,8 @@
 
    private:
     using BaseType2_1 = V2_1::hal::ComposerCommandEngine;
-    using BaseType2_1::mWriter;
     using BaseType2_2 = V2_2::hal::ComposerCommandEngine;
+    using BaseType2_1::mWriter;
 
     ComposerHal* mHal;
 };
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 9e7684d..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;
     }
@@ -272,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/wifi/hostapd/1.2/IHostapd.hal b/wifi/hostapd/1.2/IHostapd.hal
index 5e6d80a..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
@@ -151,6 +158,24 @@
     };
 
     /**
+     * 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
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 94cbb42..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() {
@@ -133,31 +136,59 @@
     }
 
     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() {
@@ -239,6 +270,27 @@
 }
 
 /**
+ * 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.
  */
@@ -293,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.3/vts/functional/Android.bp b/wifi/supplicant/1.3/vts/functional/Android.bp
index abb8600..3dabe7c 100644
--- a/wifi/supplicant/1.3/vts/functional/Android.bp
+++ b/wifi/supplicant/1.3/vts/functional/Android.bp
@@ -19,7 +19,7 @@
     defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["supplicant_hidl_test_utils_1_3.cpp"],
     export_include_dirs: [
-        "."
+        ".",
     ],
     static_libs: [
         "VtsHalWifiV1_0TargetTestUtil",
@@ -61,5 +61,8 @@
         "libwifi-system",
         "libwifi-system-iface",
     ],
-    test_suites: ["general-tests"],
+    test_suites: [
+        "general-tests",
+        "vts-core",
+    ],
 }
diff --git a/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp b/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp
index 4dbb64e..9dbeee1 100644
--- a/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp
+++ b/wifi/supplicant/1.3/vts/functional/VtsHalWifiSupplicantV1_3TargetTest.cpp
@@ -14,49 +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.3/ISupplicant.h>
-
 #include "supplicant_hidl_test_utils.h"
-#include "wifi_hidl_test_utils.h"
 
-class WifiSupplicantHidlEnvironment_1_3 : public WifiSupplicantHidlEnvironment {
-   public:
-    // get the test environment singleton
-    static WifiSupplicantHidlEnvironment_1_3* Instance() {
-        static WifiSupplicantHidlEnvironment_1_3* instance =
-            new WifiSupplicantHidlEnvironment_1_3;
-        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>();
-        registerTestService<
-            ::android::hardware::wifi::supplicant::V1_3::ISupplicant>();
-    }
-
-   private:
-    WifiSupplicantHidlEnvironment_1_3() {}
-};
-
-WifiSupplicantHidlEnvironment* gEnv =
-    WifiSupplicantHidlEnvironment_1_3::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.3/vts/functional/supplicant_hidl_test_utils_1_3.cpp b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.cpp
index 308808d..7ea5462 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.cpp
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.cpp
@@ -21,13 +21,25 @@
 #include "supplicant_hidl_test_utils_1_3.h"
 
 using ::android::sp;
+using ::android::hardware::wifi::supplicant::V1_3::ISupplicant;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork;
 
-sp<ISupplicantStaIface> getSupplicantStaIface_1_3() {
-    return ISupplicantStaIface::castFrom(getSupplicantStaIface());
+sp<ISupplicantStaIface> getSupplicantStaIface_1_3(
+    const android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>&
+        supplicant) {
+    return ISupplicantStaIface::castFrom(getSupplicantStaIface(supplicant));
 }
 
-sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_3() {
-    return ISupplicantStaNetwork::castFrom(createSupplicantStaNetwork());
+sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_3(
+    const android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>&
+        supplicant) {
+    return ISupplicantStaNetwork::castFrom(
+        createSupplicantStaNetwork(supplicant));
+}
+
+sp<ISupplicant> getSupplicant_1_3(const std::string& supplicant_instance_name,
+                                  bool isP2pOn) {
+    return ISupplicant::castFrom(
+        getSupplicant(supplicant_instance_name, isP2pOn));
 }
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
index 39dbb8f..f8dca13 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
@@ -17,12 +17,18 @@
 #ifndef SUPPLICANT_HIDL_TEST_UTILS_1_3_H
 #define SUPPLICANT_HIDL_TEST_UTILS_1_3_H
 
+#include <android/hardware/wifi/supplicant/1.3/ISupplicant.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaIface.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaNetwork.h>
 
 android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface>
-getSupplicantStaIface_1_3();
+getSupplicantStaIface_1_3(
+    const android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>&
+        supplicant);
 android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork>
-createSupplicantStaNetwork_1_3();
-
+createSupplicantStaNetwork_1_3(
+    const android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>&
+        supplicant);
+android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>
+getSupplicant_1_3(const std::string& supplicant_instance_name, bool isP2pOn);
 #endif /* SUPPLICANT_HIDL_TEST_UTILS_1_3_H */
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
index adc955e..48b14f3 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -14,13 +14,19 @@
  * limitations under the License.
  */
 
-#include <VtsHalHidlTargetTestBase.h>
+#include <VtsCoreUtil.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
+#include <android/hardware/wifi/supplicant/1.1/ISupplicant.h>
 #include <android/hardware/wifi/supplicant/1.2/types.h>
+#include <android/hardware/wifi/supplicant/1.3/ISupplicant.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaIface.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaIfaceCallback.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaNetwork.h>
 #include <android/hardware/wifi/supplicant/1.3/types.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
 #include <hidl/HidlSupport.h>
+#include <hidl/ServiceManagement.h>
 #include <hidl/Status.h>
 
 #include "supplicant_hidl_test_utils.h"
@@ -40,6 +46,7 @@
 using ::android::hardware::wifi::supplicant::V1_2::DppProgressCode;
 using ::android::hardware::wifi::supplicant::V1_3::ConnectionCapabilities;
 using ::android::hardware::wifi::supplicant::V1_3::DppSuccessCode;
+using ::android::hardware::wifi::supplicant::V1_3::ISupplicant;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIfaceCallback;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork;
@@ -48,16 +55,27 @@
 #define TIMEOUT_PERIOD 60
 class IfaceDppCallback;
 
-class SupplicantStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+class SupplicantStaIfaceHidlTest
+    : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
    public:
     virtual void SetUp() override {
-        startSupplicantAndWaitForHidlService();
-        EXPECT_TRUE(turnOnExcessiveLogging());
-        sta_iface_ = getSupplicantStaIface_1_3();
+        wifi_v1_0_instance_name_ = std::get<0>(GetParam());
+        supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
+        isP2pOn_ =
+            testing::deviceSupportsFeature("android.hardware.wifi.direct");
+
+        startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+                                             supplicant_v1_3_instance_name_);
+        supplicant_ =
+            getSupplicant_1_3(supplicant_v1_3_instance_name_, isP2pOn_);
+        EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+        sta_iface_ = getSupplicantStaIface_1_3(supplicant_);
         ASSERT_NE(sta_iface_.get(), nullptr);
     }
 
-    virtual void TearDown() override { stopSupplicant(); }
+    virtual void TearDown() override {
+        stopSupplicant(wifi_v1_0_instance_name_);
+    }
 
     int64_t pmkCacheExpirationTimeInSec;
     std::vector<uint8_t> serializedPmkCacheEntry;
@@ -104,6 +122,11 @@
    protected:
     // ISupplicantStaIface object used for all tests in this fixture.
     sp<ISupplicantStaIface> sta_iface_;
+    sp<ISupplicant> supplicant_;
+    bool isP2pOn_ = false;
+    std::string wifi_v1_0_instance_name_;
+    std::string supplicant_v1_3_instance_name_;
+
     bool isDppSupported() {
         uint32_t keyMgmtMask = 0;
 
@@ -302,7 +325,7 @@
 /*
  * RegisterCallback_1_3
  */
-TEST_F(SupplicantStaIfaceHidlTest, RegisterCallback_1_3) {
+TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_3) {
     sta_iface_->registerCallback_1_3(
         new IfaceCallback(), [](const SupplicantStatus& status) {
             EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -312,7 +335,7 @@
 /*
  * getConnectionCapabilities
  */
-TEST_F(SupplicantStaIfaceHidlTest, GetConnectionCapabilities) {
+TEST_P(SupplicantStaIfaceHidlTest, GetConnectionCapabilities) {
     sta_iface_->getConnectionCapabilities(
         [&](const SupplicantStatus& status,
             ConnectionCapabilities /* capabilities */) {
@@ -323,7 +346,7 @@
 /*
  * GetWpaDriverCapabilities
  */
-TEST_F(SupplicantStaIfaceHidlTest, GetWpaDriverCapabilities) {
+TEST_P(SupplicantStaIfaceHidlTest, GetWpaDriverCapabilities) {
     sta_iface_->getWpaDriverCapabilities(
         [&](const SupplicantStatus& status, uint32_t) {
             EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
@@ -333,7 +356,7 @@
 /*
  * SetMboCellularDataStatus
  */
-TEST_F(SupplicantStaIfaceHidlTest, SetMboCellularDataStatus) {
+TEST_P(SupplicantStaIfaceHidlTest, SetMboCellularDataStatus) {
     uint32_t driverCapMask = 0;
 
     // Get MBO support from the device.
@@ -358,7 +381,7 @@
 /*
  * GetKeyMgmtCapabilities_1_3
  */
-TEST_F(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities_1_3) {
+TEST_P(SupplicantStaIfaceHidlTest, GetKeyMgmtCapabilities_1_3) {
     sta_iface_->getKeyMgmtCapabilities_1_3([&](const SupplicantStatus& status,
                                                uint32_t keyMgmtMask) {
         if (SupplicantStatusCode::SUCCESS != status.code) {
@@ -377,7 +400,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()) {
@@ -428,7 +451,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()) {
@@ -480,3 +503,12 @@
         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_3::ISupplicant::
+                descriptor))),
+    android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
index d6f55f5..d82db50 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -16,9 +16,16 @@
 
 #include <android-base/logging.h>
 
+#include <VtsCoreUtil.h>
 #include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
+#include <android/hardware/wifi/supplicant/1.3/ISupplicant.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaIface.h>
 #include <android/hardware/wifi/supplicant/1.3/ISupplicantStaNetwork.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_3.h"
@@ -28,6 +35,7 @@
 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_3::ISupplicant;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface;
 using ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork;
 using ::android::hardware::wifi::supplicant::V1_3::OcspType;
@@ -37,23 +45,34 @@
 }  // namespace
 
 class SupplicantStaNetworkHidlTest
-    : public ::testing::VtsHalHidlTargetTestBase {
+    : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
    public:
     virtual void SetUp() override {
-        startSupplicantAndWaitForHidlService();
-        EXPECT_TRUE(turnOnExcessiveLogging());
-        sta_iface_ = getSupplicantStaIface_1_3();
-        ASSERT_NE(nullptr, sta_iface_.get());
-        sta_network_ = createSupplicantStaNetwork_1_3();
-        ASSERT_NE(nullptr, sta_network_.get());
+        wifi_v1_0_instance_name_ = std::get<0>(GetParam());
+        supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
+        isP2pOn_ =
+            testing::deviceSupportsFeature("android.hardware.wifi.direct");
+        startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+                                             supplicant_v1_3_instance_name_);
+        supplicant_ =
+            getSupplicant_1_3(supplicant_v1_3_instance_name_, isP2pOn_);
+        EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+        sta_network_ = createSupplicantStaNetwork_1_3(supplicant_);
+        ASSERT_NE(sta_network_.get(), nullptr);
     }
 
-    virtual void TearDown() override { stopSupplicant(); }
+    virtual void TearDown() override {
+        stopSupplicant(wifi_v1_0_instance_name_);
+    }
 
    protected:
     sp<ISupplicantStaIface> sta_iface_;
     // ISupplicantStaNetwork object used for all tests in this fixture.
     sp<ISupplicantStaNetwork> sta_network_;
+    sp<ISupplicant> supplicant_;
+    bool isP2pOn_ = false;
+    std::string wifi_v1_0_instance_name_;
+    std::string supplicant_v1_3_instance_name_;
 
     bool isWapiSupported() {
         uint32_t keyMgmtMask = 0;
@@ -78,7 +97,7 @@
 /*
  * SetGetOcsp
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetOcsp) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetOcsp) {
     OcspType testOcspType = kTestOcspType;
 
     sta_network_->setOcsp(testOcspType, [](const SupplicantStatus &status) {
@@ -100,7 +119,7 @@
 /*
  * SetPmkCacheEntry
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetPmkCache) {
+TEST_P(SupplicantStaNetworkHidlTest, SetPmkCache) {
     uint8_t bytes[128] = {0};
     std::vector<uint8_t> serializedEntry(bytes, bytes + sizeof(bytes));
 
@@ -113,7 +132,7 @@
 /*
  * SetGetKeyMgmt_1_3, check new WAPI proto support
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_3) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetKeyMgmt_1_3) {
     uint32_t keyMgmt = (uint32_t)ISupplicantStaNetwork::KeyMgmtMask::WAPI_PSK;
 
     sta_network_->setKeyMgmt_1_3(keyMgmt, [](const SupplicantStatus &status) {
@@ -155,7 +174,7 @@
 /*
  * SetGetProto_1_3, check new WAPI proto support
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetProto_1_3) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetProto_1_3) {
     uint32_t wapiProto = (uint32_t)ISupplicantStaNetwork::ProtoMask::WAPI;
     sta_network_->setProto(wapiProto, [](const SupplicantStatus &status) {
         if (SupplicantStatusCode::SUCCESS != status.code) {
@@ -176,7 +195,7 @@
 /*
  * SetGetGroupCipher_1_3, check new WAPI support
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetGroupCipher_1_3) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetGroupCipher_1_3) {
     uint32_t groupCipher =
         (uint32_t)ISupplicantStaNetwork::GroupCipherMask::SMS4;
 
@@ -203,7 +222,7 @@
 /*
  * SetGetPairwiseCipher_1_3, check new WAPI support
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher_1_3) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher_1_3) {
     uint32_t pairwiseCipher =
         (uint32_t)ISupplicantStaNetwork::PairwiseCipherMask::SMS4;
 
@@ -230,7 +249,7 @@
 /*
  * SetGetWapiCertSuite
  */
-TEST_F(SupplicantStaNetworkHidlTest, SetGetWapiCertSuite) {
+TEST_P(SupplicantStaNetworkHidlTest, SetGetWapiCertSuite) {
     hidl_string testWapiCertSuite = "suite";
 
     if (isWapiSupported()) {
@@ -266,3 +285,12 @@
             });
     }
 }
+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_3::ISupplicant::
+                descriptor))),
+    android::hardware::PrintInstanceTupleNameToString<>);