Merge "Add the new key purpose to types.hal as well."
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index ddd286c..2f0c936 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -44,38 +44,38 @@
         "android/hardware/audio/2.0/types.h",
         "android/hardware/audio/2.0/IDevice.h",
         "android/hardware/audio/2.0/IHwDevice.h",
-        "android/hardware/audio/2.0/BnDevice.h",
-        "android/hardware/audio/2.0/BpDevice.h",
+        "android/hardware/audio/2.0/BnHwDevice.h",
+        "android/hardware/audio/2.0/BpHwDevice.h",
         "android/hardware/audio/2.0/BsDevice.h",
         "android/hardware/audio/2.0/IDevicesFactory.h",
         "android/hardware/audio/2.0/IHwDevicesFactory.h",
-        "android/hardware/audio/2.0/BnDevicesFactory.h",
-        "android/hardware/audio/2.0/BpDevicesFactory.h",
+        "android/hardware/audio/2.0/BnHwDevicesFactory.h",
+        "android/hardware/audio/2.0/BpHwDevicesFactory.h",
         "android/hardware/audio/2.0/BsDevicesFactory.h",
         "android/hardware/audio/2.0/IPrimaryDevice.h",
         "android/hardware/audio/2.0/IHwPrimaryDevice.h",
-        "android/hardware/audio/2.0/BnPrimaryDevice.h",
-        "android/hardware/audio/2.0/BpPrimaryDevice.h",
+        "android/hardware/audio/2.0/BnHwPrimaryDevice.h",
+        "android/hardware/audio/2.0/BpHwPrimaryDevice.h",
         "android/hardware/audio/2.0/BsPrimaryDevice.h",
         "android/hardware/audio/2.0/IStream.h",
         "android/hardware/audio/2.0/IHwStream.h",
-        "android/hardware/audio/2.0/BnStream.h",
-        "android/hardware/audio/2.0/BpStream.h",
+        "android/hardware/audio/2.0/BnHwStream.h",
+        "android/hardware/audio/2.0/BpHwStream.h",
         "android/hardware/audio/2.0/BsStream.h",
         "android/hardware/audio/2.0/IStreamIn.h",
         "android/hardware/audio/2.0/IHwStreamIn.h",
-        "android/hardware/audio/2.0/BnStreamIn.h",
-        "android/hardware/audio/2.0/BpStreamIn.h",
+        "android/hardware/audio/2.0/BnHwStreamIn.h",
+        "android/hardware/audio/2.0/BpHwStreamIn.h",
         "android/hardware/audio/2.0/BsStreamIn.h",
         "android/hardware/audio/2.0/IStreamOut.h",
         "android/hardware/audio/2.0/IHwStreamOut.h",
-        "android/hardware/audio/2.0/BnStreamOut.h",
-        "android/hardware/audio/2.0/BpStreamOut.h",
+        "android/hardware/audio/2.0/BnHwStreamOut.h",
+        "android/hardware/audio/2.0/BpHwStreamOut.h",
         "android/hardware/audio/2.0/BsStreamOut.h",
         "android/hardware/audio/2.0/IStreamOutCallback.h",
         "android/hardware/audio/2.0/IHwStreamOutCallback.h",
-        "android/hardware/audio/2.0/BnStreamOutCallback.h",
-        "android/hardware/audio/2.0/BpStreamOutCallback.h",
+        "android/hardware/audio/2.0/BnHwStreamOutCallback.h",
+        "android/hardware/audio/2.0/BpHwStreamOutCallback.h",
         "android/hardware/audio/2.0/BsStreamOutCallback.h",
     ],
 }
diff --git a/audio/2.0/IDevicesFactory.hal b/audio/2.0/IDevicesFactory.hal
index f1dc7d3..0ef6bc5 100644
--- a/audio/2.0/IDevicesFactory.hal
+++ b/audio/2.0/IDevicesFactory.hal
@@ -26,7 +26,8 @@
         PRIMARY,
         A2DP,
         USB,
-        R_SUBMIX
+        R_SUBMIX,
+        STUB
     };
 
     /*
diff --git a/audio/2.0/IStream.hal b/audio/2.0/IStream.hal
index 5c88a69..8de7851 100644
--- a/audio/2.0/IStream.hal
+++ b/audio/2.0/IStream.hal
@@ -279,4 +279,16 @@
      */
     getMmapPosition()
             generates (Result retval, MmapPosition position);
+
+    /*
+     * Called by the framework to deinitialize the stream and free up
+     * all the currently allocated resources. It is recommended to close
+     * the stream on the client side as soon as it is becomes unused.
+     *
+     * @return retval OK in case the success.
+     *                NOT_SUPPORTED if called on IStream instead of input or
+     *                              output stream interface.
+     *                INVALID_STATE if the stream was already closed.
+     */
+    close() generates (Result retval);
 };
diff --git a/audio/2.0/IStreamIn.hal b/audio/2.0/IStreamIn.hal
index 6cf7425..9a96f71 100644
--- a/audio/2.0/IStreamIn.hal
+++ b/audio/2.0/IStreamIn.hal
@@ -41,16 +41,45 @@
     setGain(float gain) generates (Result retval);
 
     /*
-     * Read audio buffer in from driver. If at least one frame was read prior to
-     * the error, 'read' must return that byte count and then return an error
-     * in the subsequent call.
+     * Data structure passed back to the client via status message queue
+     * of 'read' operation.
      *
-     * @param size maximum amount of bytes to read.
-     * @return retval operation completion status.
-     * @return data audio data.
+     * Possible values of 'retval' field:
+     *  - OK, read operation was successful;
+     *  - INVALID_ARGUMENTS, stream was not configured properly;
+     *  - INVALID_STATE, stream is in a state that doesn't allow reads.
      */
-    // TODO(mnaganov): Replace with FMQ version.
-    read(uint64_t size) generates (Result retval, vec<uint8_t> data);
+    struct ReadStatus {
+        Result retval;
+        uint64_t read;
+    };
+
+    /*
+     * Set up required transports for receiving audio buffers from the driver.
+     *
+     * The transport consists of two message queues: one is used for passing
+     * audio data from the driver to the client, another is used for reporting
+     * read operation status (amount of bytes actually read or error code),
+     * see ReadStatus structure definition.
+     *
+     * @param frameSize the size of a single frame, in bytes.
+     * @param framesCount the number of frames in a buffer.
+     * @param threadPriority priority of the thread that performs reads.
+     * @return retval OK if both message queues were created successfully.
+     *                INVALID_STATE if the method was already called.
+     *                INVALID_ARGUMENTS if there was a problem setting up
+     *                                  the queues.
+     * @return dataMQ a message queue used for passing audio data in the format
+     *                specified at the stream opening.
+     * @return statusMQ a message queue used for passing status from the driver
+     *                  using ReadStatus structures.
+     */
+    prepareForReading(
+            uint32_t frameSize, uint32_t framesCount,
+            ThreadPriority threadPriority)
+    generates (
+            Result retval,
+            fmq_sync<uint8_t> dataMQ, fmq_sync<ReadStatus> statusMQ);
 
     /*
      * Return the amount of input frames lost in the audio driver since the last
diff --git a/audio/2.0/IStreamOut.hal b/audio/2.0/IStreamOut.hal
index 4ba3b2f..336684f 100644
--- a/audio/2.0/IStreamOut.hal
+++ b/audio/2.0/IStreamOut.hal
@@ -44,25 +44,55 @@
     setVolume(float left, float right) generates (Result retval);
 
     /*
-     * Write audio buffer to driver. On success, sets 'retval' to 'OK', and
-     * returns number of bytes written. If at least one frame was written
-     * successfully prior to the error, it is suggested that the driver return
-     * that successful (short) byte count and then return an error in the
-     * subsequent call.
+     * Data structure passed back to the client via status message queue
+     * of 'write' operation.
      *
-     * If 'setCallback' has previously been called to enable non-blocking mode
-     * then 'write' is not allowed to block. It must write only the number of
-     * bytes that currently fit in the driver/hardware buffer and then return
-     * this byte count. If this is less than the requested write size the
-     * callback function must be called when more space is available in the
-     * driver/hardware buffer.
+     * Possible values of 'writeRetval' field:
+     *  - OK, write operation was successful;
+     *  - INVALID_ARGUMENTS, stream was not configured properly;
+     *  - INVALID_STATE, stream is in a state that doesn't allow writes.
      *
-     * @param data audio data.
-     * @return retval operation completion status.
-     * @return written number of bytes written.
+     * Possible values of 'presentationPositionRetval' field (must only
+     * be considered if 'writeRetval' field is set to 'OK'):
+     *  - OK, presentation position retrieved successfully;
+     *  - INVALID_ARGUMENTS, indicates that the position can't be retrieved;
+     *  - INVALID_OPERATION, retrieving presentation position isn't supported;
      */
-    // TODO(mnaganov): Replace with FMQ version.
-    write(vec<uint8_t> data) generates (Result retval, uint64_t written);
+    struct WriteStatus {
+        Result writeRetval;
+        uint64_t written;
+        Result presentationPositionRetval;
+        uint64_t frames;    // presentation position
+        TimeSpec timeStamp; // presentation position
+    };
+
+    /*
+     * Set up required transports for passing audio buffers to the driver.
+     *
+     * The transport consists of two message queues: one is used for passing
+     * audio data from the client to the driver, another is used for reporting
+     * write operation status (amount of bytes actually written or error code),
+     * and the presentation position immediately after the write, see
+     * WriteStatus structure definition.
+     *
+     * @param frameSize the size of a single frame, in bytes.
+     * @param framesCount the number of frames in a buffer.
+     * @param threadPriority priority of the thread that performs writes.
+     * @return retval OK if both message queues were created successfully.
+     *                INVALID_STATE if the method was already called.
+     *                INVALID_ARGUMENTS if there was a problem setting up
+     *                                  the queues.
+     * @return dataMQ a message queue used for passing audio data in the format
+     *                specified at the stream opening.
+     * @return statusMQ a message queue used for passing status from the driver
+     *                  using WriteStatus structures.
+     */
+    prepareForWriting(
+            uint32_t frameSize, uint32_t framesCount,
+            ThreadPriority threadPriority)
+    generates (
+            Result retval,
+            fmq_sync<uint8_t> dataMQ, fmq_sync<WriteStatus> statusMQ);
 
     /*
      * Return the number of audio frames written by the audio DSP to DAC since
diff --git a/audio/2.0/default/Android.mk b/audio/2.0/default/Android.mk
index c3cfd69..eeea92c 100644
--- a/audio/2.0/default/Android.mk
+++ b/audio/2.0/default/Android.mk
@@ -30,13 +30,16 @@
     StreamOut.cpp \
 
 LOCAL_SHARED_LIBRARIES := \
+    libbase \
+    libcutils \
+    libfmq \
+    libhardware \
     libhidlbase \
     libhidltransport \
     libhwbinder \
-    libcutils \
-    libutils \
-    libhardware \
     liblog \
+    libmediautils \
+    libutils \
     android.hardware.audio@2.0 \
     android.hardware.audio.common@2.0 \
     android.hardware.audio.common@2.0-util \
diff --git a/audio/2.0/default/DevicesFactory.cpp b/audio/2.0/default/DevicesFactory.cpp
index 12ef2c8..8825107 100644
--- a/audio/2.0/default/DevicesFactory.cpp
+++ b/audio/2.0/default/DevicesFactory.cpp
@@ -37,6 +37,7 @@
         case IDevicesFactory::Device::A2DP: return AUDIO_HARDWARE_MODULE_ID_A2DP;
         case IDevicesFactory::Device::USB: return AUDIO_HARDWARE_MODULE_ID_USB;
         case IDevicesFactory::Device::R_SUBMIX: return AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX;
+        case IDevicesFactory::Device::STUB: return AUDIO_HARDWARE_MODULE_ID_STUB;
     }
 }
 
diff --git a/audio/2.0/default/Stream.cpp b/audio/2.0/default/Stream.cpp
index f214eed..62b34a3 100644
--- a/audio/2.0/default/Stream.cpp
+++ b/audio/2.0/default/Stream.cpp
@@ -253,6 +253,10 @@
     return Void();
 }
 
+Return<Result> Stream::close()  {
+    return Result::NOT_SUPPORTED;
+}
+
 } // namespace implementation
 }  // namespace V2_0
 }  // namespace audio
diff --git a/audio/2.0/default/Stream.h b/audio/2.0/default/Stream.h
index 819bbf7..0bbd803 100644
--- a/audio/2.0/default/Stream.h
+++ b/audio/2.0/default/Stream.h
@@ -76,6 +76,7 @@
     Return<Result> stop() override;
     Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
     Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
+    Return<Result> close()  override;
 
     // Utility methods for extending interfaces.
     static Result analyzeStatus(const char* funcName, int status, int ignoreError = OK);
diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp
index 1441e74..de7bf13 100644
--- a/audio/2.0/default/StreamIn.cpp
+++ b/audio/2.0/default/StreamIn.cpp
@@ -15,26 +15,112 @@
  */
 
 #define LOG_TAG "StreamInHAL"
+//#define LOG_NDEBUG 0
 
-#include <hardware/audio.h>
 #include <android/log.h>
+#include <hardware/audio.h>
+#include <mediautils/SchedulingPolicyService.h>
 
 #include "StreamIn.h"
 
+using ::android::hardware::audio::V2_0::MessageQueueFlagBits;
+
 namespace android {
 namespace hardware {
 namespace audio {
 namespace V2_0 {
 namespace implementation {
 
+namespace {
+
+class ReadThread : public Thread {
+  public:
+    // ReadThread's lifespan never exceeds StreamIn's lifespan.
+    ReadThread(std::atomic<bool>* stop,
+            audio_stream_in_t* stream,
+            StreamIn::DataMQ* dataMQ,
+            StreamIn::StatusMQ* statusMQ,
+            EventFlag* efGroup,
+            ThreadPriority threadPriority)
+            : Thread(false /*canCallJava*/),
+              mStop(stop),
+              mStream(stream),
+              mDataMQ(dataMQ),
+              mStatusMQ(statusMQ),
+              mEfGroup(efGroup),
+              mThreadPriority(threadPriority),
+              mBuffer(new uint8_t[dataMQ->getQuantumCount()]) {
+    }
+    virtual ~ReadThread() {}
+
+    status_t readyToRun() override;
+
+  private:
+    std::atomic<bool>* mStop;
+    audio_stream_in_t* mStream;
+    StreamIn::DataMQ* mDataMQ;
+    StreamIn::StatusMQ* mStatusMQ;
+    EventFlag* mEfGroup;
+    ThreadPriority mThreadPriority;
+    std::unique_ptr<uint8_t[]> mBuffer;
+
+    bool threadLoop() override;
+};
+
+status_t ReadThread::readyToRun() {
+    if (mThreadPriority != ThreadPriority::NORMAL) {
+        int err = requestPriority(
+                getpid(), getTid(), static_cast<int>(mThreadPriority), true /*asynchronous*/);
+        ALOGW_IF(err, "failed to set priority %d for pid %d tid %d; error %d",
+                static_cast<int>(mThreadPriority), getpid(), getTid(), err);
+    }
+    return OK;
+}
+
+bool ReadThread::threadLoop() {
+    // This implementation doesn't return control back to the Thread until it decides to stop,
+    // as the Thread uses mutexes, and this can lead to priority inversion.
+    while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
+        // TODO: Remove manual event flag handling once blocking MQ is implemented. b/33815422
+        uint32_t efState = 0;
+        mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL), &efState, NS_PER_SEC);
+        if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL))) {
+            continue;  // Nothing to do.
+        }
+
+        const size_t availToWrite = mDataMQ->availableToWrite();
+        ssize_t readResult = mStream->read(mStream, &mBuffer[0], availToWrite);
+        Result retval = Result::OK;
+        uint64_t read = 0;
+        if (readResult >= 0) {
+            read = readResult;
+            if (!mDataMQ->write(&mBuffer[0], readResult)) {
+                ALOGW("data message queue write failed");
+            }
+        } else {
+            retval = Stream::analyzeStatus("read", readResult);
+        }
+        IStreamIn::ReadStatus status = { retval, read };
+        if (!mStatusMQ->write(&status)) {
+            ALOGW("status message queue write failed");
+        }
+        mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY));
+    }
+
+    return false;
+}
+
+}  // namespace
+
 StreamIn::StreamIn(audio_hw_device_t* device, audio_stream_in_t* stream)
-        : mDevice(device), mStream(stream),
+        : mIsClosed(false), mDevice(device), mStream(stream),
           mStreamCommon(new Stream(&stream->common)),
-          mStreamMmap(new StreamMmap<audio_stream_in_t>(stream)) {
+          mStreamMmap(new StreamMmap<audio_stream_in_t>(stream)),
+          mEfGroup(nullptr), mStopReadThread(false) {
 }
 
 StreamIn::~StreamIn() {
-    mDevice->close_input_stream(mDevice, mStream);
+    close();
     mStream = nullptr;
     mDevice = nullptr;
 }
@@ -149,6 +235,22 @@
     return mStreamMmap->getMmapPosition(_hidl_cb);
 }
 
+Return<Result> StreamIn::close()  {
+    if (mIsClosed) return Result::INVALID_STATE;
+    mIsClosed = true;
+    if (mReadThread.get()) {
+        mStopReadThread.store(true, std::memory_order_release);
+        status_t status = mReadThread->requestExitAndWait();
+        ALOGE_IF(status, "read thread exit error: %s", strerror(-status));
+    }
+    if (mEfGroup) {
+        status_t status = EventFlag::deleteEventFlag(&mEfGroup);
+        ALOGE_IF(status, "read MQ event flag deletion error: %s", strerror(-status));
+    }
+    mDevice->close_input_stream(mDevice, mStream);
+    return Result::OK;
+}
+
 // Methods from ::android::hardware::audio::V2_0::IStreamIn follow.
 Return<void> StreamIn::getAudioSource(getAudioSource_cb _hidl_cb)  {
     int halSource;
@@ -165,19 +267,55 @@
     return Stream::analyzeStatus("set_gain", mStream->set_gain(mStream, gain));
 }
 
-Return<void> StreamIn::read(uint64_t size, read_cb _hidl_cb)  {
-    // TODO(mnaganov): Replace with FMQ version.
-    hidl_vec<uint8_t> data;
-    data.resize(size);
-    Result retval(Result::OK);
-    ssize_t readResult = mStream->read(mStream, &data[0], data.size());
-    if (readResult >= 0 && static_cast<size_t>(readResult) != data.size()) {
-        data.resize(readResult);
-    } else if (readResult < 0) {
-        data.resize(0);
-        retval = Stream::analyzeStatus("read", readResult);
+Return<void> StreamIn::prepareForReading(
+        uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
+        prepareForReading_cb _hidl_cb)  {
+    status_t status;
+    // Create message queues.
+    if (mDataMQ) {
+        ALOGE("the client attempts to call prepareForReading twice");
+        _hidl_cb(Result::INVALID_STATE,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<ReadStatus>());
+        return Void();
     }
-    _hidl_cb(retval, data);
+    std::unique_ptr<DataMQ> tempDataMQ(
+            new DataMQ(frameSize * framesCount, true /* EventFlag */));
+    std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1));
+    if (!tempDataMQ->isValid() || !tempStatusMQ->isValid()) {
+        ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
+        ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<ReadStatus>());
+        return Void();
+    }
+    // TODO: Remove event flag management once blocking MQ is implemented. b/33815422
+    status = EventFlag::createEventFlag(tempDataMQ->getEventFlagWord(), &mEfGroup);
+    if (status != OK || !mEfGroup) {
+        ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<ReadStatus>());
+        return Void();
+    }
+
+    // Create and launch the thread.
+    mReadThread = new ReadThread(
+            &mStopReadThread,
+            mStream,
+            tempDataMQ.get(),
+            tempStatusMQ.get(),
+            mEfGroup,
+            threadPriority);
+    status = mReadThread->run("reader", PRIORITY_URGENT_AUDIO);
+    if (status != OK) {
+        ALOGW("failed to start reader thread: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<ReadStatus>());
+        return Void();
+    }
+
+    mDataMQ = std::move(tempDataMQ);
+    mStatusMQ = std::move(tempStatusMQ);
+    _hidl_cb(Result::OK, *mDataMQ->getDesc(), *mStatusMQ->getDesc());
     return Void();
 }
 
@@ -192,7 +330,10 @@
         int64_t halFrames, halTime;
         retval = Stream::analyzeStatus(
                 "get_capture_position",
-                mStream->get_capture_position(mStream, &halFrames, &halTime));
+                mStream->get_capture_position(mStream, &halFrames, &halTime),
+                // HAL may have a stub function, always returning ENOSYS, don't
+                // spam the log in this case.
+                ENOSYS);
         if (retval == Result::OK) {
             frames = halFrames;
             time = halTime;
diff --git a/audio/2.0/default/StreamIn.h b/audio/2.0/default/StreamIn.h
index 65e94bb..fc813d9 100644
--- a/audio/2.0/default/StreamIn.h
+++ b/audio/2.0/default/StreamIn.h
@@ -17,10 +17,15 @@
 #ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAMIN_H
 #define ANDROID_HARDWARE_AUDIO_V2_0_STREAMIN_H
 
-#include <android/hardware/audio/2.0/IStreamIn.h>
-#include <hidl/Status.h>
+#include <atomic>
+#include <memory>
 
+#include <android/hardware/audio/2.0/IStreamIn.h>
 #include <hidl/MQDescriptor.h>
+#include <fmq/EventFlag.h>
+#include <fmq/MessageQueue.h>
+#include <hidl/Status.h>
+#include <utils/Thread.h>
 
 #include "Stream.h"
 
@@ -39,6 +44,7 @@
 using ::android::hardware::audio::V2_0::IStreamIn;
 using ::android::hardware::audio::V2_0::ParameterValue;
 using ::android::hardware::audio::V2_0::Result;
+using ::android::hardware::audio::V2_0::ThreadPriority;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::hardware::hidl_vec;
@@ -46,6 +52,9 @@
 using ::android::sp;
 
 struct StreamIn : public IStreamIn {
+    typedef MessageQueue<uint8_t, kSynchronizedReadWrite> DataMQ;
+    typedef MessageQueue<ReadStatus, kSynchronizedReadWrite> StatusMQ;
+
     StreamIn(audio_hw_device_t* device, audio_stream_in_t* stream);
 
     // Methods from ::android::hardware::audio::V2_0::IStream follow.
@@ -73,11 +82,14 @@
             const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb)  override;
     Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters)  override;
     Return<void> debugDump(const hidl_handle& fd)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::V2_0::IStreamIn follow.
     Return<void> getAudioSource(getAudioSource_cb _hidl_cb)  override;
     Return<Result> setGain(float gain)  override;
-    Return<void> read(uint64_t size, read_cb _hidl_cb)  override;
+    Return<void> prepareForReading(
+            uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
+            prepareForReading_cb _hidl_cb)  override;
     Return<uint32_t> getInputFramesLost()  override;
     Return<void> getCapturePosition(getCapturePosition_cb _hidl_cb)  override;
     Return<Result> start() override;
@@ -86,11 +98,16 @@
     Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
 
   private:
+    bool mIsClosed;
     audio_hw_device_t *mDevice;
     audio_stream_in_t *mStream;
     sp<Stream> mStreamCommon;
     sp<StreamMmap<audio_stream_in_t>> mStreamMmap;
-
+    std::unique_ptr<DataMQ> mDataMQ;
+    std::unique_ptr<StatusMQ> mStatusMQ;
+    EventFlag* mEfGroup;
+    std::atomic<bool> mStopReadThread;
+    sp<Thread> mReadThread;
 
     virtual ~StreamIn();
 };
diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp
index 3d20d11..ea6221e 100644
--- a/audio/2.0/default/StreamOut.cpp
+++ b/audio/2.0/default/StreamOut.cpp
@@ -17,8 +17,9 @@
 #define LOG_TAG "StreamOutHAL"
 //#define LOG_NDEBUG 0
 
-#include <hardware/audio.h>
 #include <android/log.h>
+#include <hardware/audio.h>
+#include <mediautils/SchedulingPolicyService.h>
 
 #include "StreamOut.h"
 
@@ -28,15 +29,99 @@
 namespace V2_0 {
 namespace implementation {
 
+namespace {
+
+class WriteThread : public Thread {
+  public:
+    // WriteThread's lifespan never exceeds StreamOut's lifespan.
+    WriteThread(std::atomic<bool>* stop,
+            audio_stream_out_t* stream,
+            StreamOut::DataMQ* dataMQ,
+            StreamOut::StatusMQ* statusMQ,
+            EventFlag* efGroup,
+            ThreadPriority threadPriority)
+            : Thread(false /*canCallJava*/),
+              mStop(stop),
+              mStream(stream),
+              mDataMQ(dataMQ),
+              mStatusMQ(statusMQ),
+              mEfGroup(efGroup),
+              mThreadPriority(threadPriority),
+              mBuffer(new uint8_t[dataMQ->getQuantumCount()]) {
+    }
+    virtual ~WriteThread() {}
+
+    status_t readyToRun() override;
+
+  private:
+    std::atomic<bool>* mStop;
+    audio_stream_out_t* mStream;
+    StreamOut::DataMQ* mDataMQ;
+    StreamOut::StatusMQ* mStatusMQ;
+    EventFlag* mEfGroup;
+    ThreadPriority mThreadPriority;
+    std::unique_ptr<uint8_t[]> mBuffer;
+
+    bool threadLoop() override;
+};
+
+status_t WriteThread::readyToRun() {
+    if (mThreadPriority != ThreadPriority::NORMAL) {
+        int err = requestPriority(
+                getpid(), getTid(), static_cast<int>(mThreadPriority), true /*asynchronous*/);
+        ALOGW_IF(err, "failed to set priority %d for pid %d tid %d; error %d",
+                static_cast<int>(mThreadPriority), getpid(), getTid(), err);
+    }
+    return OK;
+}
+
+bool WriteThread::threadLoop() {
+    // This implementation doesn't return control back to the Thread until it decides to stop,
+    // as the Thread uses mutexes, and this can lead to priority inversion.
+    while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
+        // TODO: Remove manual event flag handling once blocking MQ is implemented. b/33815422
+        uint32_t efState = 0;
+        mEfGroup->wait(
+                static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY), &efState, NS_PER_SEC);
+        if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY))) {
+            continue;  // Nothing to do.
+        }
+
+        const size_t availToRead = mDataMQ->availableToRead();
+        IStreamOut::WriteStatus status;
+        status.writeRetval = Result::OK;
+        status.written = 0;
+        if (mDataMQ->read(&mBuffer[0], availToRead)) {
+            ssize_t writeResult = mStream->write(mStream, &mBuffer[0], availToRead);
+            if (writeResult >= 0) {
+                status.written = writeResult;
+            } else {
+                status.writeRetval = Stream::analyzeStatus("write", writeResult);
+            }
+        }
+        status.presentationPositionRetval = status.writeRetval == Result::OK ?
+                StreamOut::getPresentationPositionImpl(mStream, &status.frames, &status.timeStamp) :
+                Result::OK;
+        if (!mStatusMQ->write(&status)) {
+            ALOGW("status message queue write failed");
+        }
+        mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL));
+    }
+
+    return false;
+}
+
+}  // namespace
+
 StreamOut::StreamOut(audio_hw_device_t* device, audio_stream_out_t* stream)
-        : mDevice(device), mStream(stream),
+        : mIsClosed(false), mDevice(device), mStream(stream),
           mStreamCommon(new Stream(&stream->common)),
-          mStreamMmap(new StreamMmap<audio_stream_out_t>(stream)) {
+          mStreamMmap(new StreamMmap<audio_stream_out_t>(stream)),
+          mEfGroup(nullptr), mStopWriteThread(false) {
 }
 
 StreamOut::~StreamOut() {
-    mCallback.clear();
-    mDevice->close_output_stream(mDevice, mStream);
+    close();
     mStream = nullptr;
     mDevice = nullptr;
 }
@@ -135,6 +220,23 @@
     return mStreamCommon->debugDump(fd);
 }
 
+Return<Result> StreamOut::close()  {
+    if (mIsClosed) return Result::INVALID_STATE;
+    mIsClosed = true;
+    if (mWriteThread.get()) {
+        mStopWriteThread.store(true, std::memory_order_release);
+        status_t status = mWriteThread->requestExitAndWait();
+        ALOGE_IF(status, "write thread exit error: %s", strerror(-status));
+    }
+    if (mEfGroup) {
+        status_t status = EventFlag::deleteEventFlag(&mEfGroup);
+        ALOGE_IF(status, "write MQ event flag deletion error: %s", strerror(-status));
+    }
+    mCallback.clear();
+    mDevice->close_output_stream(mDevice, mStream);
+    return Result::OK;
+}
+
 // Methods from ::android::hardware::audio::V2_0::IStreamOut follow.
 Return<uint32_t> StreamOut::getLatency()  {
     return mStream->get_latency(mStream);
@@ -149,18 +251,55 @@
     return retval;
 }
 
-Return<void> StreamOut::write(const hidl_vec<uint8_t>& data, write_cb _hidl_cb)  {
-    // TODO(mnaganov): Replace with FMQ version.
-    Result retval(Result::OK);
-    uint64_t written = 0;
-    ssize_t writeResult = mStream->write(mStream, &data[0], data.size());
-    if (writeResult >= 0) {
-        written = writeResult;
-    } else {
-        retval = Stream::analyzeStatus("write", writeResult);
-        written = 0;
+Return<void> StreamOut::prepareForWriting(
+        uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
+        prepareForWriting_cb _hidl_cb)  {
+    status_t status;
+    // Create message queues.
+    if (mDataMQ) {
+        ALOGE("the client attempts to call prepareForWriting twice");
+        _hidl_cb(Result::INVALID_STATE,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<WriteStatus>());
+        return Void();
     }
-    _hidl_cb(retval, written);
+    std::unique_ptr<DataMQ> tempDataMQ(
+            new DataMQ(frameSize * framesCount, true /* EventFlag */));
+    std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1));
+    if (!tempDataMQ->isValid() || !tempStatusMQ->isValid()) {
+        ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
+        ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<WriteStatus>());
+        return Void();
+    }
+    // TODO: Remove event flag management once blocking MQ is implemented. b/33815422
+    status = EventFlag::createEventFlag(tempDataMQ->getEventFlagWord(), &mEfGroup);
+    if (status != OK || !mEfGroup) {
+        ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<WriteStatus>());
+        return Void();
+    }
+
+    // Create and launch the thread.
+    mWriteThread = new WriteThread(
+            &mStopWriteThread,
+            mStream,
+            tempDataMQ.get(),
+            tempStatusMQ.get(),
+            mEfGroup,
+            threadPriority);
+    status = mWriteThread->run("writer", PRIORITY_URGENT_AUDIO);
+    if (status != OK) {
+        ALOGW("failed to start writer thread: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS,
+                MQDescriptorSync<uint8_t>(), MQDescriptorSync<WriteStatus>());
+        return Void();
+    }
+
+    mDataMQ = std::move(tempDataMQ);
+    mStatusMQ = std::move(tempStatusMQ);
+    _hidl_cb(Result::OK, *mDataMQ->getDesc(), *mStatusMQ->getDesc());
     return Void();
 }
 
@@ -256,23 +395,29 @@
             Result::NOT_SUPPORTED;
 }
 
-Return<void> StreamOut::getPresentationPosition(getPresentationPosition_cb _hidl_cb)  {
+// static
+Result StreamOut::getPresentationPositionImpl(
+        audio_stream_out_t *stream, uint64_t *frames, TimeSpec *timeStamp) {
     Result retval(Result::NOT_SUPPORTED);
+    if (stream->get_presentation_position == NULL) return retval;
+    struct timespec halTimeStamp;
+    retval = Stream::analyzeStatus(
+            "get_presentation_position",
+            stream->get_presentation_position(stream, frames, &halTimeStamp),
+            // Don't logspam on EINVAL--it's normal for get_presentation_position
+            // to return it sometimes.
+            EINVAL);
+    if (retval == Result::OK) {
+        timeStamp->tvSec = halTimeStamp.tv_sec;
+        timeStamp->tvNSec = halTimeStamp.tv_nsec;
+    }
+    return retval;
+}
+
+Return<void> StreamOut::getPresentationPosition(getPresentationPosition_cb _hidl_cb)  {
     uint64_t frames = 0;
     TimeSpec timeStamp = { 0, 0 };
-    if (mStream->get_presentation_position != NULL) {
-        struct timespec halTimeStamp;
-        retval = Stream::analyzeStatus(
-                "get_presentation_position",
-                mStream->get_presentation_position(mStream, &frames, &halTimeStamp),
-                // Don't logspam on EINVAL--it's normal for get_presentation_position
-                // to return it sometimes.
-                EINVAL);
-        if (retval == Result::OK) {
-            timeStamp.tvSec = halTimeStamp.tv_sec;
-            timeStamp.tvNSec = halTimeStamp.tv_nsec;
-        }
-    }
+    Result retval = getPresentationPositionImpl(mStream, &frames, &timeStamp);
     _hidl_cb(retval, frames, timeStamp);
     return Void();
 }
diff --git a/audio/2.0/default/StreamOut.h b/audio/2.0/default/StreamOut.h
index 9b7f9f8..754a0c0 100644
--- a/audio/2.0/default/StreamOut.h
+++ b/audio/2.0/default/StreamOut.h
@@ -17,10 +17,15 @@
 #ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAMOUT_H
 #define ANDROID_HARDWARE_AUDIO_V2_0_STREAMOUT_H
 
-#include <android/hardware/audio/2.0/IStreamOut.h>
-#include <hidl/Status.h>
+#include <atomic>
+#include <memory>
 
+#include <android/hardware/audio/2.0/IStreamOut.h>
 #include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <fmq/EventFlag.h>
+#include <fmq/MessageQueue.h>
+#include <utils/Thread.h>
 
 #include "Stream.h"
 
@@ -40,6 +45,7 @@
 using ::android::hardware::audio::V2_0::IStreamOutCallback;
 using ::android::hardware::audio::V2_0::ParameterValue;
 using ::android::hardware::audio::V2_0::Result;
+using ::android::hardware::audio::V2_0::ThreadPriority;
 using ::android::hardware::audio::V2_0::TimeSpec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
@@ -48,6 +54,9 @@
 using ::android::sp;
 
 struct StreamOut : public IStreamOut {
+    typedef MessageQueue<uint8_t, kSynchronizedReadWrite> DataMQ;
+    typedef MessageQueue<WriteStatus, kSynchronizedReadWrite> StatusMQ;
+
     StreamOut(audio_hw_device_t* device, audio_stream_out_t* stream);
 
     // Methods from ::android::hardware::audio::V2_0::IStream follow.
@@ -75,11 +84,14 @@
             const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb)  override;
     Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters)  override;
     Return<void> debugDump(const hidl_handle& fd)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::V2_0::IStreamOut follow.
     Return<uint32_t> getLatency()  override;
     Return<Result> setVolume(float left, float right)  override;
-    Return<void> write(const hidl_vec<uint8_t>& data, write_cb _hidl_cb)  override;
+    Return<void> prepareForWriting(
+            uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
+            prepareForWriting_cb _hidl_cb)  override;
     Return<void> getRenderPosition(getRenderPosition_cb _hidl_cb)  override;
     Return<void> getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb)  override;
     Return<Result> setCallback(const sp<IStreamOutCallback>& callback)  override;
@@ -96,12 +108,21 @@
     Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
     Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
 
+    static Result getPresentationPositionImpl(
+            audio_stream_out_t *stream, uint64_t *frames, TimeSpec *timeStamp);
+
   private:
+    bool mIsClosed;
     audio_hw_device_t *mDevice;
     audio_stream_out_t *mStream;
     sp<Stream> mStreamCommon;
     sp<StreamMmap<audio_stream_out_t>> mStreamMmap;
     sp<IStreamOutCallback> mCallback;
+    std::unique_ptr<DataMQ> mDataMQ;
+    std::unique_ptr<StatusMQ> mStatusMQ;
+    EventFlag* mEfGroup;
+    std::atomic<bool> mStopWriteThread;
+    sp<Thread> mWriteThread;
 
     virtual ~StreamOut();
 
diff --git a/audio/2.0/types.hal b/audio/2.0/types.hal
index 37c39e4..8fc4314 100644
--- a/audio/2.0/types.hal
+++ b/audio/2.0/types.hal
@@ -89,3 +89,21 @@
     int64_t  timeNanoseconds; // time stamp in ns, CLOCK_MONOTONIC
     int32_t  positionFrames;  // increasing 32 bit frame count reset when IStream.stop() is called
 };
+
+/*
+ * The message queue flags used to synchronize reads and writes from
+ * message queues used by StreamIn and StreamOut.
+ */
+enum MessageQueueFlagBits : uint32_t {
+    NOT_EMPTY = 1 << 0,
+    NOT_FULL = 1 << 1
+};
+
+/*
+ * The priority of threads executing reads and writes of audio data.
+ */
+enum ThreadPriority : int32_t {
+    NORMAL = 0,
+    FAST_CAPTURE = 3,
+    FAST_MIXER = 3
+};
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index a094dec..ee76a0e 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -65,73 +65,73 @@
         "android/hardware/audio/effect/2.0/types.h",
         "android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h",
         "android/hardware/audio/effect/2.0/IHwAcousticEchoCancelerEffect.h",
-        "android/hardware/audio/effect/2.0/BnAcousticEchoCancelerEffect.h",
-        "android/hardware/audio/effect/2.0/BpAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwAcousticEchoCancelerEffect.h",
         "android/hardware/audio/effect/2.0/BsAcousticEchoCancelerEffect.h",
         "android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h",
         "android/hardware/audio/effect/2.0/IHwAutomaticGainControlEffect.h",
-        "android/hardware/audio/effect/2.0/BnAutomaticGainControlEffect.h",
-        "android/hardware/audio/effect/2.0/BpAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwAutomaticGainControlEffect.h",
         "android/hardware/audio/effect/2.0/BsAutomaticGainControlEffect.h",
         "android/hardware/audio/effect/2.0/IBassBoostEffect.h",
         "android/hardware/audio/effect/2.0/IHwBassBoostEffect.h",
-        "android/hardware/audio/effect/2.0/BnBassBoostEffect.h",
-        "android/hardware/audio/effect/2.0/BpBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwBassBoostEffect.h",
         "android/hardware/audio/effect/2.0/BsBassBoostEffect.h",
         "android/hardware/audio/effect/2.0/IDownmixEffect.h",
         "android/hardware/audio/effect/2.0/IHwDownmixEffect.h",
-        "android/hardware/audio/effect/2.0/BnDownmixEffect.h",
-        "android/hardware/audio/effect/2.0/BpDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwDownmixEffect.h",
         "android/hardware/audio/effect/2.0/BsDownmixEffect.h",
         "android/hardware/audio/effect/2.0/IEffect.h",
         "android/hardware/audio/effect/2.0/IHwEffect.h",
-        "android/hardware/audio/effect/2.0/BnEffect.h",
-        "android/hardware/audio/effect/2.0/BpEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwEffect.h",
         "android/hardware/audio/effect/2.0/BsEffect.h",
         "android/hardware/audio/effect/2.0/IEffectBufferProviderCallback.h",
         "android/hardware/audio/effect/2.0/IHwEffectBufferProviderCallback.h",
-        "android/hardware/audio/effect/2.0/BnEffectBufferProviderCallback.h",
-        "android/hardware/audio/effect/2.0/BpEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BnHwEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BpHwEffectBufferProviderCallback.h",
         "android/hardware/audio/effect/2.0/BsEffectBufferProviderCallback.h",
         "android/hardware/audio/effect/2.0/IEffectsFactory.h",
         "android/hardware/audio/effect/2.0/IHwEffectsFactory.h",
-        "android/hardware/audio/effect/2.0/BnEffectsFactory.h",
-        "android/hardware/audio/effect/2.0/BpEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BnHwEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BpHwEffectsFactory.h",
         "android/hardware/audio/effect/2.0/BsEffectsFactory.h",
         "android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h",
         "android/hardware/audio/effect/2.0/IHwEnvironmentalReverbEffect.h",
-        "android/hardware/audio/effect/2.0/BnEnvironmentalReverbEffect.h",
-        "android/hardware/audio/effect/2.0/BpEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwEnvironmentalReverbEffect.h",
         "android/hardware/audio/effect/2.0/BsEnvironmentalReverbEffect.h",
         "android/hardware/audio/effect/2.0/IEqualizerEffect.h",
         "android/hardware/audio/effect/2.0/IHwEqualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BnEqualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BpEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwEqualizerEffect.h",
         "android/hardware/audio/effect/2.0/BsEqualizerEffect.h",
         "android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h",
         "android/hardware/audio/effect/2.0/IHwLoudnessEnhancerEffect.h",
-        "android/hardware/audio/effect/2.0/BnLoudnessEnhancerEffect.h",
-        "android/hardware/audio/effect/2.0/BpLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwLoudnessEnhancerEffect.h",
         "android/hardware/audio/effect/2.0/BsLoudnessEnhancerEffect.h",
         "android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h",
         "android/hardware/audio/effect/2.0/IHwNoiseSuppressionEffect.h",
-        "android/hardware/audio/effect/2.0/BnNoiseSuppressionEffect.h",
-        "android/hardware/audio/effect/2.0/BpNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwNoiseSuppressionEffect.h",
         "android/hardware/audio/effect/2.0/BsNoiseSuppressionEffect.h",
         "android/hardware/audio/effect/2.0/IPresetReverbEffect.h",
         "android/hardware/audio/effect/2.0/IHwPresetReverbEffect.h",
-        "android/hardware/audio/effect/2.0/BnPresetReverbEffect.h",
-        "android/hardware/audio/effect/2.0/BpPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwPresetReverbEffect.h",
         "android/hardware/audio/effect/2.0/BsPresetReverbEffect.h",
         "android/hardware/audio/effect/2.0/IVirtualizerEffect.h",
         "android/hardware/audio/effect/2.0/IHwVirtualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BnVirtualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BpVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwVirtualizerEffect.h",
         "android/hardware/audio/effect/2.0/BsVirtualizerEffect.h",
         "android/hardware/audio/effect/2.0/IVisualizerEffect.h",
         "android/hardware/audio/effect/2.0/IHwVisualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BnVisualizerEffect.h",
-        "android/hardware/audio/effect/2.0/BpVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnHwVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpHwVisualizerEffect.h",
         "android/hardware/audio/effect/2.0/BsVisualizerEffect.h",
     ],
 }
diff --git a/audio/effect/2.0/IEffect.hal b/audio/effect/2.0/IEffect.hal
index 615a460..9e10117 100644
--- a/audio/effect/2.0/IEffect.hal
+++ b/audio/effect/2.0/IEffect.hal
@@ -83,20 +83,17 @@
 
     /*
      * Set and get volume. Used by audio framework to delegate volume control to
-     * effect engine.  The effect implementation must set EFFECT_FLAG_VOLUME_IND
-     * or EFFECT_FLAG_VOLUME_CTRL flag in its descriptor to receive this command
-     * before every call to 'process' function If EFFECT_FLAG_VOLUME_CTRL flag
-     * is set in the effect descriptor, the effect engine must return the volume
-     * that should be applied before the effect is processed. The overall volume
-     * (the volume actually applied by the effect engine multiplied by the
-     * returned value) should match the value indicated in the command.
+     * effect engine. The effect implementation must set EFFECT_FLAG_VOLUME_CTRL
+     * flag in its descriptor to receive this command. The effect engine must
+     * return the volume that should be applied before the effect is
+     * processed. The overall volume (the volume actually applied by the effect
+     * engine multiplied by the returned value) should match the value indicated
+     * in the command.
      *
      * @param volumes vector containing volume for each channel defined in
      *                EffectConfig for output buffer expressed in 8.24 fixed
      *                point format.
-     * @return result updated volume values. It is OK to receive an empty vector
-     *                as a result in which case the effect framework has
-     *                delegated volume control to another effect.
+     * @return result updated volume values.
      * @return retval operation completion status.
      */
     @callflow(next={"*"})
@@ -104,6 +101,19 @@
             generates (Result retval, vec<uint32_t> result);
 
     /*
+     * Notify the effect of the volume change. The effect implementation must
+     * set EFFECT_FLAG_VOLUME_IND flag in its descriptor to receive this
+     * command.
+     *
+     * @param volumes vector containing volume for each channel defined in
+     *                EffectConfig for output buffer expressed in 8.24 fixed
+     *                point format.
+     * @return retval operation completion status.
+     */
+    volumeChangeNotification(vec<uint32_t> volumes)
+            generates (Result retval);
+
+    /*
      * Set the audio mode. The effect implementation must set
      * EFFECT_FLAG_AUDIO_MODE_IND flag in its descriptor to receive this command
      * when the audio mode changes.
@@ -226,49 +236,47 @@
     getDescriptor() generates (Result retval, EffectDescriptor descriptor);
 
     /*
-     * Effect process function. Takes input samples as specified (count and
-     * location) in input buffer and returns processed samples as specified in
-     * output buffer. If the buffer descriptor is empty the function must use
-     * either the buffer or the buffer provider callback installed by the
-     * setConfig command.  The effect framework must call the 'process' function
-     * after the 'enable' command is received and until the 'disable' is
-     * received. When the engine receives the 'disable' command it should turn
-     * off the effect gracefully and when done indicate that it is OK to stop
-     * calling the 'process' function by returning the INVALID_STATE status.
+     * Set up required transports for passing audio buffers to the effect.
      *
-     * Output audio buffer must contain no more frames than the input audio
-     * buffer. Since the effect may transform input channels into a different
-     * amount of channels, the caller provides the output frame size.
+     * The transport consists of shared memory and a message queue for reporting
+     * effect processing operation status. The shared memory is set up
+     * separately using 'setProcessBuffers' method.
      *
-     * @param inBuffer input audio buffer.
-     * @param outFrameSize output frame size in bytes.
-     * @return retval operation completion status.
-     * @return outBuffer output audio buffer.
+     * Processing is requested by setting 'REQUEST_PROCESS' or
+     * 'REQUEST_PROCESS_REVERSE' EventFlags associated with the status message
+     * queue. The result of processing may be one of the following:
+     *   OK if there were no errors during processing;
+     *   INVALID_ARGUMENTS if audio buffers are invalid;
+     *   INVALID_STATE if the engine has finished the disable phase;
+     *   NOT_INITIALIZED if the audio buffers were not set;
+     *   NOT_SUPPORTED if the requested processing type is not supported by
+     *                 the effect.
+     *
+     * @return retval OK if both message queues were created successfully.
+     *                INVALID_STATE if the method was already called.
+     *                INVALID_ARGUMENTS if there was a problem setting up
+     *                                  the queue.
+     * @return statusMQ a message queue used for passing status from the effect.
      */
-    // TODO(mnaganov): replace with FMQ version.
-    @callflow(next={"*"})
-    process(AudioBuffer inBuffer, uint32_t outFrameSize)
-            generates (Result retval, AudioBuffer outBuffer);
+    prepareForProcessing() generates (Result retval, fmq_sync<Result> statusMQ);
 
     /*
-     * Process reverse stream function. This function is used to pass a
-     * reference stream to the effect engine. If the engine does not need a
-     * reference stream, this function MUST return NOT_SUPPORTED. For example,
-     * this function would typically implemented by an Echo Canceler.
+     * Set up input and output buffers for processing audio data. The effect
+     * may modify both the input and the output buffer during the operation.
+     * Buffers may be set multiple times during effect lifetime.
      *
-     * Output audio buffer must contain no more frames than the input audio
-     * buffer. Since the effect may transform input channels into a different
-     * amount of channels, the caller provides the output frame size.
+     * The input and the output buffer may be reused between different effects,
+     * and the input buffer may be used as an output buffer. Buffers are
+     * distinguished using 'AudioBuffer.id' field.
      *
      * @param inBuffer input audio buffer.
-     * @param outFrameSize output frame size in bytes.
-     * @return retval operation completion status.
-     * @return outBuffer output audio buffer.
+     * @param outBuffer output audio buffer.
+     * @return retval OK if both buffers were mapped successfully.
+     *                INVALID_ARGUMENTS if there was a problem with mapping
+     *                                  any of the buffers.
      */
-    // TODO(mnaganov): replace with FMQ version.
-    @callflow(next={"*"})
-    processReverse(AudioBuffer inBuffer, uint32_t outFrameSize)
-            generates (Result retval, AudioBuffer outBuffer);
+    setProcessBuffers(AudioBuffer inBuffer, AudioBuffer outBuffer) generates (
+            Result retval);
 
     /*
      * Execute a vendor specific command on the effect. The command code
@@ -406,4 +414,14 @@
      */
     setCurrentConfigForFeature(uint32_t featureId, vec<uint8_t> configData)
             generates (Result retval);
+
+    /*
+     * Called by the framework to deinitialize the effect and free up
+     * all the currently allocated resources. It is recommended to close
+     * the effect on the client side as soon as it is becomes unused.
+     *
+     * @return retval OK in case the success.
+     *                INVALID_STATE if the effect was already closed.
+     */
+    close() generates (Result retval);
 };
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
index 341466f..7b9ca30 100644
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
+++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
@@ -66,6 +66,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> AcousticEchoCancelerEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> AcousticEchoCancelerEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -115,16 +120,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> AcousticEchoCancelerEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> AcousticEchoCancelerEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> AcousticEchoCancelerEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> AcousticEchoCancelerEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> AcousticEchoCancelerEffect::command(
@@ -167,6 +170,10 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> AcousticEchoCancelerEffect::close() {
+    return mEffect->close();
+}
+
 // Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
 Return<Result> AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs)  {
     return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs);
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
index 71fcc97..1ac925d 100644
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
+++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
@@ -54,6 +54,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -69,12 +70,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -97,6 +95,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
     Return<Result> setEchoDelay(uint32_t echoDelayMs)  override;
diff --git a/audio/effect/2.0/default/Android.mk b/audio/effect/2.0/default/Android.mk
index 9b99737..18076ed 100644
--- a/audio/effect/2.0/default/Android.mk
+++ b/audio/effect/2.0/default/Android.mk
@@ -5,6 +5,7 @@
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SRC_FILES := \
     AcousticEchoCancelerEffect.cpp \
+    AudioBufferManager.cpp \
     AutomaticGainControlEffect.cpp \
     BassBoostEffect.cpp \
     Conversions.cpp \
@@ -20,14 +21,19 @@
     VisualizerEffect.cpp \
 
 LOCAL_SHARED_LIBRARIES := \
+    libbase \
+    libcutils \
+    libeffects \
+    libfmq \
     libhidlbase \
+    libhidlmemory \
     libhidltransport \
     libhwbinder \
-    libutils \
-    libeffects \
     liblog \
+    libutils \
     android.hardware.audio.common@2.0 \
     android.hardware.audio.common@2.0-util \
     android.hardware.audio.effect@2.0 \
+    android.hidl.memory@1.0 \
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/audio/effect/2.0/default/AudioBufferManager.cpp b/audio/effect/2.0/default/AudioBufferManager.cpp
new file mode 100644
index 0000000..603dbb8
--- /dev/null
+++ b/audio/effect/2.0/default/AudioBufferManager.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <atomic>
+
+#include <hidlmemory/mapping.h>
+
+#include "AudioBufferManager.h"
+
+namespace android {
+
+ANDROID_SINGLETON_STATIC_INSTANCE(AudioBufferManager);
+
+bool AudioBufferManager::wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper) {
+    // Check if we have this buffer already
+    std::lock_guard<std::mutex> lock(mLock);
+    ssize_t idx = mBuffers.indexOfKey(buffer.id);
+    if (idx >= 0) {
+        *wrapper = mBuffers[idx].promote();
+        if (*wrapper != nullptr) return true;
+        mBuffers.removeItemsAt(idx);
+    }
+    // Need to create and init a new AudioBufferWrapper.
+    sp<AudioBufferWrapper> tempBuffer(new AudioBufferWrapper(buffer));
+    if (!tempBuffer->init()) return false;
+    *wrapper = tempBuffer;
+    mBuffers.add(buffer.id, *wrapper);
+    return true;
+}
+
+void AudioBufferManager::removeEntry(uint64_t id) {
+    std::lock_guard<std::mutex> lock(mLock);
+    ssize_t idx = mBuffers.indexOfKey(id);
+    if (idx >= 0) mBuffers.removeItemsAt(idx);
+}
+
+namespace hardware {
+namespace audio {
+namespace effect {
+namespace V2_0 {
+namespace implementation {
+
+AudioBufferWrapper::AudioBufferWrapper(const AudioBuffer& buffer) :
+        mHidlBuffer(buffer), mHalBuffer{ 0, { nullptr } } {
+}
+
+AudioBufferWrapper::~AudioBufferWrapper() {
+    AudioBufferManager::getInstance().removeEntry(mHidlBuffer.id);
+}
+
+bool AudioBufferWrapper::init() {
+    if (mHalBuffer.raw != nullptr) {
+        ALOGE("An attempt to init AudioBufferWrapper twice");
+        return false;
+    }
+    mHidlMemory = mapMemory(mHidlBuffer.data);
+    if (mHidlMemory == nullptr) {
+        ALOGE("Could not map HIDL memory to IMemory");
+        return false;
+    }
+    mHalBuffer.raw = static_cast<void*>(mHidlMemory->getPointer());
+    if (mHalBuffer.raw == nullptr) {
+        ALOGE("IMemory buffer pointer is null");
+        return false;
+    }
+    mHalBuffer.frameCount = mHidlBuffer.frameCount;
+    return true;
+}
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace effect
+}  // namespace audio
+}  // namespace hardware
+}  // namespace android
diff --git a/audio/effect/2.0/default/AudioBufferManager.h b/audio/effect/2.0/default/AudioBufferManager.h
new file mode 100644
index 0000000..6d65995
--- /dev/null
+++ b/audio/effect/2.0/default/AudioBufferManager.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_audio_effect_V2_0_AudioBufferManager_H_
+#define android_hardware_audio_effect_V2_0_AudioBufferManager_H_
+
+#include <mutex>
+
+#include <android/hardware/audio/effect/2.0/types.h>
+#include <android/hidl/memory/1.0/IMemory.h>
+#include <system/audio_effect.h>
+#include <utils/RefBase.h>
+#include <utils/KeyedVector.h>
+#include <utils/Singleton.h>
+
+using ::android::hardware::audio::effect::V2_0::AudioBuffer;
+using ::android::hidl::memory::V1_0::IMemory;
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace effect {
+namespace V2_0 {
+namespace implementation {
+
+class AudioBufferWrapper : public RefBase {
+  public:
+    explicit AudioBufferWrapper(const AudioBuffer& buffer);
+    virtual ~AudioBufferWrapper();
+    bool init();
+    audio_buffer_t* getHalBuffer() { return &mHalBuffer; }
+  private:
+    AudioBufferWrapper(const AudioBufferWrapper&) = delete;
+    void operator=(AudioBufferWrapper) = delete;
+
+    AudioBuffer mHidlBuffer;
+    sp<IMemory> mHidlMemory;
+    audio_buffer_t mHalBuffer;
+};
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace effect
+}  // namespace audio
+}  // namespace hardware
+}  // namespace android
+
+using ::android::hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
+
+namespace android {
+
+// This class needs to be in 'android' ns because Singleton macros require that.
+class AudioBufferManager : public Singleton<AudioBufferManager> {
+  public:
+    bool wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper);
+
+  private:
+    friend class hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
+
+    // Called by AudioBufferWrapper.
+    void removeEntry(uint64_t id);
+
+    std::mutex mLock;
+    KeyedVector<uint64_t, wp<AudioBufferWrapper>> mBuffers;
+};
+
+}  // namespace android
+
+#endif  // android_hardware_audio_effect_V2_0_AudioBufferManager_H_
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
index 6ebfb3c..62fe5f7 100644
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
+++ b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
@@ -81,6 +81,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> AutomaticGainControlEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> AutomaticGainControlEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -130,16 +135,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> AutomaticGainControlEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> AutomaticGainControlEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> AutomaticGainControlEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> AutomaticGainControlEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> AutomaticGainControlEffect::command(
@@ -182,6 +185,10 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> AutomaticGainControlEffect::close() {
+    return mEffect->close();
+}
+
 // Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
 Return<Result> AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb)  {
     return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb);
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.h b/audio/effect/2.0/default/AutomaticGainControlEffect.h
index 1696d3c..5e1f279 100644
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.h
+++ b/audio/effect/2.0/default/AutomaticGainControlEffect.h
@@ -56,6 +56,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -71,12 +72,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -99,6 +97,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
     Return<Result> setTargetLevel(int16_t targetLevelMb)  override;
diff --git a/audio/effect/2.0/default/BassBoostEffect.cpp b/audio/effect/2.0/default/BassBoostEffect.cpp
index 8a64806..8f35e5f 100644
--- a/audio/effect/2.0/default/BassBoostEffect.cpp
+++ b/audio/effect/2.0/default/BassBoostEffect.cpp
@@ -66,6 +66,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> BassBoostEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> BassBoostEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -115,16 +120,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> BassBoostEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> BassBoostEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> BassBoostEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> BassBoostEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> BassBoostEffect::command(
@@ -167,6 +170,10 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> BassBoostEffect::close() {
+    return mEffect->close();
+}
+
 // Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
 Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb)  {
     return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb);
diff --git a/audio/effect/2.0/default/BassBoostEffect.h b/audio/effect/2.0/default/BassBoostEffect.h
index 6636717..1e5053b 100644
--- a/audio/effect/2.0/default/BassBoostEffect.h
+++ b/audio/effect/2.0/default/BassBoostEffect.h
@@ -54,6 +54,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -69,12 +70,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -97,6 +95,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
     Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb)  override;
diff --git a/audio/effect/2.0/default/DownmixEffect.cpp b/audio/effect/2.0/default/DownmixEffect.cpp
index 40bb5ec..92f15bd 100644
--- a/audio/effect/2.0/default/DownmixEffect.cpp
+++ b/audio/effect/2.0/default/DownmixEffect.cpp
@@ -66,6 +66,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> DownmixEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> DownmixEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -115,16 +120,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> DownmixEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> DownmixEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> DownmixEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> DownmixEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> DownmixEffect::command(
@@ -167,6 +170,10 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> DownmixEffect::close() {
+    return mEffect->close();
+}
+
 // Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
 Return<Result> DownmixEffect::setType(IDownmixEffect::Type preset)  {
     return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast<downmix_type_t>(preset));
diff --git a/audio/effect/2.0/default/DownmixEffect.h b/audio/effect/2.0/default/DownmixEffect.h
index c7e1b9b..125f34d 100644
--- a/audio/effect/2.0/default/DownmixEffect.h
+++ b/audio/effect/2.0/default/DownmixEffect.h
@@ -54,6 +54,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -69,12 +70,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -97,6 +95,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
     Return<Result> setType(IDownmixEffect::Type preset)  override;
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
index 1a7ea9c..3c97fc4 100644
--- a/audio/effect/2.0/default/Effect.cpp
+++ b/audio/effect/2.0/default/Effect.cpp
@@ -17,8 +17,8 @@
 #include <memory.h>
 
 #define LOG_TAG "EffectHAL"
-#include <media/EffectsFactoryApi.h>
 #include <android/log.h>
+#include <media/EffectsFactoryApi.h>
 
 #include "Conversions.h"
 #include "Effect.h"
@@ -33,20 +33,108 @@
 
 using ::android::hardware::audio::common::V2_0::AudioChannelMask;
 using ::android::hardware::audio::common::V2_0::AudioFormat;
+using ::android::hardware::audio::effect::V2_0::MessageQueueFlagBits;
+
+namespace {
+
+class ProcessThread : public Thread {
+  public:
+    // ProcessThread's lifespan never exceeds Effect's lifespan.
+    ProcessThread(std::atomic<bool>* stop,
+            effect_handle_t effect,
+            std::atomic<audio_buffer_t*>* inBuffer,
+            std::atomic<audio_buffer_t*>* outBuffer,
+            Effect::StatusMQ* statusMQ,
+            EventFlag* efGroup)
+            : Thread(false /*canCallJava*/),
+              mStop(stop),
+              mEffect(effect),
+              mHasProcessReverse((*mEffect)->process_reverse != NULL),
+              mInBuffer(inBuffer),
+              mOutBuffer(outBuffer),
+              mStatusMQ(statusMQ),
+              mEfGroup(efGroup) {
+    }
+    virtual ~ProcessThread() {}
+
+  private:
+    std::atomic<bool>* mStop;
+    effect_handle_t mEffect;
+    bool mHasProcessReverse;
+    std::atomic<audio_buffer_t*>* mInBuffer;
+    std::atomic<audio_buffer_t*>* mOutBuffer;
+    Effect::StatusMQ* mStatusMQ;
+    EventFlag* mEfGroup;
+
+    bool threadLoop() override;
+};
+
+bool ProcessThread::threadLoop() {
+    // This implementation doesn't return control back to the Thread until it decides to stop,
+    // as the Thread uses mutexes, and this can lead to priority inversion.
+    while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
+        uint32_t efState = 0;
+        mEfGroup->wait(
+                static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL),
+                &efState,
+                NS_PER_SEC);
+        if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL))) {
+            continue;  // Nothing to do.
+        }
+        Result retval = Result::OK;
+        if (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_REVERSE)
+                && !mHasProcessReverse) {
+            retval = Result::NOT_SUPPORTED;
+        }
+
+        if (retval == Result::OK) {
+            // affects both buffer pointers and their contents.
+            std::atomic_thread_fence(std::memory_order_acquire);
+            int32_t processResult;
+            audio_buffer_t* inBuffer =
+                    std::atomic_load_explicit(mInBuffer, std::memory_order_relaxed);
+            audio_buffer_t* outBuffer =
+                    std::atomic_load_explicit(mOutBuffer, std::memory_order_relaxed);
+            if (inBuffer != nullptr && outBuffer != nullptr) {
+                if (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS)) {
+                    processResult = (*mEffect)->process(mEffect, inBuffer, outBuffer);
+                } else {
+                    processResult = (*mEffect)->process_reverse(mEffect, inBuffer, outBuffer);
+                }
+                std::atomic_thread_fence(std::memory_order_release);
+            } else {
+                ALOGE("processing buffers were not set before calling 'process'");
+                processResult = -ENODEV;
+            }
+            switch(processResult) {
+                case 0: retval = Result::OK; break;
+                case -ENODATA: retval = Result::INVALID_STATE; break;
+                case -EINVAL: retval = Result::INVALID_ARGUMENTS; break;
+                default: retval = Result::NOT_INITIALIZED;
+            }
+        }
+        if (!mStatusMQ->write(&retval)) {
+            ALOGW("status message queue write failed");
+        }
+        mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::DONE_PROCESSING));
+    }
+
+    return false;
+}
+
+}  // namespace
 
 // static
 const char *Effect::sContextResultOfCommand = "returned status";
 const char *Effect::sContextCallToCommand = "error";
 const char *Effect::sContextCallFunction = sContextCallToCommand;
 
-Effect::Effect(effect_handle_t handle) : mHandle(handle) {
+Effect::Effect(effect_handle_t handle)
+        : mIsClosed(false), mHandle(handle), mEfGroup(nullptr), mStopProcessThread(false) {
 }
 
 Effect::~Effect() {
-    int status = EffectRelease(mHandle);
-    ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
-    EffectMap::getInstance().remove(mHandle);
-    mHandle = 0;
+    close();
 }
 
 // static
@@ -83,9 +171,6 @@
 // static
 void Effect::effectBufferConfigFromHal(
         const buffer_config_t& halConfig, EffectBufferConfig* config) {
-    // TODO(mnaganov): Use FMQ instead of AudioBuffer.
-    (void)halConfig.buffer.frameCount;
-    (void)halConfig.buffer.raw;
     config->samplingRateHz = halConfig.samplingRate;
     config->channels = AudioChannelMask(halConfig.channels);
     config->format = AudioFormat(halConfig.format);
@@ -95,12 +180,13 @@
 
 // static
 void Effect::effectBufferConfigToHal(const EffectBufferConfig& config, buffer_config_t* halConfig) {
-    // TODO(mnaganov): Use FMQ instead of AudioBuffer.
+    // Note: setting the buffers directly is considered obsolete. They need to be set
+    // using 'setProcessBuffers'.
     halConfig->buffer.frameCount = 0;
     halConfig->buffer.raw = NULL;
     halConfig->samplingRate = config.samplingRateHz;
     halConfig->channels = static_cast<uint32_t>(config.channels);
-    // TODO(mnaganov): As the calling code does not use BP for now, implement later.
+    // TODO(mnaganov): The framework code currently does not use BP, implement later.
     halConfig->bufferProvider.cookie = NULL;
     halConfig->bufferProvider.getBuffer = NULL;
     halConfig->bufferProvider.releaseBuffer = NULL;
@@ -250,31 +336,66 @@
             });
 }
 
-void Effect::processImpl(
-        ProcessFunction process,
-        const char* funcName,
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        ProcessCallback cb) {
-    audio_buffer_t halInBuffer;
-    halInBuffer.frameCount = inBuffer.frameCount;
-    halInBuffer.u8 = const_cast<uint8_t*>(&inBuffer.data[0]);
-    audio_buffer_t halOutBuffer;
-    halOutBuffer.frameCount = halInBuffer.frameCount;
-    // TODO(mnaganov): Consider stashing the buffer to avoid reallocating it every time.
-    std::unique_ptr<uint8_t[]> halOutBufferData(
-            new uint8_t[halOutBuffer.frameCount * outFrameSize]);
-    halOutBuffer.u8 = &halOutBufferData[0];
-    status_t status = process(mHandle, &halInBuffer, &halOutBuffer);
-    Result retval = analyzeStatus(funcName, "", sContextCallFunction, status);
-    AudioBuffer outBuffer;
-    if (status == OK) {
-        outBuffer.frameCount = halOutBuffer.frameCount;
-        outBuffer.data.setToExternal(halOutBuffer.u8, halOutBuffer.frameCount * outFrameSize);
-    } else {
-        outBuffer.frameCount = 0;
+Return<void> Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) {
+    status_t status;
+    // Create message queue.
+    if (mStatusMQ) {
+        ALOGE("the client attempts to call prepareForProcessing_cb twice");
+        _hidl_cb(Result::INVALID_STATE, StatusMQ::Descriptor());
+        return Void();
     }
-    cb(retval, outBuffer);
+    std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1, true /*EventFlag*/));
+    if (!tempStatusMQ->isValid()) {
+        ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
+        _hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
+        return Void();
+    }
+    status = EventFlag::createEventFlag(tempStatusMQ->getEventFlagWord(), &mEfGroup);
+    if (status != OK || !mEfGroup) {
+        ALOGE("failed creating event flag for status MQ: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
+        return Void();
+    }
+
+    // Create and launch the thread.
+    mProcessThread = new ProcessThread(
+            &mStopProcessThread,
+            mHandle,
+            &mHalInBufferPtr,
+            &mHalOutBufferPtr,
+            tempStatusMQ.get(),
+            mEfGroup);
+    status = mProcessThread->run("effect", PRIORITY_URGENT_AUDIO);
+    if (status != OK) {
+        ALOGW("failed to start effect processing thread: %s", strerror(-status));
+        _hidl_cb(Result::INVALID_ARGUMENTS, MQDescriptorSync<Result>());
+        return Void();
+    }
+
+    mStatusMQ = std::move(tempStatusMQ);
+    _hidl_cb(Result::OK, *mStatusMQ->getDesc());
+    return Void();
+}
+
+Return<Result> Effect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    AudioBufferManager& manager = AudioBufferManager::getInstance();
+    sp<AudioBufferWrapper> tempInBuffer, tempOutBuffer;
+    if (!manager.wrap(inBuffer, &tempInBuffer)) {
+        ALOGE("Could not map memory of the input buffer");
+        return Result::INVALID_ARGUMENTS;
+    }
+    if (!manager.wrap(outBuffer, &tempOutBuffer)) {
+        ALOGE("Could not map memory of the output buffer");
+        return Result::INVALID_ARGUMENTS;
+    }
+    mInBuffer = tempInBuffer;
+    mOutBuffer = tempOutBuffer;
+    // The processing thread only reads these pointers after waking up by an event flag,
+    // so it's OK to update the pair non-atomically.
+    mHalInBufferPtr.store(mInBuffer->getHalBuffer(), std::memory_order_release);
+    mHalOutBufferPtr.store(mOutBuffer->getHalBuffer(), std::memory_order_release);
+    return Result::OK;
 }
 
 Result Effect::sendCommand(int commandCode, const char* commandName) {
@@ -412,6 +533,14 @@
     return Void();
 }
 
+Return<Result> Effect::volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  {
+    uint32_t halDataSize;
+    std::unique_ptr<uint8_t[]> halData = hidlVecToHal(volumes, &halDataSize);
+    return sendCommand(
+            EFFECT_CMD_SET_VOLUME, "SET_VOLUME",
+            halDataSize, &halData[0]);
+}
+
 Return<Result> Effect::setAudioMode(AudioMode mode)  {
     uint32_t halMode = static_cast<uint32_t>(mode);
     return sendCommand(
@@ -510,23 +639,6 @@
     return Void();
 }
 
-Return<void> Effect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  {
-    processImpl((*mHandle)->process, "process", inBuffer, outFrameSize, _hidl_cb);
-    return Void();
-}
-
-Return<void> Effect::processReverse(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, processReverse_cb _hidl_cb)  {
-    if ((*mHandle)->process_reverse != NULL) {
-        processImpl(
-                (*mHandle)->process_reverse, "process_reverse", inBuffer, outFrameSize, _hidl_cb);
-    } else {
-        _hidl_cb(Result::NOT_SUPPORTED, AudioBuffer());
-    }
-    return Void();
-}
-
 Return<void> Effect::command(
         uint32_t commandId,
         const hidl_vec<uint8_t>& data,
@@ -537,10 +649,13 @@
     uint32_t halResultSize = resultMaxSize;
     std::unique_ptr<uint8_t[]> halResult(new uint8_t[halResultSize]);
     memset(&halResult[0], 0, halResultSize);
+
+    void* dataPtr = halDataSize > 0 ? &halData[0] : NULL;
+    void* resultPtr = halResultSize > 0 ? &halResult[0] : NULL;
     status_t status = (*mHandle)->command(
-            mHandle, commandId, halDataSize, &halData[0], &halResultSize, &halResult[0]);
+            mHandle, commandId, halDataSize, dataPtr, &halResultSize, resultPtr);
     hidl_vec<uint8_t> result;
-    if (status == OK) {
+    if (status == OK && resultPtr != NULL) {
         result.setToExternal(&halResult[0], halResultSize);
     }
     _hidl_cb(status, result);
@@ -611,6 +726,27 @@
             EFFECT_CMD_SET_FEATURE_CONFIG, "SET_FEATURE_CONFIG", sizeof(halCmd), halCmd);
 }
 
+Return<Result> Effect::close() {
+    if (mIsClosed) return Result::INVALID_STATE;
+    mIsClosed = true;
+    if (mProcessThread.get()) {
+        mStopProcessThread.store(true, std::memory_order_release);
+        status_t status = mProcessThread->requestExitAndWait();
+        ALOGE_IF(status, "processing thread exit error: %s", strerror(-status));
+    }
+    if (mEfGroup) {
+        status_t status = EventFlag::deleteEventFlag(&mEfGroup);
+        ALOGE_IF(status, "processing MQ event flag deletion error: %s", strerror(-status));
+    }
+    mInBuffer.clear();
+    mOutBuffer.clear();
+    int status = EffectRelease(mHandle);
+    ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
+    EffectMap::getInstance().remove(mHandle);
+    mHandle = 0;
+    return Result::OK;
+}
+
 } // namespace implementation
 }  // namespace V2_0
 }  // namespace effect
diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h
index 61d0121..13faec4 100644
--- a/audio/effect/2.0/default/Effect.h
+++ b/audio/effect/2.0/default/Effect.h
@@ -17,16 +17,21 @@
 #ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
 #define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
 
+#include <atomic>
 #include <memory>
 #include <vector>
 
 #include <android/hardware/audio/effect/2.0/IEffect.h>
-#include <hidl/Status.h>
-
+#include <fmq/EventFlag.h>
+#include <fmq/MessageQueue.h>
 #include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <utils/Thread.h>
 
 #include <hardware/audio_effect.h>
 
+#include "AudioBufferManager.h"
+
 namespace android {
 namespace hardware {
 namespace audio {
@@ -54,6 +59,8 @@
 using ::android::sp;
 
 struct Effect : public IEffect {
+    typedef MessageQueue<Result, kSynchronizedReadWrite> StatusMQ;
+
     explicit Effect(effect_handle_t handle);
 
     // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
@@ -68,6 +75,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -83,12 +91,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -111,6 +116,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Utility methods for extending interfaces.
     template<typename T> Return<void> getIntegerParam(
@@ -161,8 +167,6 @@
     friend struct VirtualizerEffect;  // for getParameterImpl
     friend struct VisualizerEffect;   // to allow executing commands
 
-    typedef int32_t (*ProcessFunction)(
-            effect_handle_t self, audio_buffer_t* inBuffer, audio_buffer_t* outBuffer);
     using CommandSuccessCallback = std::function<void()>;
     using GetConfigCallback = std::function<void(Result retval, const EffectConfig& config)>;
     using GetCurrentConfigSuccessCallback = std::function<void(void* configData)>;
@@ -170,13 +174,21 @@
             std::function<void(uint32_t valueSize, const void* valueData)>;
     using GetSupportedConfigsSuccessCallback =
             std::function<void(uint32_t supportedConfigs, void* configsData)>;
-    using ProcessCallback = std::function<void(Result retval, const AudioBuffer& outBuffer)>;
 
     static const char *sContextResultOfCommand;
     static const char *sContextCallToCommand;
     static const char *sContextCallFunction;
 
+    bool mIsClosed;
     effect_handle_t mHandle;
+    sp<AudioBufferWrapper> mInBuffer;
+    sp<AudioBufferWrapper> mOutBuffer;
+    std::atomic<audio_buffer_t*> mHalInBufferPtr;
+    std::atomic<audio_buffer_t*> mHalOutBufferPtr;
+    std::unique_ptr<StatusMQ> mStatusMQ;
+    EventFlag* mEfGroup;
+    std::atomic<bool> mStopProcessThread;
+    sp<Thread> mProcessThread;
 
     virtual ~Effect();
 
@@ -218,12 +230,6 @@
             uint32_t maxConfigs,
             uint32_t configSize,
             GetSupportedConfigsSuccessCallback onSuccess);
-    void processImpl(
-            ProcessFunction process,
-            const char* funcName,
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            ProcessCallback cb);
     Result sendCommand(int commandCode, const char* commandName);
     Result sendCommand(int commandCode, const char* commandName, uint32_t size, void* data);
     Result sendCommandReturningData(
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
index db1ad51..86ff368 100644
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
+++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
@@ -95,6 +95,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> EnvironmentalReverbEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> EnvironmentalReverbEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -144,16 +149,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> EnvironmentalReverbEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> EnvironmentalReverbEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> EnvironmentalReverbEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> EnvironmentalReverbEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> EnvironmentalReverbEffect::command(
@@ -196,6 +199,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> EnvironmentalReverbEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
 Return<Result> EnvironmentalReverbEffect::setBypass(bool bypass)  {
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.h b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
index edb5747..794caac 100644
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.h
+++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
@@ -66,6 +66,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -81,12 +82,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -109,6 +107,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
     Return<Result> setBypass(bool bypass)  override;
diff --git a/audio/effect/2.0/default/EqualizerEffect.cpp b/audio/effect/2.0/default/EqualizerEffect.cpp
index 490a300..223716c 100644
--- a/audio/effect/2.0/default/EqualizerEffect.cpp
+++ b/audio/effect/2.0/default/EqualizerEffect.cpp
@@ -86,6 +86,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> EqualizerEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> EqualizerEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -135,16 +140,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> EqualizerEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> EqualizerEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> EqualizerEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> EqualizerEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> EqualizerEffect::command(
@@ -187,6 +190,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> EqualizerEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
 Return<void> EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb)  {
diff --git a/audio/effect/2.0/default/EqualizerEffect.h b/audio/effect/2.0/default/EqualizerEffect.h
index ba99e2b..c9bed4f 100644
--- a/audio/effect/2.0/default/EqualizerEffect.h
+++ b/audio/effect/2.0/default/EqualizerEffect.h
@@ -68,6 +68,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -83,12 +84,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -111,6 +109,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
     Return<void> getNumBands(getNumBands_cb _hidl_cb)  override;
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
index a49019c..e58b42c 100644
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
+++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
@@ -68,6 +68,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> LoudnessEnhancerEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> LoudnessEnhancerEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -117,16 +122,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> LoudnessEnhancerEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> LoudnessEnhancerEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> LoudnessEnhancerEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> LoudnessEnhancerEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> LoudnessEnhancerEffect::command(
@@ -169,6 +172,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> LoudnessEnhancerEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
 Return<Result> LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb)  {
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.h b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
index 8ca6e94..039b8d6 100644
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.h
+++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
@@ -64,6 +64,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -79,12 +80,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -107,6 +105,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
     Return<Result> setTargetGain(int32_t targetGainMb)  override;
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
index 69a1226..7c4e06d 100644
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
+++ b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
@@ -79,6 +79,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> NoiseSuppressionEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> NoiseSuppressionEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -128,16 +133,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> NoiseSuppressionEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> NoiseSuppressionEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> NoiseSuppressionEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> NoiseSuppressionEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> NoiseSuppressionEffect::command(
@@ -180,6 +183,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> NoiseSuppressionEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
 Return<Result> NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level)  {
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.h b/audio/effect/2.0/default/NoiseSuppressionEffect.h
index b73727e..5491201 100644
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.h
+++ b/audio/effect/2.0/default/NoiseSuppressionEffect.h
@@ -66,6 +66,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -81,12 +82,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -109,6 +107,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
     Return<Result> setSuppressionLevel(INoiseSuppressionEffect::Level level)  override;
diff --git a/audio/effect/2.0/default/PresetReverbEffect.cpp b/audio/effect/2.0/default/PresetReverbEffect.cpp
index 0e6d1b8..5f17791 100644
--- a/audio/effect/2.0/default/PresetReverbEffect.cpp
+++ b/audio/effect/2.0/default/PresetReverbEffect.cpp
@@ -66,6 +66,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> PresetReverbEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> PresetReverbEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -115,16 +120,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> PresetReverbEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> PresetReverbEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> PresetReverbEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> PresetReverbEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> PresetReverbEffect::command(
@@ -167,6 +170,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> PresetReverbEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
 Return<Result> PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset)  {
diff --git a/audio/effect/2.0/default/PresetReverbEffect.h b/audio/effect/2.0/default/PresetReverbEffect.h
index 4d39569..4eb074a 100644
--- a/audio/effect/2.0/default/PresetReverbEffect.h
+++ b/audio/effect/2.0/default/PresetReverbEffect.h
@@ -64,6 +64,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -79,12 +80,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -107,6 +105,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
     Return<Result> setPreset(IPresetReverbEffect::Preset preset)  override;
diff --git a/audio/effect/2.0/default/VirtualizerEffect.cpp b/audio/effect/2.0/default/VirtualizerEffect.cpp
index 313674d..c1fe52f 100644
--- a/audio/effect/2.0/default/VirtualizerEffect.cpp
+++ b/audio/effect/2.0/default/VirtualizerEffect.cpp
@@ -78,6 +78,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> VirtualizerEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> VirtualizerEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -127,16 +132,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> VirtualizerEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> VirtualizerEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> VirtualizerEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> VirtualizerEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> VirtualizerEffect::command(
@@ -179,6 +182,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> VirtualizerEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
 Return<bool> VirtualizerEffect::isStrengthSupported()  {
diff --git a/audio/effect/2.0/default/VirtualizerEffect.h b/audio/effect/2.0/default/VirtualizerEffect.h
index ba89a61..536775f 100644
--- a/audio/effect/2.0/default/VirtualizerEffect.h
+++ b/audio/effect/2.0/default/VirtualizerEffect.h
@@ -65,6 +65,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -80,12 +81,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -108,6 +106,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
     Return<bool> isStrengthSupported()  override;
diff --git a/audio/effect/2.0/default/VisualizerEffect.cpp b/audio/effect/2.0/default/VisualizerEffect.cpp
index a53eabc..2cd3240 100644
--- a/audio/effect/2.0/default/VisualizerEffect.cpp
+++ b/audio/effect/2.0/default/VisualizerEffect.cpp
@@ -66,6 +66,11 @@
     return mEffect->setAndGetVolume(volumes, _hidl_cb);
 }
 
+Return<Result> VisualizerEffect::volumeChangeNotification(
+        const hidl_vec<uint32_t>& volumes) {
+    return mEffect->volumeChangeNotification(volumes);
+}
+
 Return<Result> VisualizerEffect::setAudioMode(AudioMode mode) {
     return mEffect->setAudioMode(mode);
 }
@@ -115,16 +120,14 @@
     return mEffect->getDescriptor(_hidl_cb);
 }
 
-Return<void> VisualizerEffect::process(
-        const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
-    return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> VisualizerEffect::prepareForProcessing(
+        prepareForProcessing_cb _hidl_cb) {
+    return mEffect->prepareForProcessing(_hidl_cb);
 }
 
-Return<void> VisualizerEffect::processReverse(
-        const AudioBuffer& inBuffer,
-        uint32_t outFrameSize,
-        processReverse_cb _hidl_cb) {
-    return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> VisualizerEffect::setProcessBuffers(
+        const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+    return mEffect->setProcessBuffers(inBuffer, outBuffer);
 }
 
 Return<void> VisualizerEffect::command(
@@ -167,6 +170,9 @@
     return mEffect->setCurrentConfigForFeature(featureId, configData);
 }
 
+Return<Result> VisualizerEffect::close() {
+    return mEffect->close();
+}
 
 // Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
 Return<Result> VisualizerEffect::setCaptureSize(uint16_t captureSize)  {
diff --git a/audio/effect/2.0/default/VisualizerEffect.h b/audio/effect/2.0/default/VisualizerEffect.h
index ae0b05c..fd40ca8 100644
--- a/audio/effect/2.0/default/VisualizerEffect.h
+++ b/audio/effect/2.0/default/VisualizerEffect.h
@@ -64,6 +64,7 @@
     Return<Result> setDevice(AudioDevice device)  override;
     Return<void> setAndGetVolume(
             const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
+    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
     Return<Result> setAudioMode(AudioMode mode)  override;
     Return<Result> setConfigReverse(
             const EffectConfig& config,
@@ -79,12 +80,9 @@
     Return<Result> setAudioSource(AudioSource source)  override;
     Return<Result> offload(const EffectOffloadParameter& param)  override;
     Return<void> getDescriptor(getDescriptor_cb _hidl_cb)  override;
-    Return<void> process(
-            const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb)  override;
-    Return<void> processReverse(
-            const AudioBuffer& inBuffer,
-            uint32_t outFrameSize,
-            processReverse_cb _hidl_cb)  override;
+    Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb)  override;
+    Return<Result> setProcessBuffers(
+            const AudioBuffer& inBuffer, const AudioBuffer& outBuffer)  override;
     Return<void> command(
             uint32_t commandId,
             const hidl_vec<uint8_t>& data,
@@ -107,6 +105,7 @@
             getCurrentConfigForFeature_cb _hidl_cb)  override;
     Return<Result> setCurrentConfigForFeature(
             uint32_t featureId, const hidl_vec<uint8_t>& configData)  override;
+    Return<Result> close()  override;
 
     // Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
     Return<Result> setCaptureSize(uint16_t captureSize)  override;
diff --git a/audio/effect/2.0/types.hal b/audio/effect/2.0/types.hal
index ad7f4ce..0cac59a 100644
--- a/audio/effect/2.0/types.hal
+++ b/audio/effect/2.0/types.hal
@@ -222,10 +222,10 @@
  * samples for all channels at a given time. Frame size for unspecified format
  * (AUDIO_FORMAT_OTHER) is 8 bit by definition.
  */
-// TODO(mnaganov): replace with FMQ version.
 struct AudioBuffer {
+    uint64_t id;
     uint32_t frameCount;
-    vec<uint8_t> data;
+    memory data;
 };
 
 @export(name="effect_buffer_access_e", value_prefix="EFFECT_BUFFER_")
@@ -284,3 +284,14 @@
     AudioIoHandle ioHandle;  // io handle of the playback thread
                              // the effect is attached to
 };
+
+/*
+ * The message queue flags used to synchronize reads and writes from
+ * the status message queue used by effects.
+ */
+enum MessageQueueFlagBits : uint32_t {
+    DONE_PROCESSING = 1 << 0,
+    REQUEST_PROCESS = 1 << 1,
+    REQUEST_PROCESS_REVERSE = 1 << 2,
+    REQUEST_PROCESS_ALL = REQUEST_PROCESS | REQUEST_PROCESS_REVERSE
+};
diff --git a/audio/effect/2.0/vts/functional/audio_effect_hidl_hal_test.cpp b/audio/effect/2.0/vts/functional/audio_effect_hidl_hal_test.cpp
index 1e0ab32..9b7d0cf 100644
--- a/audio/effect/2.0/vts/functional/audio_effect_hidl_hal_test.cpp
+++ b/audio/effect/2.0/vts/functional/audio_effect_hidl_hal_test.cpp
@@ -65,7 +65,7 @@
         retval = r;
         effectCount = result.size();
       });
-  EXPECT_EQ(ret.getStatus().exceptionCode(), Status::EX_NONE);
+  EXPECT_TRUE(ret.isOk());
   EXPECT_EQ(retval, Result::OK);
   EXPECT_GT(effectCount, 0u);
 }
@@ -80,7 +80,7 @@
           effectUuid = result[0].uuid;
         }
       });
-  ASSERT_EQ(ret.getStatus().exceptionCode(), Status::EX_NONE);
+  ASSERT_TRUE(ret.isOk());
   ASSERT_TRUE(gotEffect);
   Result retval = Result::NOT_INITIALIZED;
   sp<IEffect> effect;
@@ -92,7 +92,7 @@
           effect = result;
         }
       });
-  EXPECT_EQ(ret.getStatus().exceptionCode(), Status::EX_NONE);
+  EXPECT_TRUE(ret.isOk());
   EXPECT_EQ(retval, Result::OK);
   EXPECT_NE(effect, nullptr);
 }
@@ -105,7 +105,7 @@
           allDescriptors = result;
         }
       });
-  ASSERT_EQ(ret.getStatus().exceptionCode(), Status::EX_NONE);
+  ASSERT_TRUE(ret.isOk());
   ASSERT_GT(allDescriptors.size(), 0u);
   for (size_t i = 0; i < allDescriptors.size(); ++i) {
     ret = effectsFactory->getDescriptor(
@@ -114,7 +114,7 @@
           EXPECT_EQ(result, allDescriptors[i]);
         });
   }
-  EXPECT_EQ(ret.getStatus().exceptionCode(), Status::EX_NONE);
+  EXPECT_TRUE(ret.isOk());
 }
 
 int main(int argc, char** argv) {
diff --git a/boot/Android.mk b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/Android.mk
similarity index 75%
copy from boot/Android.mk
copy to audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/Android.mk
index f9e3276..430600d 100644
--- a/boot/Android.mk
+++ b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalAudioEffectHidlTargetBasicProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/audio/effect/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/AndroidTest.xml b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..7febf26
--- /dev/null
+++ b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Audio Effect HIDL HAL's basic target-side, profiling test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalAudioEffectHidlTargetBasicProfilingTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
+            _64bit::DATA/nativetest64/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/benchmarks/msgq/1.0/Android.bp b/benchmarks/msgq/1.0/Android.bp
index c2c8d0e..b6f4bfd 100644
--- a/benchmarks/msgq/1.0/Android.bp
+++ b/benchmarks/msgq/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/benchmarks/msgq/1.0/IBenchmarkMsgQ.h",
         "android/hardware/benchmarks/msgq/1.0/IHwBenchmarkMsgQ.h",
-        "android/hardware/benchmarks/msgq/1.0/BnBenchmarkMsgQ.h",
-        "android/hardware/benchmarks/msgq/1.0/BpBenchmarkMsgQ.h",
+        "android/hardware/benchmarks/msgq/1.0/BnHwBenchmarkMsgQ.h",
+        "android/hardware/benchmarks/msgq/1.0/BpHwBenchmarkMsgQ.h",
         "android/hardware/benchmarks/msgq/1.0/BsBenchmarkMsgQ.h",
     ],
 }
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index 6f32ad0..02b7328 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/biometrics/fingerprint/2.1/types.h",
         "android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h",
         "android/hardware/biometrics/fingerprint/2.1/IHwBiometricsFingerprint.h",
-        "android/hardware/biometrics/fingerprint/2.1/BnBiometricsFingerprint.h",
-        "android/hardware/biometrics/fingerprint/2.1/BpBiometricsFingerprint.h",
+        "android/hardware/biometrics/fingerprint/2.1/BnHwBiometricsFingerprint.h",
+        "android/hardware/biometrics/fingerprint/2.1/BpHwBiometricsFingerprint.h",
         "android/hardware/biometrics/fingerprint/2.1/BsBiometricsFingerprint.h",
         "android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h",
         "android/hardware/biometrics/fingerprint/2.1/IHwBiometricsFingerprintClientCallback.h",
-        "android/hardware/biometrics/fingerprint/2.1/BnBiometricsFingerprintClientCallback.h",
-        "android/hardware/biometrics/fingerprint/2.1/BpBiometricsFingerprintClientCallback.h",
+        "android/hardware/biometrics/fingerprint/2.1/BnHwBiometricsFingerprintClientCallback.h",
+        "android/hardware/biometrics/fingerprint/2.1/BpHwBiometricsFingerprintClientCallback.h",
         "android/hardware/biometrics/fingerprint/2.1/BsBiometricsFingerprintClientCallback.h",
     ],
 }
diff --git a/drm/drm/1.0/Android.mk b/biometrics/fingerprint/2.1/Android.mk
similarity index 64%
rename from drm/drm/1.0/Android.mk
rename to biometrics/fingerprint/2.1/Android.mk
index 35d3463..22da268 100644
--- a/drm/drm/1.0/Android.mk
+++ b/biometrics/fingerprint/2.1/Android.mk
@@ -5,7 +5,7 @@
 ################################################################################
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.drm.drm@1.0-java
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
 intermediates := $(local-generated-sources-dir)
@@ -17,9 +17,9 @@
 
 
 #
-# Build types.hal (EventType)
+# Build types.hal (FingerprintAcquired)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/EventType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquired.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -29,16 +29,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.EventType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAcquired
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyRequestType)
+# Build types.hal (FingerprintAcquiredInfo)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyRequestType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquiredInfo.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -48,16 +48,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyRequestType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAcquiredInfo
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyStatus)
+# Build types.hal (FingerprintAuthenticated)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyStatus.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAuthenticated.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -67,16 +67,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyStatus
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAuthenticated
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyStatusType)
+# Build types.hal (FingerprintEnroll)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyStatusType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintEnroll.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -86,16 +86,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyStatusType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintEnroll
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyType)
+# Build types.hal (FingerprintError)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintError.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -105,16 +105,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintError
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyValue)
+# Build types.hal (FingerprintFingerId)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyValue.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintFingerId.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -124,16 +124,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyValue
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintFingerId
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (SecureStop)
+# Build types.hal (FingerprintIterator)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/SecureStop.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintIterator.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -143,16 +143,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.SecureStop
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintIterator
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (Status)
+# Build types.hal (FingerprintMsgType)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/Status.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintMsgType.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -162,21 +162,40 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.Status
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintMsgType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build IDrmFactory.hal
+# Build types.hal (RequestStatus)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmFactory.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/RequestStatus.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmFactory.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IDrmPlugin.hal
-$(GEN): $(LOCAL_PATH)/IDrmPlugin.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.biometrics.fingerprint@2.1::types.RequestStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprint.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprint.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
 $(GEN): $(LOCAL_PATH)/types.hal
 $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -185,21 +204,19 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmFactory
+        android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprint
 
-$(GEN): $(LOCAL_PATH)/IDrmFactory.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprint.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build IDrmPlugin.hal
+# Build IBiometricsFingerprintClientCallback.hal
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmPlugin.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprintClientCallback.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmPlugin.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IDrmPluginListener.hal
-$(GEN): $(LOCAL_PATH)/IDrmPluginListener.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
 $(GEN): $(LOCAL_PATH)/types.hal
 $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -208,30 +225,9 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmPlugin
+        android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback
 
-$(GEN): $(LOCAL_PATH)/IDrmPlugin.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build IDrmPluginListener.hal
-#
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmPluginListener.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmPluginListener.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
-$(GEN): $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmPluginListener
-
-$(GEN): $(LOCAL_PATH)/IDrmPluginListener.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 include $(BUILD_JAVA_LIBRARY)
@@ -240,7 +236,7 @@
 ################################################################################
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.drm.drm@1.0-java-static
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
 intermediates := $(local-generated-sources-dir)
@@ -252,9 +248,9 @@
 
 
 #
-# Build types.hal (EventType)
+# Build types.hal (FingerprintAcquired)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/EventType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquired.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -264,16 +260,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.EventType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAcquired
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyRequestType)
+# Build types.hal (FingerprintAcquiredInfo)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyRequestType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquiredInfo.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -283,16 +279,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyRequestType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAcquiredInfo
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyStatus)
+# Build types.hal (FingerprintAuthenticated)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyStatus.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAuthenticated.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -302,16 +298,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyStatus
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintAuthenticated
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyStatusType)
+# Build types.hal (FingerprintEnroll)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyStatusType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintEnroll.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -321,16 +317,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyStatusType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintEnroll
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyType)
+# Build types.hal (FingerprintError)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyType.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintError.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -340,16 +336,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyType
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintError
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (KeyValue)
+# Build types.hal (FingerprintFingerId)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/KeyValue.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintFingerId.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -359,16 +355,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.KeyValue
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintFingerId
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (SecureStop)
+# Build types.hal (FingerprintIterator)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/SecureStop.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintIterator.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -378,16 +374,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.SecureStop
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintIterator
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (Status)
+# Build types.hal (FingerprintMsgType)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/Status.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintMsgType.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -397,21 +393,40 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::types.Status
+        android.hardware.biometrics.fingerprint@2.1::types.FingerprintMsgType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build IDrmFactory.hal
+# Build types.hal (RequestStatus)
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmFactory.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/RequestStatus.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmFactory.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IDrmPlugin.hal
-$(GEN): $(LOCAL_PATH)/IDrmPlugin.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.biometrics.fingerprint@2.1::types.RequestStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprint.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprint.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
 $(GEN): $(LOCAL_PATH)/types.hal
 $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -420,21 +435,19 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmFactory
+        android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprint
 
-$(GEN): $(LOCAL_PATH)/IDrmFactory.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprint.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build IDrmPlugin.hal
+# Build IBiometricsFingerprintClientCallback.hal
 #
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmPlugin.java
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprintClientCallback.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmPlugin.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IDrmPluginListener.hal
-$(GEN): $(LOCAL_PATH)/IDrmPluginListener.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
 $(GEN): $(LOCAL_PATH)/types.hal
 $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -443,30 +456,9 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmPlugin
+        android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback
 
-$(GEN): $(LOCAL_PATH)/IDrmPlugin.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build IDrmPluginListener.hal
-#
-GEN := $(intermediates)/android/hardware/drm/drm/V1_0/IDrmPluginListener.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDrmPluginListener.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
-$(GEN): $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.drm.drm@1.0::IDrmPluginListener
-
-$(GEN): $(LOCAL_PATH)/IDrmPluginListener.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
index 3b24a2c..0b92848 100644
--- a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
+++ b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@
    * This call must block if the HAL state machine is in busy state until HAL
    * leaves the busy state.
    *
-   * @return debugErrno is a value the framework logs in case it is not 0.
+   * @return deviceId is a unique handle for this fingerprint device
    */
   @callflow(next={"setActiveGroup"})
   @entry
   setNotify(IBiometricsFingerprintClientCallback clientCallback)
-      generates (RequestStatus debugErrno);
+      generates (uint64_t deviceId);
 
   /*
    * Fingerprint pre-enroll enroll request:
diff --git a/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal b/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
index 839bcd6..63435d1 100644
--- a/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
+++ b/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,12 +16,60 @@
 
 package android.hardware.biometrics.fingerprint@2.1;
 
+/* This HAL interface communicates asynchronous results from the
+   fingerprint driver in response to user actions on the fingerprint sensor
+*/
 interface IBiometricsFingerprintClientCallback {
-    /* This function is the response channel for all messages
-     * coming from the fingerprint HAL to the framework
-     *
-     * @param msg a union of message structures identified by
-     * FingerprintMsg.type
+    /**
+     * Sent when one enrollment step is complete.
+     * @param deviceId the instance of this fingerprint device
+     * @param fingerId the fingerprint templetate being enrolled
+     * @param groupId the groupid for the template being enrolled
+     * @param remaining the number of remaining steps before enrolllment is complete
      */
-    oneway notify(FingerprintMsg msg);
+    oneway onEnrollResult(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
+
+    /**
+     * Sent when a fingerprint image is acquired by the sensor
+     * @param deviceId the instance of this fingerprint device
+     * @param acquiredInfo a message about the quality of the acquired image
+     * @param vendorCode a vendor-specific message about the quality of the image. Only
+     *        valid when acquiredInfo == ACQUIRED_VENDOR
+     */
+    oneway onAcquired(uint64_t deviceId, FingerprintAcquiredInfo acquiredInfo, int32_t vendorCode);
+
+    /**
+     * Sent when a fingerprint is authenticated
+     * @param deviceId the instance of this fingerprint device
+     * @param fingerId the fingerprint templetate that was authenticated
+     * @param groupId the groupid for the template that was authenticated
+     */
+    oneway onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId);
+
+    /**
+     * Sent when a fingerprint error occurs
+     * @param deviceId the instance of this fingerprint device
+     * @param error a message about the error that occurred
+     * @param vendorCode a vendor-speicifc error message. Only valid
+     *        when error == ERROR_VENDOR
+     */
+    oneway onError(uint64_t deviceId, FingerprintError error, int32_t vendorCode);
+
+    /**
+     * Sent when one template is removed
+     * @param deviceId the instance of this fingerprint device
+     * @param fingerId the fingerprint templetate being removed
+     * @param groupId the groupid for the template being removed
+     * @param remaining the number of remaining templates that will be removed.
+     */
+    oneway onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
+
+    /**
+     * Sent when one fingerprint template is enumerated
+     * @param deviceId the instance of this fingerprint device
+     * @param fingerId the fingerprint for this templetate
+     * @param groupId the groupid for this template
+     * @param remaining the number of remaining steps before enumeration is complete
+     */
+    oneway onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
 };
diff --git a/biometrics/fingerprint/2.1/default/Android.mk b/biometrics/fingerprint/2.1/default/Android.mk
index c487c7a..e5c79fe 100644
--- a/biometrics/fingerprint/2.1/default/Android.mk
+++ b/biometrics/fingerprint/2.1/default/Android.mk
@@ -1,18 +1,22 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-impl
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-service
+LOCAL_INIT_RC := android.hardware.biometrics.fingerprint@2.1-service.rc
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SRC_FILES := \
     BiometricsFingerprint.cpp \
+    service.cpp \
 
 LOCAL_SHARED_LIBRARIES := \
+    libbinder \
     liblog \
     libhidlbase \
     libhidltransport \
     libhardware \
     libhwbinder \
+    libkeystore_binder \
     libutils \
     android.hardware.biometrics.fingerprint@2.1 \
 
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_EXECUTABLE)
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 1316686..eb28e46 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -13,7 +13,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-impl"
+#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service"
+
+// For communication with Keystore binder interface
+#include <binder/IServiceManager.h>
+#include <keystore/IKeystoreService.h>
+#include <keystore/keystore.h> // for error codes
+#include <hardware/hw_auth_token.h>
 
 #include <hardware/hardware.h>
 #include <hardware/fingerprint.h>
@@ -26,14 +32,25 @@
 namespace V2_1 {
 namespace implementation {
 
+// Supported fingerprint HAL version
+static const uint16_t kVersion = HARDWARE_MODULE_API_VERSION(2, 1);
+
 using RequestStatus =
         android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
 
 sp<IBiometricsFingerprintClientCallback>
     BiometricsFingerprint::mClientCallback = nullptr;
 
+// TODO: This is here because HAL 2.1 doesn't have a way to propagate a
+// unique token for its driver. Subsequent versions should send a unique
+// token for each call to notify(). This is fine as long as there's only
+// one fingerprint device on the platform.
+fingerprint_device_t *BiometricsFingerprint::sDevice = nullptr;
+
 BiometricsFingerprint::BiometricsFingerprint(fingerprint_device_t *device)
-    : mDevice(device) {}
+    : mDevice(device) {
+    sDevice = mDevice; // keep track of the most recent instance
+}
 
 BiometricsFingerprint::~BiometricsFingerprint() {
     ALOG(LOG_VERBOSE, LOG_TAG, "nativeCloseHal()\n");
@@ -70,10 +87,68 @@
     }
 }
 
-Return<RequestStatus> BiometricsFingerprint::setNotify(
+// Translate from errors returned by traditional HAL (see fingerprint.h) to
+// HIDL-compliant FingerprintError.
+FingerprintError BiometricsFingerprint::VendorErrorFilter(int32_t error,
+            int32_t* vendorCode) {
+    *vendorCode = 0;
+    switch(error) {
+        case FINGERPRINT_ERROR_HW_UNAVAILABLE:
+            return FingerprintError::ERROR_HW_UNAVAILABLE;
+        case FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
+            return FingerprintError::ERROR_UNABLE_TO_PROCESS;
+        case FINGERPRINT_ERROR_TIMEOUT:
+            return FingerprintError::ERROR_TIMEOUT;
+        case FINGERPRINT_ERROR_NO_SPACE:
+            return FingerprintError::ERROR_NO_SPACE;
+        case FINGERPRINT_ERROR_CANCELED:
+            return FingerprintError::ERROR_CANCELED;
+        case FINGERPRINT_ERROR_UNABLE_TO_REMOVE:
+            return FingerprintError::ERROR_UNABLE_TO_REMOVE;
+        default:
+            if (error >= FINGERPRINT_ERROR_VENDOR_BASE) {
+                // vendor specific code.
+                *vendorCode = error - FINGERPRINT_ERROR_VENDOR_BASE;
+                return FingerprintError::ERROR_VENDOR;
+            }
+    }
+    ALOGE("Unknown error from fingerprint vendor library");
+    return FingerprintError::ERROR_UNABLE_TO_PROCESS;
+}
+
+// Translate acquired messages returned by traditional HAL (see fingerprint.h)
+// to HIDL-compliant FingerprintAcquiredInfo.
+FingerprintAcquiredInfo BiometricsFingerprint::VendorAcquiredFilter(
+        int32_t info, int32_t* vendorCode) {
+    *vendorCode = 0;
+    switch(info) {
+        case FINGERPRINT_ACQUIRED_GOOD:
+            return FingerprintAcquiredInfo::ACQUIRED_GOOD;
+        case FINGERPRINT_ACQUIRED_PARTIAL:
+            return FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
+        case FINGERPRINT_ACQUIRED_INSUFFICIENT:
+            return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
+        case FINGERPRINT_ACQUIRED_IMAGER_DIRTY:
+            return FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
+        case FINGERPRINT_ACQUIRED_TOO_SLOW:
+            return FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
+        case FINGERPRINT_ACQUIRED_TOO_FAST:
+            return FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
+        default:
+            if (info >= FINGERPRINT_ACQUIRED_VENDOR_BASE) {
+                // vendor specific code.
+                *vendorCode = info - FINGERPRINT_ACQUIRED_VENDOR_BASE;
+                return FingerprintAcquiredInfo::ACQUIRED_VENDOR;
+            }
+    }
+    ALOGE("Unknown acquiredmsg from fingerprint vendor library");
+    return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
+}
+
+Return<uint64_t> BiometricsFingerprint::setNotify(
         const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
     mClientCallback = clientCallback;
-    return RequestStatus::SYS_OK;
+    return reinterpret_cast<uint64_t>(mDevice);
 }
 
 Return<uint64_t> BiometricsFingerprint::preEnroll()  {
@@ -121,7 +196,7 @@
     return ErrorFilter(mDevice->authenticate(mDevice, operationId, gid));
 }
 
-IBiometricsFingerprint* HIDL_FETCH_IBiometricsFingerprint(const char*) {
+IBiometricsFingerprint* BiometricsFingerprint::getInstance() {
     int err;
     const hw_module_t *hw_mdl = NULL;
     ALOGE("Opening fingerprint hal library...");
@@ -129,6 +204,7 @@
         ALOGE("Can't open fingerprint HW Module, error: %d", err);
         return nullptr;
     }
+
     if (hw_mdl == NULL) {
         ALOGE("No valid fingerprint module");
         return nullptr;
@@ -148,6 +224,11 @@
         return nullptr;
     }
 
+    if (kVersion != device->version) {
+        ALOGE("Wrong fp version. Expected %d, got %d", kVersion, device->version);
+        return 0; // enforce this on new devices because of HIDL translation layer
+    }
+
     fingerprint_device_t* fp_device =
         reinterpret_cast<fingerprint_device_t*>(device);
 
@@ -160,6 +241,23 @@
     return new BiometricsFingerprint(fp_device);
 }
 
+void BiometricsFingerprint::notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length) {
+    if (auth_token != nullptr && auth_token_length > 0) {
+        // TODO: cache service?
+        sp<IServiceManager> sm = android::defaultServiceManager();
+        sp<IBinder> binder = sm->getService(String16("android.security.keystore"));
+        sp<IKeystoreService> service = interface_cast<IKeystoreService>(binder);
+        if (service != nullptr) {
+            status_t ret = service->addAuthToken(auth_token, auth_token_length);
+            if (ret != ResponseCode::NO_ERROR) {
+                ALOGE("Falure sending auth token to KeyStore: %d", ret);
+            }
+        } else {
+            ALOGE("Unable to communicate with KeyStore");
+        }
+    }
+}
+
 } // namespace implementation
 }  // namespace V2_1
 }  // namespace fingerprint
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 0a8a22c..1f44a1c 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -17,10 +17,13 @@
 #ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
 #define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
 
+#include <log/log.h>
 #include <android/log.h>
+#include <hardware/hardware.h>
+#include <hardware/fingerprint.h>
 #include <hidl/MQDescriptor.h>
-#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
 #include <hidl/Status.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
 
 namespace android {
 namespace hardware {
@@ -42,8 +45,12 @@
 public:
     BiometricsFingerprint(fingerprint_device_t *device);
     ~BiometricsFingerprint();
+
+    // Method to wrap legacy HAL with BiometricsFingerprint class
+    static IBiometricsFingerprint* getInstance();
+
     // Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
-    Return<RequestStatus> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
+    Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
     Return<uint64_t> preEnroll() override;
     Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
     Return<RequestStatus> postEnroll() override;
@@ -53,23 +60,70 @@
     Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
     Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
     Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
-    static void notify(const fingerprint_msg_t *notify_msg) {
+    static void notify(const fingerprint_msg_t *msg) {
         if (mClientCallback == nullptr) {
             ALOGE("Receiving callbacks before the client callback is registered.");
             return;
         }
-        FingerprintMsg msg = {};
-        memcpy(&msg, notify_msg, sizeof(msg));
-        mClientCallback->notify(msg);
+        const uint64_t devId = reinterpret_cast<uint64_t>(sDevice);
+        switch (msg->type) {
+            case FINGERPRINT_ERROR: {
+                int32_t vendorCode = 0;
+                FingerprintError result =
+                    VendorErrorFilter(msg->data.error, &vendorCode);
+                mClientCallback->onError(devId, result, vendorCode);
+                }
+                break;
+            case FINGERPRINT_ACQUIRED: {
+                int32_t vendorCode = 0;
+                FingerprintAcquiredInfo result =
+                    VendorAcquiredFilter(msg->data.acquired.acquired_info,
+                                         &vendorCode);
+                mClientCallback->onAcquired(devId, result, vendorCode);
+                }
+                break;
+            case FINGERPRINT_TEMPLATE_ENROLLING:
+                mClientCallback->onEnrollResult(devId,
+                    msg->data.enroll.finger.fid,
+                    msg->data.enroll.finger.gid,
+                    msg->data.enroll.samples_remaining);
+                break;
+            case FINGERPRINT_TEMPLATE_REMOVED:
+                mClientCallback->onRemoved(devId,
+                    msg->data.removed.finger.fid,
+                    msg->data.removed.finger.gid,
+                    msg->data.removed.remaining_templates);
+                break;
+            case FINGERPRINT_AUTHENTICATED:
+                if (msg->data.authenticated.finger.fid != 0) {
+                    const uint8_t* hat =
+                            reinterpret_cast<const uint8_t *>(&msg->data.authenticated.hat);
+                    notifyKeystore(hat, sizeof(msg->data.authenticated.hat));
+                }
+                mClientCallback->onAuthenticated(devId,
+                    msg->data.authenticated.finger.fid,
+                    msg->data.authenticated.finger.gid);
+                break;
+            case FINGERPRINT_TEMPLATE_ENUMERATING:
+                mClientCallback->onEnumerate(devId,
+                    msg->data.enumerated.finger.fid,
+                    msg->data.enumerated.finger.gid,
+                    msg->data.enumerated.remaining_templates);
+                break;
+        }
     }
 private:
     Return<RequestStatus> ErrorFilter(int32_t error);
+    static void notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length);
+    static FingerprintError VendorErrorFilter(int32_t error,
+            int32_t* vendorCode);
+    static FingerprintAcquiredInfo VendorAcquiredFilter(int32_t error,
+            int32_t* vendorCode);
     static sp<IBiometricsFingerprintClientCallback> mClientCallback;
     fingerprint_device_t *mDevice;
+    static fingerprint_device_t *sDevice; // TODO: allow multiple drivers
 };
 
-extern "C" IBiometricsFingerprint* HIDL_FETCH_IBiometricsFingerprint(const char* name);
-
 }  // namespace implementation
 }  // namespace V2_1
 }  // namespace fingerprint
diff --git a/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc b/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
index 741024d..3de52ad 100644
--- a/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
+++ b/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
@@ -1,4 +1,7 @@
-service fingerprint@2.1 /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
-    class hal
+service fps_hal /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
+    # "class hal" causes a race condition on some devices due to files created
+    # in /data. As a workaround, postpone startup until later in boot once
+    # /data is mounted.
+    class late_start
     user system
-    group system
\ No newline at end of file
+    group system input
diff --git a/biometrics/fingerprint/2.1/default/service.cpp b/biometrics/fingerprint/2.1/default/service.cpp
index 9867039..0563acb 100644
--- a/biometrics/fingerprint/2.1/default/service.cpp
+++ b/biometrics/fingerprint/2.1/default/service.cpp
@@ -16,13 +16,31 @@
 
 #define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service"
 
+#include <android/log.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
 #include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
-
-#include <hidl/LegacySupport.h>
+#include <android/hardware/biometrics/fingerprint/2.1/types.h>
+#include "BiometricsFingerprint.h"
 
 using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
-using android::hardware::defaultPassthroughServiceImplementation;
+using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::sp;
 
 int main() {
-    return defaultPassthroughServiceImplementation<IBiometricsFingerprint>("fingerprint");
+    android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance();
+
+    configureRpcThreadpool(1, true /*callerWillJoin*/);
+
+    if (bio != nullptr) {
+        bio->registerAsService("fingerprint_hal");
+    } else {
+        ALOGE("Can't create instance of BiometricsFingerprint, nullptr");
+    }
+
+    joinRpcThreadpool();
+
+    return 0; // should never get here
 }
diff --git a/biometrics/fingerprint/2.1/types.hal b/biometrics/fingerprint/2.1/types.hal
index 201ec7c..f462906 100644
--- a/biometrics/fingerprint/2.1/types.hal
+++ b/biometrics/fingerprint/2.1/types.hal
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,6 +61,10 @@
   ERROR_CANCELED = 5,
   /* Unable to remove a template */
   ERROR_UNABLE_TO_REMOVE = 6,
+  /* The hardware is in lockout due to too many attempts */
+  ERROR_LOCKOUT = 7,
+  /* Vendor-specific error message */
+  ERROR_VENDOR = 8
 };
 
 /*
@@ -84,7 +88,8 @@
   ACQUIRED_TOO_SLOW = 4,
   /* vendor-specific acquisition messages start here */
   ACQUIRED_TOO_FAST = 5,
-  ACQUIRED_VENDOR_BASE = 1000,
+  /* vendor-specific acquisition messages */
+  ACQUIRED_VENDOR = 6
 };
 
 struct FingerprintFingerId {
@@ -136,15 +141,3 @@
   TEMPLATE_ENUMERATING = 6,
 };
 
-struct FingerprintMsg {
-  /* Selects the payload below */
-  FingerprintMsgType type;
-  union Data {
-    FingerprintError error;
-    FingerprintEnroll enroll;
-    FingerprintEnumerated enumerated;
-    FingerprintRemoved removed;
-    FingerprintAcquired acquired;
-    FingerprintAuthenticated authenticated;
-  } data;
-};
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index 492e624..7928fb6 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/bluetooth/1.0/types.h",
         "android/hardware/bluetooth/1.0/IBluetoothHci.h",
         "android/hardware/bluetooth/1.0/IHwBluetoothHci.h",
-        "android/hardware/bluetooth/1.0/BnBluetoothHci.h",
-        "android/hardware/bluetooth/1.0/BpBluetoothHci.h",
+        "android/hardware/bluetooth/1.0/BnHwBluetoothHci.h",
+        "android/hardware/bluetooth/1.0/BpHwBluetoothHci.h",
         "android/hardware/bluetooth/1.0/BsBluetoothHci.h",
         "android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.h",
         "android/hardware/bluetooth/1.0/IHwBluetoothHciCallbacks.h",
-        "android/hardware/bluetooth/1.0/BnBluetoothHciCallbacks.h",
-        "android/hardware/bluetooth/1.0/BpBluetoothHciCallbacks.h",
+        "android/hardware/bluetooth/1.0/BnHwBluetoothHciCallbacks.h",
+        "android/hardware/bluetooth/1.0/BpHwBluetoothHciCallbacks.h",
         "android/hardware/bluetooth/1.0/BsBluetoothHciCallbacks.h",
     ],
 }
diff --git a/bluetooth/1.0/IBluetoothHci.hal b/bluetooth/1.0/IBluetoothHci.hal
index 10cf914..8722616 100644
--- a/bluetooth/1.0/IBluetoothHci.hal
+++ b/bluetooth/1.0/IBluetoothHci.hal
@@ -35,12 +35,18 @@
      * required to communicate with the Bluetooth hardware in the
      * device.
      *
+     * The |oninitializationComplete| callback must be invoked in response
+     * to this function to indicate success before any other function
+     * (sendHciCommand, sendAclData, * sendScoData) is invoked on this
+     * interface.
+     *
      * @param callback implements IBluetoothHciCallbacks which will
      *    receive callbacks when incoming HCI packets are received
      *    from the controller to be sent to the host.
-     * @return status result of the initialization
      */
-    initialize(IBluetoothHciCallbacks callback) generates (Status status);
+    @entry
+    @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
+    initialize(IBluetoothHciCallbacks callback);
 
     /**
      * Send an HCI command (as specified in the Bluetooth Specification
@@ -49,6 +55,7 @@
      *
      * @param command is the HCI command to be sent
      */
+    @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
     sendHciCommand(HciPacket command);
 
     /**
@@ -57,6 +64,7 @@
      * Packets must be processed in order.
      * @param data HCI data packet to be sent
      */
+    @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
     sendAclData(HciPacket data);
 
     /**
@@ -65,10 +73,12 @@
      * Packets must be processed in order.
      * @param data HCI data packet to be sent
      */
+    @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
     sendScoData(HciPacket data);
 
     /**
      * Close the HCI interface
      */
+    @exit
     close();
 };
diff --git a/bluetooth/1.0/IBluetoothHciCallbacks.hal b/bluetooth/1.0/IBluetoothHciCallbacks.hal
index afaab6c..15db1ce 100644
--- a/bluetooth/1.0/IBluetoothHciCallbacks.hal
+++ b/bluetooth/1.0/IBluetoothHciCallbacks.hal
@@ -19,21 +19,27 @@
 /* The interface from the Bluetooth Controller to the stack. */
 interface IBluetoothHciCallbacks {
     /**
+     * Invoked when the Bluetooth controller initialization has been
+     * completed.
+     */
+    initializationComplete(Status status);
+
+    /**
      * This function is invoked when an HCI event is received from the
      * Bluetooth controller to be forwarded to the Bluetooth stack.
      * @param event is the HCI event to be sent to the Bluetooth stack.
      */
-    oneway hciEventReceived(HciPacket event);
+    hciEventReceived(HciPacket event);
 
     /**
      * Send an ACL data packet form the controller to the host.
      * @param data the ACL HCI packet to be passed to the host stack
      */
-    oneway aclDataReceived(HciPacket data);
+    aclDataReceived(HciPacket data);
 
     /**
      * Send a SCO data packet form the controller to the host.
      * @param data the SCO HCI packet to be passed to the host stack
      */
-    oneway scoDataReceived(HciPacket data);
+    scoDataReceived(HciPacket data);
 };
diff --git a/bluetooth/1.0/default/bluetooth_hci.cc b/bluetooth/1.0/default/bluetooth_hci.cc
index d12bfb9..1559119 100644
--- a/bluetooth/1.0/default/bluetooth_hci.cc
+++ b/bluetooth/1.0/default/bluetooth_hci.cc
@@ -30,12 +30,16 @@
 static const uint8_t HCI_DATA_TYPE_ACL = 2;
 static const uint8_t HCI_DATA_TYPE_SCO = 3;
 
-Return<Status> BluetoothHci::initialize(
+Return<void> BluetoothHci::initialize(
     const ::android::sp<IBluetoothHciCallbacks>& cb) {
   ALOGW("BluetoothHci::initialize()");
   event_cb_ = cb;
 
   bool rc = VendorInterface::Initialize(
+      [this](bool status) {
+        event_cb_->initializationComplete(
+            status ? Status::SUCCESS : Status::INITIALIZATION_ERROR);
+      },
       [this](HciPacketType type, const hidl_vec<uint8_t>& packet) {
         switch (type) {
           case HCI_PACKET_TYPE_EVENT:
@@ -52,9 +56,8 @@
             break;
         }
       });
-  if (!rc) return Status::INITIALIZATION_ERROR;
-
-  return Status::SUCCESS;
+  if (!rc) event_cb_->initializationComplete(Status::INITIALIZATION_ERROR);
+  return Void();
 }
 
 Return<void> BluetoothHci::close() {
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index d297570..da1b411 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -32,7 +32,7 @@
 
 class BluetoothHci : public IBluetoothHci {
  public:
-  Return<Status> initialize(
+  Return<void> initialize(
       const ::android::sp<IBluetoothHciCallbacks>& cb) override;
   Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override;
   Return<void> sendAclData(const hidl_vec<uint8_t>& data) override;
diff --git a/bluetooth/1.0/default/service.cpp b/bluetooth/1.0/default/service.cpp
index a3c3cad..fa5106f 100644
--- a/bluetooth/1.0/default/service.cpp
+++ b/bluetooth/1.0/default/service.cpp
@@ -25,5 +25,5 @@
 using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-  return defaultPassthroughServiceImplementation<IBluetoothHci>("bluetooth");
+  return defaultPassthroughServiceImplementation<IBluetoothHci>();
 }
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index 905e1a6..20b30ae 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -35,6 +35,7 @@
 namespace {
 
 using android::hardware::bluetooth::V1_0::implementation::VendorInterface;
+using android::hardware::hidl_vec;
 
 tINT_CMD_CBACK internal_command_cb;
 VendorInterface* g_vendor_interface = nullptr;
@@ -46,17 +47,14 @@
     0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO,
     HCI_LENGTH_OFFSET_EVT};
 
-size_t HciGetPacketLengthForType(
-    HciPacketType type, const android::hardware::hidl_vec<uint8_t>& packet) {
+size_t HciGetPacketLengthForType(HciPacketType type,
+                                 const hidl_vec<uint8_t>& packet) {
   size_t offset = packet_length_offset_for_type[type];
-  if (type == HCI_PACKET_TYPE_ACL_DATA) {
-    return (((packet[offset + 1]) << 8) | packet[offset]);
-  }
-  return packet[offset];
+  if (type != HCI_PACKET_TYPE_ACL_DATA) return packet[offset];
+  return (((packet[offset + 1]) << 8) | packet[offset]);
 }
 
-HC_BT_HDR* WrapPacketAndCopy(uint16_t event,
-                             const android::hardware::hidl_vec<uint8_t>& data) {
+HC_BT_HDR* WrapPacketAndCopy(uint16_t event, const hidl_vec<uint8_t>& data) {
   size_t packet_size = data.size() + sizeof(HC_BT_HDR);
   HC_BT_HDR* packet = reinterpret_cast<HC_BT_HDR*>(new uint8_t[packet_size]);
   packet->offset = 0;
@@ -71,17 +69,16 @@
 
 uint8_t transmit_cb(uint16_t opcode, void* buffer, tINT_CMD_CBACK callback) {
   ALOGV("%s opcode: 0x%04x, ptr: %p", __func__, opcode, buffer);
-  HC_BT_HDR* bt_hdr = reinterpret_cast<HC_BT_HDR*>(buffer);
-
   internal_command_cb = callback;
   uint8_t type = HCI_PACKET_TYPE_COMMAND;
-  VendorInterface::get()->SendPrivate(&type, 1);
-  VendorInterface::get()->SendPrivate(bt_hdr->data, bt_hdr->len);
+  VendorInterface::get()->Send(&type, 1);
+  HC_BT_HDR* bt_hdr = reinterpret_cast<HC_BT_HDR*>(buffer);
+  VendorInterface::get()->Send(bt_hdr->data, bt_hdr->len);
   return true;
 }
 
 void firmware_config_cb(bt_vendor_op_result_t result) {
-  ALOGD("%s result: %d", __func__, result);
+  ALOGV("%s result: %d", __func__, result);
   VendorInterface::get()->OnFirmwareConfigured(result);
 }
 
@@ -131,10 +128,28 @@
 namespace V1_0 {
 namespace implementation {
 
-bool VendorInterface::Initialize(PacketReadCallback packet_read_cb) {
+class FirmwareStartupTimer {
+ public:
+  FirmwareStartupTimer() : start_time_(std::chrono::steady_clock::now()) {}
+
+  ~FirmwareStartupTimer() {
+    std::chrono::duration<double> duration =
+        std::chrono::steady_clock::now() - start_time_;
+    double s = duration.count();
+    if (s == 0) return;
+    ALOGD("Firmware configured in %.3fs", s);
+  }
+
+ private:
+  std::chrono::steady_clock::time_point start_time_;
+};
+
+bool VendorInterface::Initialize(
+    InitializeCompleteCallback initialize_complete_cb,
+    PacketReadCallback packet_read_cb) {
   assert(!g_vendor_interface);
   g_vendor_interface = new VendorInterface();
-  return g_vendor_interface->Open(packet_read_cb);
+  return g_vendor_interface->Open(initialize_complete_cb, packet_read_cb);
 }
 
 void VendorInterface::Shutdown() {
@@ -146,8 +161,9 @@
 
 VendorInterface* VendorInterface::get() { return g_vendor_interface; }
 
-bool VendorInterface::Open(PacketReadCallback packet_read_cb) {
-  firmware_configured_ = false;
+bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
+                           PacketReadCallback packet_read_cb) {
+  initialize_complete_cb_ = initialize_complete_cb;
   packet_read_cb_ = packet_read_cb;
 
   // Initialize vendor interface
@@ -209,6 +225,7 @@
                                          [this](int fd) { OnDataReady(fd); });
 
   // Start configuring the firmware
+  firmware_startup_timer_ = new FirmwareStartupTimer();
   lib_interface_->op(BT_VND_OP_FW_CFG, nullptr);
 
   return true;
@@ -229,31 +246,13 @@
     lib_handle_ = nullptr;
   }
 
-  firmware_configured_ = false;
+  if (firmware_startup_timer_ != nullptr) {
+    delete firmware_startup_timer_;
+    firmware_startup_timer_ = nullptr;
+  }
 }
 
 size_t VendorInterface::Send(const uint8_t* data, size_t length) {
-  if (firmware_configured_ && queued_data_.size() == 0)
-    return SendPrivate(data, length);
-
-  if (!firmware_configured_) {
-    ALOGI("%s queueing command", __func__);
-    queued_data_.resize(queued_data_.size() + length);
-    uint8_t* append_ptr = &queued_data_[queued_data_.size() - length];
-    memcpy(append_ptr, data, length);
-    return length;
-  }
-
-  ALOGI("%s sending queued command", __func__);
-  SendPrivate(queued_data_.data(), queued_data_.size());
-  queued_data_.resize(0);
-
-  ALOGI("%s done sending queued command", __func__);
-
-  return SendPrivate(data, length);
-}
-
-size_t VendorInterface::SendPrivate(const uint8_t* data, size_t length) {
   if (uart_fd_ == INVALID_FD) return 0;
 
   size_t transmitted_length = 0;
@@ -280,9 +279,18 @@
 }
 
 void VendorInterface::OnFirmwareConfigured(uint8_t result) {
-  ALOGI("%s: result = %d", __func__, result);
-  firmware_configured_ = true;
-  VendorInterface::get()->Send(NULL, 0);
+  ALOGD("%s result: %d", __func__, result);
+  internal_command_cb = nullptr;
+
+  if (firmware_startup_timer_ != nullptr) {
+    delete firmware_startup_timer_;
+    firmware_startup_timer_ = nullptr;
+  }
+
+  if (initialize_complete_cb_ != nullptr) {
+    initialize_complete_cb_(result == 0);
+    initialize_complete_cb_ = nullptr;
+  }
 }
 
 void VendorInterface::OnDataReady(int fd) {
@@ -331,16 +339,17 @@
       hci_packet_bytes_remaining_ -= bytes_read;
       hci_packet_bytes_read_ += bytes_read;
       if (hci_packet_bytes_remaining_ == 0) {
-        if (firmware_configured_) {
-          if (packet_read_cb_ != nullptr) {
-            packet_read_cb_(hci_packet_type_, hci_packet_);
-          }
+        if (internal_command_cb != nullptr) {
+          HC_BT_HDR* bt_hdr =
+              WrapPacketAndCopy(HCI_PACKET_TYPE_EVENT, hci_packet_);
+          internal_command_cb(bt_hdr);
+        } else if (packet_read_cb_ != nullptr &&
+                   initialize_complete_cb_ == nullptr) {
+          packet_read_cb_(hci_packet_type_, hci_packet_);
         } else {
-          if (internal_command_cb != nullptr) {
-            HC_BT_HDR* bt_hdr =
-                WrapPacketAndCopy(HCI_PACKET_TYPE_EVENT, hci_packet_);
-            internal_command_cb(bt_hdr);
-          }
+          ALOGE(
+              "%s HCI_PAYLOAD received without packet_read_cb or pending init.",
+              __func__);
         }
         hci_parser_state_ = HCI_IDLE;
       }
diff --git a/bluetooth/1.0/default/vendor_interface.h b/bluetooth/1.0/default/vendor_interface.h
index 73ff2eb..450b99c 100644
--- a/bluetooth/1.0/default/vendor_interface.h
+++ b/bluetooth/1.0/default/vendor_interface.h
@@ -29,55 +29,50 @@
 namespace implementation {
 
 using ::android::hardware::hidl_vec;
+using InitializeCompleteCallback = std::function<void(bool success)>;
 using PacketReadCallback =
     std::function<void(HciPacketType, const hidl_vec<uint8_t> &)>;
 
+class FirmwareStartupTimer;
+
 class VendorInterface {
  public:
-  static bool Initialize(PacketReadCallback packet_read_cb);
+  static bool Initialize(InitializeCompleteCallback initialize_complete_cb,
+                         PacketReadCallback packet_read_cb);
   static void Shutdown();
-  static VendorInterface* get();
+  static VendorInterface *get();
 
   size_t Send(const uint8_t *data, size_t length);
 
   void OnFirmwareConfigured(uint8_t result);
 
-  // Actually send the data.
-  size_t SendPrivate(const uint8_t *data, size_t length);
-
  private:
-  VendorInterface() { queued_data_.resize(0); }
   virtual ~VendorInterface() = default;
 
-  bool Open(PacketReadCallback packet_read_cb);
+  bool Open(InitializeCompleteCallback initialize_complete_cb, PacketReadCallback packet_read_cb);
   void Close();
 
   void OnDataReady(int fd);
 
-  // Queue data from Send() until the interface is ready.
-  hidl_vec<uint8_t> queued_data_;
-
   void *lib_handle_;
   bt_vendor_interface_t *lib_interface_;
   AsyncFdWatcher fd_watcher_;
   int uart_fd_;
   PacketReadCallback packet_read_cb_;
-  bool firmware_configured_;
+  InitializeCompleteCallback initialize_complete_cb_;
 
-  enum HciParserState {
-    HCI_IDLE,
-    HCI_TYPE_READY,
-    HCI_PAYLOAD
-  };
+  enum HciParserState { HCI_IDLE, HCI_TYPE_READY, HCI_PAYLOAD };
   HciParserState hci_parser_state_{HCI_IDLE};
   HciPacketType hci_packet_type_{HCI_PACKET_TYPE_UNKNOWN};
   hidl_vec<uint8_t> hci_packet_;
   size_t hci_packet_bytes_remaining_;
   size_t hci_packet_bytes_read_;
+
+  FirmwareStartupTimer *firmware_startup_timer_;
 };
 
-} // namespace implementation
-} // namespace V1_0
-} // namespace bluetooth
-} // namespace hardware
-} // namespace android
+}  // namespace implementation
+}  // namespace V1_0
+}  // namespace bluetooth
+}  // namespace hardware
+}  // namespace android
diff --git a/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp b/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
index 2a4bbdd..683029e 100644
--- a/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
+++ b/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
@@ -36,13 +36,12 @@
 using ::android::hardware::Void;
 using ::android::sp;
 
-#define Bluetooth_HCI_SERVICE_NAME "bluetooth"
-
 #define HCI_MINIMUM_HCI_VERSION 5  // Bluetooth Core Specification 3.0 + HS
 #define HCI_MINIMUM_LMP_VERSION 5  // Bluetooth Core Specification 3.0 + HS
 #define NUM_HCI_COMMANDS_BANDWIDTH 1000
 #define NUM_SCO_PACKETS_BANDWIDTH 1000
 #define NUM_ACL_PACKETS_BANDWIDTH 1000
+#define WAIT_FOR_INIT_TIMEOUT std::chrono::milliseconds(2000)
 #define WAIT_FOR_HCI_EVENT_TIMEOUT std::chrono::milliseconds(2000)
 #define WAIT_FOR_SCO_DATA_TIMEOUT std::chrono::milliseconds(1000)
 #define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
@@ -122,8 +121,8 @@
  public:
   virtual void SetUp() override {
     // currently test passthrough mode only
-    bluetooth = IBluetoothHci::getService(Bluetooth_HCI_SERVICE_NAME);
-    ALOGW("%s: getService(%s) is %s", __func__, Bluetooth_HCI_SERVICE_NAME,
+    bluetooth = IBluetoothHci::getService();
+    ALOGW("%s: getService() for bluetooth is %s", __func__,
           bluetooth->isRemote() ? "remote" : "local");
     ASSERT_NE(bluetooth, nullptr);
 
@@ -135,6 +134,8 @@
     max_acl_data_packets = 0;
     max_sco_data_packets = 0;
 
+    initialized = false;
+    initialized_count = 0;
     event_count = 0;
     acl_count = 0;
     sco_count = 0;
@@ -142,9 +143,12 @@
     acl_cb_count = 0;
     sco_cb_count = 0;
 
-    // Collision with android::hardware::Status
-    EXPECT_EQ(android::hardware::bluetooth::V1_0::Status::SUCCESS,
-              bluetooth->initialize(bluetooth_cb));
+    ASSERT_EQ(initialized, false);
+    bluetooth->initialize(bluetooth_cb);
+
+    wait_for_init_callback();
+
+    ASSERT_EQ(initialized, true);
   }
 
   virtual void TearDown() override {
@@ -167,6 +171,26 @@
   void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
   int wait_for_completed_packets_event(uint16_t handle);
 
+  // Inform the test about the initialization callback
+  inline void notify_initialized() {
+    std::unique_lock<std::mutex> lock(initialized_mutex);
+    initialized_count++;
+    initialized_condition.notify_one();
+  }
+
+  // Test code calls this function to wait for the init callback
+  inline void wait_for_init_callback() {
+    std::unique_lock<std::mutex> lock(initialized_mutex);
+
+    auto start_time = std::chrono::steady_clock::now();
+    while (initialized_count == 0)
+      if (initialized_condition.wait_until(lock,
+                                     start_time + WAIT_FOR_INIT_TIMEOUT) ==
+          std::cv_status::timeout)
+        return;
+    initialized_count--;
+  }
+
   // Inform the test about an event callback
   inline void notify_event_received() {
     std::unique_lock<std::mutex> lock(event_mutex);
@@ -230,6 +254,13 @@
 
     virtual ~BluetoothHciCallbacks() = default;
 
+    Return<void> initializationComplete(Status status) override {
+      parent_.initialized = true;
+      parent_.notify_initialized();
+      ALOGV("%s (status = %d)", __func__, static_cast<int>(status));
+      return Void();
+    };
+
     Return<void> hciEventReceived(
         const ::android::hardware::hidl_vec<uint8_t>& event) override {
       parent_.event_cb_count++;
@@ -262,6 +293,8 @@
   std::queue<hidl_vec<uint8_t>> acl_queue;
   std::queue<hidl_vec<uint8_t>> sco_queue;
 
+  bool initialized;
+
   int event_cb_count;
   int sco_cb_count;
   int acl_cb_count;
@@ -272,12 +305,15 @@
   int max_sco_data_packets;
 
  private:
+  std::mutex initialized_mutex;
   std::mutex event_mutex;
   std::mutex sco_mutex;
   std::mutex acl_mutex;
+  std::condition_variable initialized_condition;
   std::condition_variable event_condition;
   std::condition_variable sco_condition;
   std::condition_variable acl_condition;
+  int initialized_count;
   int event_count;
   int sco_count;
   int acl_count;
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index 266ef4d..8e62c89 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/boot/1.0/types.h",
         "android/hardware/boot/1.0/IBootControl.h",
         "android/hardware/boot/1.0/IHwBootControl.h",
-        "android/hardware/boot/1.0/BnBootControl.h",
-        "android/hardware/boot/1.0/BpBootControl.h",
+        "android/hardware/boot/1.0/BnHwBootControl.h",
+        "android/hardware/boot/1.0/BpHwBootControl.h",
         "android/hardware/boot/1.0/BsBootControl.h",
     ],
 }
diff --git a/boot/1.0/default/BootControl.cpp b/boot/1.0/default/BootControl.cpp
index 54c1928..828da16 100644
--- a/boot/1.0/default/BootControl.cpp
+++ b/boot/1.0/default/BootControl.cpp
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 #define LOG_TAG "android.hardware.boot@1.0-impl"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include <hardware/hardware.h>
 #include <hardware/boot_control.h>
diff --git a/boot/1.0/vts/functional/boot_hidl_hal_test.cpp b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
index 7b002b9..3413a93 100644
--- a/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
+++ b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
@@ -35,18 +35,8 @@
 class BootHidlTest : public ::testing::Test {
  public:
   virtual void SetUp() override {
-    // TODO(b/33385836) Delete copied code
-    bool getStub = false;
-    char getsubProperty[PROPERTY_VALUE_MAX];
-    if (property_get("vts.hidl.get_stub", getsubProperty, "") > 0) {
-      if (!strcmp(getsubProperty, "true") || !strcmp(getsubProperty, "True") ||
-          !strcmp(getsubProperty, "1")) {
-        getStub = true;
-      }
-    }
-    boot = IBootControl::getService("bootctrl", getStub);
+    boot = IBootControl::getService("bootctrl");
     ASSERT_NE(boot, nullptr);
-    ASSERT_EQ(!getStub, boot->isRemote());
   }
 
   virtual void TearDown() override {}
@@ -75,7 +65,7 @@
 TEST_F(BootHidlTest, MarkBootSuccessful) {
   CommandResult cr;
   Return<void> result = boot->markBootSuccessful(generate_callback(&cr));
-  ASSERT_TRUE(result.getStatus().isOk());
+  ASSERT_TRUE(result.isOk());
   if (cr.success) {
     Slot curSlot = boot->getCurrentSlot();
     BoolResult ret = boot->isSlotMarkedSuccessful(curSlot);
@@ -88,14 +78,21 @@
   for (Slot s = 0; s < 2; s++) {
     CommandResult cr;
     Return<void> result = boot->setActiveBootSlot(s, generate_callback(&cr));
-    EXPECT_TRUE(result.getStatus().isOk());
+    EXPECT_TRUE(result.isOk());
+  }
+  {
+    // Restore original flags to avoid problems on reboot
+    CommandResult cr;
+    Return <void> result = boot->markBootSuccessful(generate_callback(&cr));
+    EXPECT_TRUE(result.isOk());
+    EXPECT_TRUE(cr.success);
   }
   {
     CommandResult cr;
     uint32_t slots = boot->getNumberSlots();
     Return<void> result =
         boot->setActiveBootSlot(slots, generate_callback(&cr));
-    ASSERT_TRUE(result.getStatus().isOk());
+    ASSERT_TRUE(result.isOk());
     EXPECT_EQ(false, cr.success);
   }
 }
@@ -108,10 +105,19 @@
     Slot otherSlot = curSlot ? 0 : 1;
     Return<void> result =
         boot->setSlotAsUnbootable(otherSlot, generate_callback(&cr));
-    EXPECT_TRUE(result.getStatus().isOk());
+    EXPECT_TRUE(result.isOk());
     if (cr.success) {
       EXPECT_EQ(BoolResult::FALSE, boot->isSlotBootable(otherSlot));
-      boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+
+      // Restore original flags to avoid problems on reboot
+      result = boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+      EXPECT_TRUE(result.isOk());
+      EXPECT_TRUE(cr.success);
+      result = boot->setActiveBootSlot(curSlot, generate_callback(&cr));
+      EXPECT_TRUE(result.isOk());
+      EXPECT_TRUE(cr.success);
+      result = boot->markBootSuccessful(generate_callback(&cr));
+      EXPECT_TRUE(result.isOk());
       EXPECT_TRUE(cr.success);
     }
   }
@@ -120,7 +126,7 @@
     uint32_t slots = boot->getNumberSlots();
     Return<void> result =
         boot->setSlotAsUnbootable(slots, generate_callback(&cr));
-    EXPECT_TRUE(result.getStatus().isOk());
+    EXPECT_TRUE(result.isOk());
     EXPECT_EQ(false, cr.success);
   }
 }
@@ -150,7 +156,7 @@
   for (Slot i = 0; i < 2; i++) {
     CommandResult cr;
     Return<void> result = boot->getSuffix(i, cb);
-    EXPECT_TRUE(result.getStatus().isOk());
+    EXPECT_TRUE(result.isOk());
     char correctSuffix[3];
     snprintf(correctSuffix, sizeof(correctSuffix), "_%c", 'a' + i);
     ASSERT_EQ(0, strcmp(suffixPtr, correctSuffix));
@@ -158,7 +164,7 @@
   {
     char emptySuffix[] = "";
     Return<void> result = boot->getSuffix(boot->getNumberSlots(), cb);
-    EXPECT_TRUE(result.getStatus().isOk());
+    EXPECT_TRUE(result.isOk());
     ASSERT_EQ(0, strcmp(emptySuffix, suffixPtr));
   }
 }
diff --git a/boot/Android.mk b/boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/Android.mk
similarity index 78%
copy from boot/Android.mk
copy to boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/Android.mk
index f9e3276..f7414df 100644
--- a/boot/Android.mk
+++ b/boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalBootHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/boot/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/AndroidTest.xml b/boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..dbc6300
--- /dev/null
+++ b/boot/1.0/vts/functional/vts/testcases/hal/boot/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Boot HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalBootHidlTargetProfilingTest"/>
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/boot_hidl_hal_test/boot_hidl_hal_test,
+            _64bit::DATA/nativetest64/boot_hidl_hal_test/boot_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="5m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index 8cd44f2..cf44add 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -35,23 +35,23 @@
         "android/hardware/broadcastradio/1.0/types.h",
         "android/hardware/broadcastradio/1.0/IBroadcastRadio.h",
         "android/hardware/broadcastradio/1.0/IHwBroadcastRadio.h",
-        "android/hardware/broadcastradio/1.0/BnBroadcastRadio.h",
-        "android/hardware/broadcastradio/1.0/BpBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.0/BnHwBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.0/BpHwBroadcastRadio.h",
         "android/hardware/broadcastradio/1.0/BsBroadcastRadio.h",
         "android/hardware/broadcastradio/1.0/IBroadcastRadioFactory.h",
         "android/hardware/broadcastradio/1.0/IHwBroadcastRadioFactory.h",
-        "android/hardware/broadcastradio/1.0/BnBroadcastRadioFactory.h",
-        "android/hardware/broadcastradio/1.0/BpBroadcastRadioFactory.h",
+        "android/hardware/broadcastradio/1.0/BnHwBroadcastRadioFactory.h",
+        "android/hardware/broadcastradio/1.0/BpHwBroadcastRadioFactory.h",
         "android/hardware/broadcastradio/1.0/BsBroadcastRadioFactory.h",
         "android/hardware/broadcastradio/1.0/ITuner.h",
         "android/hardware/broadcastradio/1.0/IHwTuner.h",
-        "android/hardware/broadcastradio/1.0/BnTuner.h",
-        "android/hardware/broadcastradio/1.0/BpTuner.h",
+        "android/hardware/broadcastradio/1.0/BnHwTuner.h",
+        "android/hardware/broadcastradio/1.0/BpHwTuner.h",
         "android/hardware/broadcastradio/1.0/BsTuner.h",
         "android/hardware/broadcastradio/1.0/ITunerCallback.h",
         "android/hardware/broadcastradio/1.0/IHwTunerCallback.h",
-        "android/hardware/broadcastradio/1.0/BnTunerCallback.h",
-        "android/hardware/broadcastradio/1.0/BpTunerCallback.h",
+        "android/hardware/broadcastradio/1.0/BnHwTunerCallback.h",
+        "android/hardware/broadcastradio/1.0/BpHwTunerCallback.h",
         "android/hardware/broadcastradio/1.0/BsTunerCallback.h",
     ],
 }
diff --git a/broadcastradio/1.0/ITuner.hal b/broadcastradio/1.0/ITuner.hal
index 5e2bffe..ae4b284 100644
--- a/broadcastradio/1.0/ITuner.hal
+++ b/broadcastradio/1.0/ITuner.hal
@@ -103,11 +103,9 @@
 
     /*
      * Retrieve current station information.
-     * @param withMetadata True if Metadata should be returned, false otherwise.
      * @return result OK if scan successfully started
      *                NOT_INITIALIZED if another error occurs
      * @return info Current program information.
      */
-    getProgramInformation(bool withMetadata)
-            generates(Result result, ProgramInfo info);
+    getProgramInformation() generates(Result result, ProgramInfo info);
 };
diff --git a/broadcastradio/1.0/default/BroadcastRadio.cpp b/broadcastradio/1.0/default/BroadcastRadio.cpp
index 32331ce..45ffdb2 100644
--- a/broadcastradio/1.0/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.0/default/BroadcastRadio.cpp
@@ -16,7 +16,8 @@
 #define LOG_TAG "BroadcastRadio"
 //#define LOG_NDEBUG 0
 
-#include <android/log.h>
+#include <log/log.h>
+
 #include <hardware/radio.h>
 
 #include "BroadcastRadio.h"
diff --git a/broadcastradio/1.0/default/Tuner.cpp b/broadcastradio/1.0/default/Tuner.cpp
index 27b298b..b564d5a 100644
--- a/broadcastradio/1.0/default/Tuner.cpp
+++ b/broadcastradio/1.0/default/Tuner.cpp
@@ -17,7 +17,7 @@
 #define LOG_TAG "Tuner"
 //#define LOG_NDEBUG 0
 
-#include <android/log.h>
+#include <log/log.h>
 
 #include "BroadcastRadio.h"
 #include "Tuner.h"
@@ -46,7 +46,7 @@
             mCallback->antennaStateChange(halEvent->on);
             break;
         case RADIO_EVENT_TUNED:
-            Utils::convertProgramInfoFromHal(&info, &halEvent->info, true);
+            Utils::convertProgramInfoFromHal(&info, &halEvent->info);
             mCallback->tuneComplete(Utils::convertHalResult(halEvent->status), info);
             break;
         case RADIO_EVENT_METADATA: {
@@ -61,7 +61,7 @@
             mCallback->trafficAnnouncement(halEvent->on);
             break;
         case RADIO_EVENT_AF_SWITCH:
-            Utils::convertProgramInfoFromHal(&info, &halEvent->info, true);
+            Utils::convertProgramInfoFromHal(&info, &halEvent->info);
             mCallback->afSwitch(info);
             break;
         case RADIO_EVENT_EA:
@@ -164,7 +164,7 @@
     return Utils::convertHalResult(rc);
 }
 
-Return<void> Tuner::getProgramInformation(bool withMetadata, getProgramInformation_cb _hidl_cb)  {
+Return<void> Tuner::getProgramInformation(getProgramInformation_cb _hidl_cb)  {
     int rc;
     radio_program_info_t halInfo;
     ProgramInfo info;
@@ -174,18 +174,13 @@
         rc = -ENODEV;
         goto exit;
     }
-    if (withMetadata) {
-        radio_metadata_allocate(&halInfo.metadata, 0, 0);
-    } else {
-        halInfo.metadata = NULL;
-    }
+
+    radio_metadata_allocate(&halInfo.metadata, 0, 0);
     rc = mHalTuner->get_program_information(mHalTuner, &halInfo);
     if (rc == 0) {
-        Utils::convertProgramInfoFromHal(&info, &halInfo, withMetadata);
+        Utils::convertProgramInfoFromHal(&info, &halInfo);
     }
-    if (withMetadata) {
-        radio_metadata_deallocate(halInfo.metadata);
-    }
+    radio_metadata_deallocate(halInfo.metadata);
 
 exit:
     _hidl_cb(Utils::convertHalResult(rc), info);
diff --git a/broadcastradio/1.0/default/Tuner.h b/broadcastradio/1.0/default/Tuner.h
index a621d97..bfdd4f4 100644
--- a/broadcastradio/1.0/default/Tuner.h
+++ b/broadcastradio/1.0/default/Tuner.h
@@ -40,8 +40,7 @@
     Return<Result> step(Direction direction, bool skipSubChannel)  override;
     Return<Result> tune(uint32_t channel, uint32_t subChannel)  override;
     Return<Result> cancel()  override;
-    Return<void> getProgramInformation(bool withMetadata,
-                                       getProgramInformation_cb _hidl_cb)  override;
+    Return<void> getProgramInformation(getProgramInformation_cb _hidl_cb)  override;
 
     static void callback(radio_hal_event_t *halEvent, void *cookie);
            void onCallback(radio_hal_event_t *halEvent);
diff --git a/broadcastradio/1.0/default/Utils.cpp b/broadcastradio/1.0/default/Utils.cpp
index c2c2ff3..8776222 100644
--- a/broadcastradio/1.0/default/Utils.cpp
+++ b/broadcastradio/1.0/default/Utils.cpp
@@ -16,7 +16,7 @@
 #define LOG_TAG "BroadcastRadioHalUtils"
 //#define LOG_NDEBUG 0
 
-#include <android/log.h>
+#include <log/log.h>
 #include <utils/misc.h>
 #include <system/radio_metadata.h>
 
@@ -222,8 +222,7 @@
 
 //static
 void Utils::convertProgramInfoFromHal(ProgramInfo *info,
-                                      radio_program_info_t *halInfo,
-                                      bool withMetadata)
+                                      radio_program_info_t *halInfo)
 {
     info->channel = halInfo->channel;
     info->subChannel = halInfo->sub_channel;
@@ -231,9 +230,7 @@
     info->stereo = halInfo->stereo;
     info->digital = halInfo->digital;
     info->signalStrength = halInfo->signal_strength;
-    if (withMetadata && halInfo->metadata != NULL) {
-        convertMetaDataFromHal(info->metadata, halInfo->metadata);
-    }
+    convertMetaDataFromHal(info->metadata, halInfo->metadata);
 }
 
 //static
@@ -241,6 +238,7 @@
                                    radio_metadata_t *halMetadata)
 {
     if (halMetadata == NULL) {
+        ALOGE("Invalid argument: halMetadata is NULL");
         return 0;
     }
 
diff --git a/broadcastradio/1.0/default/Utils.h b/broadcastradio/1.0/default/Utils.h
index 25eb6ee..4ef22a5 100644
--- a/broadcastradio/1.0/default/Utils.h
+++ b/broadcastradio/1.0/default/Utils.h
@@ -36,8 +36,7 @@
     static void convertBandConfigToHal(radio_hal_band_config_t *halConfig,
             const BandConfig *config);
     static void convertProgramInfoFromHal(ProgramInfo *info,
-                                          radio_program_info_t *halInfo,
-                                          bool withMetadata);
+                                          radio_program_info_t *halInfo);
     static int convertMetaDataFromHal(hidl_vec<MetaData>& metadata,
                                        radio_metadata_t *halMetadata);
 private:
diff --git a/broadcastradio/1.0/vts/functional/broadcastradio_hidl_hal_test.cpp b/broadcastradio/1.0/vts/functional/broadcastradio_hidl_hal_test.cpp
index 6802c3c..bcbfbb7 100644
--- a/broadcastradio/1.0/vts/functional/broadcastradio_hidl_hal_test.cpp
+++ b/broadcastradio/1.0/vts/functional/broadcastradio_hidl_hal_test.cpp
@@ -241,7 +241,7 @@
                         }
                     });
 
-        EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+        EXPECT_TRUE(hidlReturn.isOk());
         EXPECT_EQ(Result::OK, halResult);
         EXPECT_EQ(Class::AM_FM, mHalProperties.classId);
         EXPECT_GT(mHalProperties.numTuners, 0u);
@@ -265,7 +265,7 @@
                             mTuner = tuner;
                         }
                     });
-        EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+        EXPECT_TRUE(hidlReturn.isOk());
         EXPECT_EQ(Result::OK, halResult);
         EXPECT_EQ(true, waitForCallback(kConfigCallbacktimeoutNs));
     }
@@ -328,7 +328,7 @@
     // test setConfiguration
     mCallbackCalled = false;
     Return<Result> hidlResult = mTuner->setConfiguration(mHalProperties.bands[0]);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kConfigCallbacktimeoutNs));
     EXPECT_EQ(Result::OK, mResultCallbackData);
@@ -343,7 +343,7 @@
                     halConfig = config;
                 }
             });
-    EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlReturn.isOk());
     EXPECT_EQ(Result::OK, halResult);
     EXPECT_EQ(mHalProperties.bands[0].type, halConfig.type);
 }
@@ -362,14 +362,14 @@
     // test scan UP
     mCallbackCalled = false;
     Return<Result> hidlResult = mTuner->scan(Direction::UP, true);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kTuneCallbacktimeoutNs));
 
     // test scan DOWN
     mCallbackCalled = false;
     hidlResult = mTuner->scan(Direction::DOWN, true);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kTuneCallbacktimeoutNs));
 }
@@ -388,14 +388,14 @@
     // test step UP
     mCallbackCalled = false;
     Return<Result> hidlResult = mTuner->step(Direction::UP, true);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kTuneCallbacktimeoutNs));
 
     // test step DOWN
     mCallbackCalled = false;
     hidlResult = mTuner->step(Direction::DOWN, true);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kTuneCallbacktimeoutNs));
 }
@@ -426,7 +426,7 @@
     mCallbackCalled = false;
     mResultCallbackData = Result::NOT_INITIALIZED;
     Return<Result> hidlResult = mTuner->tune(channel, 0);
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
     EXPECT_EQ(true, waitForCallback(kTuneCallbacktimeoutNs));
 
@@ -434,13 +434,13 @@
     ProgramInfo halInfo;
     Result halResult = Result::NOT_INITIALIZED;
     Return<void> hidlReturn = mTuner->getProgramInformation(
-                    false, [&](Result result, const ProgramInfo& info) {
-                                halResult = result;
-                                if (result == Result::OK) {
-                                    halInfo = info;
-                                }
+        [&](Result result, const ProgramInfo& info) {
+            halResult = result;
+            if (result == Result::OK) {
+                halInfo = info;
+            }
         });
-    EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlReturn.isOk());
     EXPECT_EQ(Result::OK, halResult);
     if (mResultCallbackData == Result::OK) {
         EXPECT_EQ(true, halInfo.tuned);
@@ -453,7 +453,7 @@
     // test cancel
     mTuner->tune(lowerLimit, 0);
     hidlResult = mTuner->cancel();
-    EXPECT_EQ(Status::EX_NONE, hidlResult.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, hidlResult);
 }
 
diff --git a/broadcastradio/Android.mk b/broadcastradio/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/broadcastradio/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/camera/Android.bp b/camera/Android.bp
index a373bf4..e379e49 100644
--- a/camera/Android.bp
+++ b/camera/Android.bp
@@ -1,8 +1,12 @@
 // This is an autogenerated file, do not edit.
 subdirs = [
     "common/1.0",
+    "common/1.0/default",
     "device/1.0",
     "device/3.2",
+    "device/3.2/default",
     "metadata/3.2",
     "provider/2.4",
+    "provider/2.4/default",
+    "provider/2.4/vts/functional",
 ]
diff --git a/camera/common/1.0/default/Android.bp b/camera/common/1.0/default/Android.bp
new file mode 100644
index 0000000..af0ff6e
--- /dev/null
+++ b/camera/common/1.0/default/Android.bp
@@ -0,0 +1,15 @@
+cc_library_static {
+    name: "android.hardware.camera.common@1.0-helper",
+    srcs: ["CameraModule.cpp", "CameraMetadata.cpp", "VendorTagDescriptor.cpp"],
+    cflags: [
+        "-Werror",
+        "-Wextra",
+        "-Wall",
+    ],
+    shared_libs: [
+        "liblog",
+        "libhardware",
+        "libcamera_metadata"],
+    include_dirs: ["system/media/private/camera/include"],
+    export_include_dirs : ["include"]
+}
diff --git a/camera/common/1.0/default/CameraMetadata.cpp b/camera/common/1.0/default/CameraMetadata.cpp
new file mode 100644
index 0000000..44c2040
--- /dev/null
+++ b/camera/common/1.0/default/CameraMetadata.cpp
@@ -0,0 +1,568 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// #define LOG_NDEBUG 0
+
+#define LOG_TAG "CamComm1.0-MD"
+#include <utils/Log.h>
+#include <utils/Errors.h>
+
+#include "CameraMetadata.h"
+#include "VendorTagDescriptor.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
+#define ALIGN_TO(val, alignment) \
+    (((uintptr_t)(val) + ((alignment) - 1)) & ~((alignment) - 1))
+
+CameraMetadata::CameraMetadata() :
+        mBuffer(NULL), mLocked(false) {
+}
+
+CameraMetadata::CameraMetadata(size_t entryCapacity, size_t dataCapacity) :
+        mLocked(false)
+{
+    mBuffer = allocate_camera_metadata(entryCapacity, dataCapacity);
+}
+
+CameraMetadata::CameraMetadata(const CameraMetadata &other) :
+        mLocked(false) {
+    mBuffer = clone_camera_metadata(other.mBuffer);
+}
+
+CameraMetadata::CameraMetadata(camera_metadata_t *buffer) :
+        mBuffer(NULL), mLocked(false) {
+    acquire(buffer);
+}
+
+CameraMetadata &CameraMetadata::operator=(const CameraMetadata &other) {
+    return operator=(other.mBuffer);
+}
+
+CameraMetadata &CameraMetadata::operator=(const camera_metadata_t *buffer) {
+    if (mLocked) {
+        ALOGE("%s: Assignment to a locked CameraMetadata!", __FUNCTION__);
+        return *this;
+    }
+
+    if (CC_LIKELY(buffer != mBuffer)) {
+        camera_metadata_t *newBuffer = clone_camera_metadata(buffer);
+        clear();
+        mBuffer = newBuffer;
+    }
+    return *this;
+}
+
+CameraMetadata::~CameraMetadata() {
+    mLocked = false;
+    clear();
+}
+
+const camera_metadata_t* CameraMetadata::getAndLock() const {
+    mLocked = true;
+    return mBuffer;
+}
+
+status_t CameraMetadata::unlock(const camera_metadata_t *buffer) const {
+    if (!mLocked) {
+        ALOGE("%s: Can't unlock a non-locked CameraMetadata!", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if (buffer != mBuffer) {
+        ALOGE("%s: Can't unlock CameraMetadata with wrong pointer!",
+                __FUNCTION__);
+        return BAD_VALUE;
+    }
+    mLocked = false;
+    return OK;
+}
+
+camera_metadata_t* CameraMetadata::release() {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return NULL;
+    }
+    camera_metadata_t *released = mBuffer;
+    mBuffer = NULL;
+    return released;
+}
+
+void CameraMetadata::clear() {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return;
+    }
+    if (mBuffer) {
+        free_camera_metadata(mBuffer);
+        mBuffer = NULL;
+    }
+}
+
+void CameraMetadata::acquire(camera_metadata_t *buffer) {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return;
+    }
+    clear();
+    mBuffer = buffer;
+
+    ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/NULL) != OK,
+             "%s: Failed to validate metadata structure %p",
+             __FUNCTION__, buffer);
+}
+
+void CameraMetadata::acquire(CameraMetadata &other) {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return;
+    }
+    acquire(other.release());
+}
+
+status_t CameraMetadata::append(const CameraMetadata &other) {
+    return append(other.mBuffer);
+}
+
+status_t CameraMetadata::append(const camera_metadata_t* other) {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    size_t extraEntries = get_camera_metadata_entry_count(other);
+    size_t extraData = get_camera_metadata_data_count(other);
+    resizeIfNeeded(extraEntries, extraData);
+
+    return append_camera_metadata(mBuffer, other);
+}
+
+size_t CameraMetadata::entryCount() const {
+    return (mBuffer == NULL) ? 0 :
+            get_camera_metadata_entry_count(mBuffer);
+}
+
+bool CameraMetadata::isEmpty() const {
+    return entryCount() == 0;
+}
+
+status_t CameraMetadata::sort() {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    return sort_camera_metadata(mBuffer);
+}
+
+status_t CameraMetadata::checkType(uint32_t tag, uint8_t expectedType) {
+    int tagType = get_camera_metadata_tag_type(tag);
+    if ( CC_UNLIKELY(tagType == -1)) {
+        ALOGE("Update metadata entry: Unknown tag %d", tag);
+        return INVALID_OPERATION;
+    }
+    if ( CC_UNLIKELY(tagType != expectedType) ) {
+        ALOGE("Mismatched tag type when updating entry %s (%d) of type %s; "
+                "got type %s data instead ",
+                get_camera_metadata_tag_name(tag), tag,
+                camera_metadata_type_names[tagType],
+                camera_metadata_type_names[expectedType]);
+        return INVALID_OPERATION;
+    }
+    return OK;
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const int32_t *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_INT32)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const uint8_t *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_BYTE)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const float *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_FLOAT)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const int64_t *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_INT64)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const double *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_DOUBLE)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const camera_metadata_rational_t *data, size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_RATIONAL)) != OK) {
+        return res;
+    }
+    return updateImpl(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const String8 &string) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(tag, TYPE_BYTE)) != OK) {
+        return res;
+    }
+    // string.size() doesn't count the null termination character.
+    return updateImpl(tag, (const void*)string.string(), string.size() + 1);
+}
+
+status_t CameraMetadata::update(const camera_metadata_ro_entry &entry) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    if ( (res = checkType(entry.tag, entry.type)) != OK) {
+        return res;
+    }
+    return updateImpl(entry.tag, (const void*)entry.data.u8, entry.count);
+}
+
+status_t CameraMetadata::updateImpl(uint32_t tag, const void *data,
+        size_t data_count) {
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    int type = get_camera_metadata_tag_type(tag);
+    if (type == -1) {
+        ALOGE("%s: Tag %d not found", __FUNCTION__, tag);
+        return BAD_VALUE;
+    }
+    // Safety check - ensure that data isn't pointing to this metadata, since
+    // that would get invalidated if a resize is needed
+    size_t bufferSize = get_camera_metadata_size(mBuffer);
+    uintptr_t bufAddr = reinterpret_cast<uintptr_t>(mBuffer);
+    uintptr_t dataAddr = reinterpret_cast<uintptr_t>(data);
+    if (dataAddr > bufAddr && dataAddr < (bufAddr + bufferSize)) {
+        ALOGE("%s: Update attempted with data from the same metadata buffer!",
+                __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+
+    size_t data_size = calculate_camera_metadata_entry_data_size(type,
+            data_count);
+
+    res = resizeIfNeeded(1, data_size);
+
+    if (res == OK) {
+        camera_metadata_entry_t entry;
+        res = find_camera_metadata_entry(mBuffer, tag, &entry);
+        if (res == NAME_NOT_FOUND) {
+            res = add_camera_metadata_entry(mBuffer,
+                    tag, data, data_count);
+        } else if (res == OK) {
+            res = update_camera_metadata_entry(mBuffer,
+                    entry.index, data, data_count, NULL);
+        }
+    }
+
+    if (res != OK) {
+        ALOGE("%s: Unable to update metadata entry %s.%s (%x): %s (%d)",
+                __FUNCTION__, get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+    }
+
+    IF_ALOGV() {
+        ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/NULL) !=
+                 OK,
+
+                 "%s: Failed to validate metadata structure after update %p",
+                 __FUNCTION__, mBuffer);
+    }
+
+    return res;
+}
+
+bool CameraMetadata::exists(uint32_t tag) const {
+    camera_metadata_ro_entry entry;
+    return find_camera_metadata_ro_entry(mBuffer, tag, &entry) == 0;
+}
+
+camera_metadata_entry_t CameraMetadata::find(uint32_t tag) {
+    status_t res;
+    camera_metadata_entry entry;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        entry.count = 0;
+        return entry;
+    }
+    res = find_camera_metadata_entry(mBuffer, tag, &entry);
+    if (CC_UNLIKELY( res != OK )) {
+        entry.count = 0;
+        entry.data.u8 = NULL;
+    }
+    return entry;
+}
+
+camera_metadata_ro_entry_t CameraMetadata::find(uint32_t tag) const {
+    status_t res;
+    camera_metadata_ro_entry entry;
+    res = find_camera_metadata_ro_entry(mBuffer, tag, &entry);
+    if (CC_UNLIKELY( res != OK )) {
+        entry.count = 0;
+        entry.data.u8 = NULL;
+    }
+    return entry;
+}
+
+status_t CameraMetadata::erase(uint32_t tag) {
+    camera_metadata_entry_t entry;
+    status_t res;
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    res = find_camera_metadata_entry(mBuffer, tag, &entry);
+    if (res == NAME_NOT_FOUND) {
+        return OK;
+    } else if (res != OK) {
+        ALOGE("%s: Error looking for entry %s.%s (%x): %s %d",
+                __FUNCTION__,
+                get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+        return res;
+    }
+    res = delete_camera_metadata_entry(mBuffer, entry.index);
+    if (res != OK) {
+        ALOGE("%s: Error deleting entry %s.%s (%x): %s %d",
+                __FUNCTION__,
+                get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+    }
+    return res;
+}
+
+void CameraMetadata::dump(int fd, int verbosity, int indentation) const {
+    dump_indented_camera_metadata(mBuffer, fd, verbosity, indentation);
+}
+
+status_t CameraMetadata::resizeIfNeeded(size_t extraEntries, size_t extraData) {
+    if (mBuffer == NULL) {
+        mBuffer = allocate_camera_metadata(extraEntries * 2, extraData * 2);
+        if (mBuffer == NULL) {
+            ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__);
+            return NO_MEMORY;
+        }
+    } else {
+        size_t currentEntryCount = get_camera_metadata_entry_count(mBuffer);
+        size_t currentEntryCap = get_camera_metadata_entry_capacity(mBuffer);
+        size_t newEntryCount = currentEntryCount +
+                extraEntries;
+        newEntryCount = (newEntryCount > currentEntryCap) ?
+                newEntryCount * 2 : currentEntryCap;
+
+        size_t currentDataCount = get_camera_metadata_data_count(mBuffer);
+        size_t currentDataCap = get_camera_metadata_data_capacity(mBuffer);
+        size_t newDataCount = currentDataCount +
+                extraData;
+        newDataCount = (newDataCount > currentDataCap) ?
+                newDataCount * 2 : currentDataCap;
+
+        if (newEntryCount > currentEntryCap ||
+                newDataCount > currentDataCap) {
+            camera_metadata_t *oldBuffer = mBuffer;
+            mBuffer = allocate_camera_metadata(newEntryCount,
+                    newDataCount);
+            if (mBuffer == NULL) {
+                ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__);
+                return NO_MEMORY;
+            }
+            append_camera_metadata(mBuffer, oldBuffer);
+            free_camera_metadata(oldBuffer);
+        }
+    }
+    return OK;
+}
+
+void CameraMetadata::swap(CameraMetadata& other) {
+    if (mLocked) {
+        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
+        return;
+    } else if (other.mLocked) {
+        ALOGE("%s: Other CameraMetadata is locked", __FUNCTION__);
+        return;
+    }
+
+    camera_metadata* thisBuf = mBuffer;
+    camera_metadata* otherBuf = other.mBuffer;
+
+    other.mBuffer = thisBuf;
+    mBuffer = otherBuf;
+}
+
+status_t CameraMetadata::getTagFromName(const char *name,
+        const VendorTagDescriptor* vTags, uint32_t *tag) {
+
+    if (name == nullptr || tag == nullptr) return BAD_VALUE;
+
+    size_t nameLength = strlen(name);
+
+    const SortedVector<String8> *vendorSections;
+    size_t vendorSectionCount = 0;
+
+    if (vTags != NULL) {
+        vendorSections = vTags->getAllSectionNames();
+        vendorSectionCount = vendorSections->size();
+    }
+
+    // First, find the section by the longest string match
+    const char *section = NULL;
+    size_t sectionIndex = 0;
+    size_t sectionLength = 0;
+    size_t totalSectionCount = ANDROID_SECTION_COUNT + vendorSectionCount;
+    for (size_t i = 0; i < totalSectionCount; ++i) {
+
+        const char *str = (i < ANDROID_SECTION_COUNT) ? camera_metadata_section_names[i] :
+                (*vendorSections)[i - ANDROID_SECTION_COUNT].string();
+
+        ALOGV("%s: Trying to match against section '%s'", __FUNCTION__, str);
+
+        if (strstr(name, str) == name) { // name begins with the section name
+            size_t strLength = strlen(str);
+
+            ALOGV("%s: Name begins with section name", __FUNCTION__);
+
+            // section name is the longest we've found so far
+            if (section == NULL || sectionLength < strLength) {
+                section = str;
+                sectionIndex = i;
+                sectionLength = strLength;
+
+                ALOGV("%s: Found new best section (%s)", __FUNCTION__, section);
+            }
+        }
+    }
+
+    // TODO: Make above get_camera_metadata_section_from_name ?
+
+    if (section == NULL) {
+        return NAME_NOT_FOUND;
+    } else {
+        ALOGV("%s: Found matched section '%s' (%zu)",
+              __FUNCTION__, section, sectionIndex);
+    }
+
+    // Get the tag name component of the name
+    const char *nameTagName = name + sectionLength + 1; // x.y.z -> z
+    if (sectionLength + 1 >= nameLength) {
+        return BAD_VALUE;
+    }
+
+    // Match rest of name against the tag names in that section only
+    uint32_t candidateTag = 0;
+    if (sectionIndex < ANDROID_SECTION_COUNT) {
+        // Match built-in tags (typically android.*)
+        uint32_t tagBegin, tagEnd; // [tagBegin, tagEnd)
+        tagBegin = camera_metadata_section_bounds[sectionIndex][0];
+        tagEnd = camera_metadata_section_bounds[sectionIndex][1];
+
+        for (candidateTag = tagBegin; candidateTag < tagEnd; ++candidateTag) {
+            const char *tagName = get_camera_metadata_tag_name(candidateTag);
+
+            if (strcmp(nameTagName, tagName) == 0) {
+                ALOGV("%s: Found matched tag '%s' (%d)",
+                      __FUNCTION__, tagName, candidateTag);
+                break;
+            }
+        }
+
+        if (candidateTag == tagEnd) {
+            return NAME_NOT_FOUND;
+        }
+    } else if (vTags != NULL) {
+        // Match vendor tags (typically com.*)
+        const String8 sectionName(section);
+        const String8 tagName(nameTagName);
+
+        status_t res = OK;
+        if ((res = vTags->lookupTag(tagName, sectionName, &candidateTag)) != OK) {
+            return NAME_NOT_FOUND;
+        }
+    }
+
+    *tag = candidateTag;
+    return OK;
+}
+
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
diff --git a/camera/common/1.0/default/CameraModule.cpp b/camera/common/1.0/default/CameraModule.cpp
new file mode 100644
index 0000000..5d9ae4d
--- /dev/null
+++ b/camera/common/1.0/default/CameraModule.cpp
@@ -0,0 +1,451 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CamComm1.0-CamModule"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <utils/Trace.h>
+
+#include "CameraModule.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
+void CameraModule::deriveCameraCharacteristicsKeys(
+        uint32_t deviceVersion, CameraMetadata &chars) {
+    ATRACE_CALL();
+
+    Vector<int32_t> derivedCharKeys;
+    Vector<int32_t> derivedRequestKeys;
+    Vector<int32_t> derivedResultKeys;
+    // Keys added in HAL3.3
+    if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_3) {
+        Vector<uint8_t> controlModes;
+        uint8_t data = ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE;
+        chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/1);
+        data = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE;
+        chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/1);
+        controlModes.push(ANDROID_CONTROL_MODE_AUTO);
+        camera_metadata_entry entry = chars.find(ANDROID_CONTROL_AVAILABLE_SCENE_MODES);
+        if (entry.count > 1 || entry.data.u8[0] != ANDROID_CONTROL_SCENE_MODE_DISABLED) {
+            controlModes.push(ANDROID_CONTROL_MODE_USE_SCENE_MODE);
+        }
+
+        // Only advertise CONTROL_OFF mode if 3A manual controls are supported.
+        bool isManualAeSupported = false;
+        bool isManualAfSupported = false;
+        bool isManualAwbSupported = false;
+        entry = chars.find(ANDROID_CONTROL_AE_AVAILABLE_MODES);
+        if (entry.count > 0) {
+            for (size_t i = 0; i < entry.count; i++) {
+                if (entry.data.u8[i] == ANDROID_CONTROL_AE_MODE_OFF) {
+                    isManualAeSupported = true;
+                    break;
+                }
+            }
+        }
+        entry = chars.find(ANDROID_CONTROL_AF_AVAILABLE_MODES);
+        if (entry.count > 0) {
+            for (size_t i = 0; i < entry.count; i++) {
+                if (entry.data.u8[i] == ANDROID_CONTROL_AF_MODE_OFF) {
+                    isManualAfSupported = true;
+                    break;
+                }
+            }
+        }
+        entry = chars.find(ANDROID_CONTROL_AWB_AVAILABLE_MODES);
+        if (entry.count > 0) {
+            for (size_t i = 0; i < entry.count; i++) {
+                if (entry.data.u8[i] == ANDROID_CONTROL_AWB_MODE_OFF) {
+                    isManualAwbSupported = true;
+                    break;
+                }
+            }
+        }
+        if (isManualAeSupported && isManualAfSupported && isManualAwbSupported) {
+            controlModes.push(ANDROID_CONTROL_MODE_OFF);
+        }
+
+        chars.update(ANDROID_CONTROL_AVAILABLE_MODES, controlModes);
+
+        entry = chars.find(ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS);
+        // HAL3.2 devices passing existing CTS test should all support all LSC modes and LSC map
+        bool lensShadingModeSupported = false;
+        if (entry.count > 0) {
+            for (size_t i = 0; i < entry.count; i++) {
+                if (entry.data.i32[i] == ANDROID_SHADING_MODE) {
+                    lensShadingModeSupported = true;
+                    break;
+                }
+            }
+        }
+        Vector<uint8_t> lscModes;
+        Vector<uint8_t> lscMapModes;
+        lscModes.push(ANDROID_SHADING_MODE_FAST);
+        lscModes.push(ANDROID_SHADING_MODE_HIGH_QUALITY);
+        lscMapModes.push(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);
+        if (lensShadingModeSupported) {
+            lscModes.push(ANDROID_SHADING_MODE_OFF);
+            lscMapModes.push(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON);
+        }
+        chars.update(ANDROID_SHADING_AVAILABLE_MODES, lscModes);
+        chars.update(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, lscMapModes);
+
+        derivedCharKeys.push(ANDROID_CONTROL_AE_LOCK_AVAILABLE);
+        derivedCharKeys.push(ANDROID_CONTROL_AWB_LOCK_AVAILABLE);
+        derivedCharKeys.push(ANDROID_CONTROL_AVAILABLE_MODES);
+        derivedCharKeys.push(ANDROID_SHADING_AVAILABLE_MODES);
+        derivedCharKeys.push(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES);
+
+        // Need update android.control.availableHighSpeedVideoConfigurations since HAL3.3
+        // adds batch size to this array.
+        entry = chars.find(ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS);
+        if (entry.count > 0) {
+            Vector<int32_t> highSpeedConfig;
+            for (size_t i = 0; i < entry.count; i += 4) {
+                highSpeedConfig.add(entry.data.i32[i]); // width
+                highSpeedConfig.add(entry.data.i32[i + 1]); // height
+                highSpeedConfig.add(entry.data.i32[i + 2]); // fps_min
+                highSpeedConfig.add(entry.data.i32[i + 3]); // fps_max
+                highSpeedConfig.add(1); // batchSize_max. default to 1 for HAL3.2
+            }
+            chars.update(ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS,
+                    highSpeedConfig);
+        }
+    }
+
+    // Keys added in HAL3.4
+    if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_4) {
+        // Check if HAL supports RAW_OPAQUE output
+        camera_metadata_entry entry = chars.find(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS);
+        bool supportRawOpaque = false;
+        bool supportAnyRaw = false;
+        const int STREAM_CONFIGURATION_SIZE = 4;
+        const int STREAM_FORMAT_OFFSET = 0;
+        const int STREAM_WIDTH_OFFSET = 1;
+        const int STREAM_HEIGHT_OFFSET = 2;
+        const int STREAM_IS_INPUT_OFFSET = 3;
+        Vector<int32_t> rawOpaqueSizes;
+
+        for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) {
+            int32_t format = entry.data.i32[i + STREAM_FORMAT_OFFSET];
+            int32_t width = entry.data.i32[i + STREAM_WIDTH_OFFSET];
+            int32_t height = entry.data.i32[i + STREAM_HEIGHT_OFFSET];
+            int32_t isInput = entry.data.i32[i + STREAM_IS_INPUT_OFFSET];
+            if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
+                    format == HAL_PIXEL_FORMAT_RAW_OPAQUE) {
+                supportRawOpaque = true;
+                rawOpaqueSizes.push(width);
+                rawOpaqueSizes.push(height);
+                // 2 bytes per pixel. This rough estimation is only used when
+                // HAL does not fill in the opaque raw size
+                rawOpaqueSizes.push(width * height *2);
+            }
+            if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
+                    (format == HAL_PIXEL_FORMAT_RAW16 ||
+                     format == HAL_PIXEL_FORMAT_RAW10 ||
+                     format == HAL_PIXEL_FORMAT_RAW12 ||
+                     format == HAL_PIXEL_FORMAT_RAW_OPAQUE)) {
+                supportAnyRaw = true;
+            }
+        }
+
+        if (supportRawOpaque) {
+            entry = chars.find(ANDROID_SENSOR_OPAQUE_RAW_SIZE);
+            if (entry.count == 0) {
+                // Fill in estimated value if HAL does not list it
+                chars.update(ANDROID_SENSOR_OPAQUE_RAW_SIZE, rawOpaqueSizes);
+                derivedCharKeys.push(ANDROID_SENSOR_OPAQUE_RAW_SIZE);
+            }
+        }
+
+        // Check if HAL supports any RAW output, if so, fill in postRawSensitivityBoost range
+        if (supportAnyRaw) {
+            int32_t defaultRange[2] = {100, 100};
+            entry = chars.find(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE);
+            if (entry.count == 0) {
+                // Fill in default value (100, 100)
+                chars.update(
+                        ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE,
+                        defaultRange, 2);
+                derivedCharKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE);
+                // Actual request/results will be derived by camera device.
+                derivedRequestKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST);
+                derivedResultKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST);
+            }
+        }
+    }
+
+    // Always add a default for the pre-correction active array if the vendor chooses to omit this
+    camera_metadata_entry entry = chars.find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);
+    if (entry.count == 0) {
+        Vector<int32_t> preCorrectionArray;
+        entry = chars.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE);
+        preCorrectionArray.appendArray(entry.data.i32, entry.count);
+        chars.update(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, preCorrectionArray);
+        derivedCharKeys.push(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);
+    }
+
+    // Add those newly added keys to AVAILABLE_CHARACTERISTICS_KEYS
+    // This has to be done at this end of this function.
+    if (derivedCharKeys.size() > 0) {
+        appendAvailableKeys(
+                chars, ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, derivedCharKeys);
+    }
+    if (derivedRequestKeys.size() > 0) {
+        appendAvailableKeys(
+                chars, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, derivedRequestKeys);
+    }
+    if (derivedResultKeys.size() > 0) {
+        appendAvailableKeys(
+                chars, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, derivedResultKeys);
+    }
+    return;
+}
+
+void CameraModule::appendAvailableKeys(CameraMetadata &chars,
+        int32_t keyTag, const Vector<int32_t>& appendKeys) {
+    camera_metadata_entry entry = chars.find(keyTag);
+    Vector<int32_t> availableKeys;
+    availableKeys.setCapacity(entry.count + appendKeys.size());
+    for (size_t i = 0; i < entry.count; i++) {
+        availableKeys.push(entry.data.i32[i]);
+    }
+    for (size_t i = 0; i < appendKeys.size(); i++) {
+        availableKeys.push(appendKeys[i]);
+    }
+    chars.update(keyTag, availableKeys);
+}
+
+CameraModule::CameraModule(camera_module_t *module) {
+    if (module == NULL) {
+        ALOGE("%s: camera hardware module must not be null", __FUNCTION__);
+        assert(0);
+    }
+    mModule = module;
+}
+
+CameraModule::~CameraModule()
+{
+    while (mCameraInfoMap.size() > 0) {
+        camera_info cameraInfo = mCameraInfoMap.editValueAt(0);
+        if (cameraInfo.static_camera_characteristics != NULL) {
+            free_camera_metadata(
+                    const_cast<camera_metadata_t*>(cameraInfo.static_camera_characteristics));
+        }
+        mCameraInfoMap.removeItemsAt(0);
+    }
+}
+
+int CameraModule::init() {
+    ATRACE_CALL();
+    int res = OK;
+    if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 &&
+            mModule->init != NULL) {
+        ATRACE_BEGIN("camera_module->init");
+        res = mModule->init();
+        ATRACE_END();
+    }
+    mCameraInfoMap.setCapacity(getNumberOfCameras());
+    return res;
+}
+
+int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
+    ATRACE_CALL();
+    Mutex::Autolock lock(mCameraInfoLock);
+    if (cameraId < 0) {
+        ALOGE("%s: Invalid camera ID %d", __FUNCTION__, cameraId);
+        return -EINVAL;
+    }
+
+    // Only override static_camera_characteristics for API2 devices
+    int apiVersion = mModule->common.module_api_version;
+    if (apiVersion < CAMERA_MODULE_API_VERSION_2_0) {
+        int ret;
+        ATRACE_BEGIN("camera_module->get_camera_info");
+        ret = mModule->get_camera_info(cameraId, info);
+        // Fill in this so CameraService won't be confused by
+        // possibly 0 device_version
+        info->device_version = CAMERA_DEVICE_API_VERSION_1_0;
+        ATRACE_END();
+        return ret;
+    }
+
+    ssize_t index = mCameraInfoMap.indexOfKey(cameraId);
+    if (index == NAME_NOT_FOUND) {
+        // Get camera info from raw module and cache it
+        camera_info rawInfo, cameraInfo;
+        ATRACE_BEGIN("camera_module->get_camera_info");
+        int ret = mModule->get_camera_info(cameraId, &rawInfo);
+        ATRACE_END();
+        if (ret != 0) {
+            return ret;
+        }
+        int deviceVersion = rawInfo.device_version;
+        if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_0) {
+            // static_camera_characteristics is invalid
+            *info = rawInfo;
+            return ret;
+        }
+        CameraMetadata m;
+        m = rawInfo.static_camera_characteristics;
+        deriveCameraCharacteristicsKeys(rawInfo.device_version, m);
+        cameraInfo = rawInfo;
+        cameraInfo.static_camera_characteristics = m.release();
+        index = mCameraInfoMap.add(cameraId, cameraInfo);
+    }
+
+    assert(index != NAME_NOT_FOUND);
+    // return the cached camera info
+    *info = mCameraInfoMap[index];
+    return OK;
+}
+
+int CameraModule::getDeviceVersion(int cameraId) {
+    ssize_t index = mDeviceVersionMap.indexOfKey(cameraId);
+    if (index == NAME_NOT_FOUND) {
+        int deviceVersion;
+        if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_0) {
+            struct camera_info info;
+            getCameraInfo(cameraId, &info);
+            deviceVersion = info.device_version;
+        } else {
+            deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
+        }
+        index = mDeviceVersionMap.add(cameraId, deviceVersion);
+    }
+    assert(index != NAME_NOT_FOUND);
+    return mDeviceVersionMap[index];
+}
+
+int CameraModule::open(const char* id, struct hw_device_t** device) {
+    int res;
+    ATRACE_BEGIN("camera_module->open");
+    res = filterOpenErrorCode(mModule->common.methods->open(&mModule->common, id, device));
+    ATRACE_END();
+    return res;
+}
+
+bool CameraModule::isOpenLegacyDefined() const {
+    if (getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_3) {
+        return false;
+    }
+    return mModule->open_legacy != NULL;
+}
+
+int CameraModule::openLegacy(
+        const char* id, uint32_t halVersion, struct hw_device_t** device) {
+    int res;
+    ATRACE_BEGIN("camera_module->open_legacy");
+    res = mModule->open_legacy(&mModule->common, id, halVersion, device);
+    ATRACE_END();
+    return res;
+}
+
+int CameraModule::getNumberOfCameras() {
+    int numCameras;
+    ATRACE_BEGIN("camera_module->get_number_of_cameras");
+    numCameras = mModule->get_number_of_cameras();
+    ATRACE_END();
+    return numCameras;
+}
+
+int CameraModule::setCallbacks(const camera_module_callbacks_t *callbacks) {
+    int res;
+    ATRACE_BEGIN("camera_module->set_callbacks");
+    res = mModule->set_callbacks(callbacks);
+    ATRACE_END();
+    return res;
+}
+
+bool CameraModule::isVendorTagDefined() const {
+    return mModule->get_vendor_tag_ops != NULL;
+}
+
+void CameraModule::getVendorTagOps(vendor_tag_ops_t* ops) {
+    if (mModule->get_vendor_tag_ops) {
+        ATRACE_BEGIN("camera_module->get_vendor_tag_ops");
+        mModule->get_vendor_tag_ops(ops);
+        ATRACE_END();
+    }
+}
+
+bool CameraModule::isSetTorchModeSupported() const {
+    if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4) {
+        if (mModule->set_torch_mode == NULL) {
+            ALOGE("%s: Module 2.4 device must support set torch API!",
+                    __FUNCTION__);
+            return false;
+        }
+        return true;
+    }
+    return false;
+}
+
+int CameraModule::setTorchMode(const char* camera_id, bool enable) {
+    int res = INVALID_OPERATION;
+    if (mModule->set_torch_mode != NULL) {
+        ATRACE_BEGIN("camera_module->set_torch_mode");
+        res = mModule->set_torch_mode(camera_id, enable);
+        ATRACE_END();
+    }
+    return res;
+}
+
+status_t CameraModule::filterOpenErrorCode(status_t err) {
+    switch(err) {
+        case NO_ERROR:
+        case -EBUSY:
+        case -EINVAL:
+        case -EUSERS:
+            return err;
+        default:
+            break;
+    }
+    return -ENODEV;
+}
+
+uint16_t CameraModule::getModuleApiVersion() const {
+    return mModule->common.module_api_version;
+}
+
+const char* CameraModule::getModuleName() const {
+    return mModule->common.name;
+}
+
+uint16_t CameraModule::getHalApiVersion() const {
+    return mModule->common.hal_api_version;
+}
+
+const char* CameraModule::getModuleAuthor() const {
+    return mModule->common.author;
+}
+
+void* CameraModule::getDso() {
+    return mModule->common.dso;
+}
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
diff --git a/camera/common/1.0/default/VendorTagDescriptor.cpp b/camera/common/1.0/default/VendorTagDescriptor.cpp
new file mode 100644
index 0000000..db884a8
--- /dev/null
+++ b/camera/common/1.0/default/VendorTagDescriptor.cpp
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CamComm1.0-VTDesc"
+
+#include <utils/Errors.h>
+#include <utils/Log.h>
+#include <utils/Mutex.h>
+#include <utils/Vector.h>
+#include <utils/SortedVector.h>
+#include <system/camera_metadata.h>
+#include <camera_metadata_hidden.h>
+
+#include "VendorTagDescriptor.h"
+
+#include <stdio.h>
+#include <string.h>
+
+namespace android {
+namespace hardware {
+namespace camera2 {
+namespace params {
+
+VendorTagDescriptor::~VendorTagDescriptor() {
+    size_t len = mReverseMapping.size();
+    for (size_t i = 0; i < len; ++i)  {
+        delete mReverseMapping[i];
+    }
+}
+
+VendorTagDescriptor::VendorTagDescriptor() :
+        mTagCount(0),
+        mVendorOps() {
+}
+
+VendorTagDescriptor::VendorTagDescriptor(const VendorTagDescriptor& src) {
+    copyFrom(src);
+}
+
+VendorTagDescriptor& VendorTagDescriptor::operator=(const VendorTagDescriptor& rhs) {
+    copyFrom(rhs);
+    return *this;
+}
+
+void VendorTagDescriptor::copyFrom(const VendorTagDescriptor& src) {
+    if (this == &src) return;
+
+    size_t len = mReverseMapping.size();
+    for (size_t i = 0; i < len; ++i) {
+        delete mReverseMapping[i];
+    }
+    mReverseMapping.clear();
+
+    len = src.mReverseMapping.size();
+    // Have to copy KeyedVectors inside mReverseMapping
+    for (size_t i = 0; i < len; ++i) {
+        KeyedVector<String8, uint32_t>* nameMapper = new KeyedVector<String8, uint32_t>();
+        *nameMapper = *(src.mReverseMapping.valueAt(i));
+        mReverseMapping.add(src.mReverseMapping.keyAt(i), nameMapper);
+    }
+    // Everything else is simple
+    mTagToNameMap = src.mTagToNameMap;
+    mTagToSectionMap = src.mTagToSectionMap;
+    mTagToTypeMap = src.mTagToTypeMap;
+    mSections = src.mSections;
+    mTagCount = src.mTagCount;
+    mVendorOps = src.mVendorOps;
+}
+
+int VendorTagDescriptor::getTagCount() const {
+    size_t size = mTagToNameMap.size();
+    if (size == 0) {
+        return VENDOR_TAG_COUNT_ERR;
+    }
+    return size;
+}
+
+void VendorTagDescriptor::getTagArray(uint32_t* tagArray) const {
+    size_t size = mTagToNameMap.size();
+    for (size_t i = 0; i < size; ++i) {
+        tagArray[i] = mTagToNameMap.keyAt(i);
+    }
+}
+
+const char* VendorTagDescriptor::getSectionName(uint32_t tag) const {
+    ssize_t index = mTagToSectionMap.indexOfKey(tag);
+    if (index < 0) {
+        return VENDOR_SECTION_NAME_ERR;
+    }
+    return mSections[mTagToSectionMap.valueAt(index)].string();
+}
+
+ssize_t VendorTagDescriptor::getSectionIndex(uint32_t tag) const {
+    return mTagToSectionMap.valueFor(tag);
+}
+
+const char* VendorTagDescriptor::getTagName(uint32_t tag) const {
+    ssize_t index = mTagToNameMap.indexOfKey(tag);
+    if (index < 0) {
+        return VENDOR_TAG_NAME_ERR;
+    }
+    return mTagToNameMap.valueAt(index).string();
+}
+
+int VendorTagDescriptor::getTagType(uint32_t tag) const {
+    ssize_t index = mTagToNameMap.indexOfKey(tag);
+    if (index < 0) {
+        return VENDOR_TAG_TYPE_ERR;
+    }
+    return mTagToTypeMap.valueFor(tag);
+}
+
+const SortedVector<String8>* VendorTagDescriptor::getAllSectionNames() const {
+    return &mSections;
+}
+
+status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const {
+    ssize_t index = mReverseMapping.indexOfKey(section);
+    if (index < 0) {
+        ALOGE("%s: Section '%s' does not exist.", __FUNCTION__, section.string());
+        return BAD_VALUE;
+    }
+
+    ssize_t nameIndex = mReverseMapping[index]->indexOfKey(name);
+    if (nameIndex < 0) {
+        ALOGE("%s: Tag name '%s' does not exist.", __FUNCTION__, name.string());
+        return BAD_VALUE;
+    }
+
+    if (tag != NULL) {
+        *tag = mReverseMapping[index]->valueAt(nameIndex);
+    }
+    return OK;
+}
+
+void VendorTagDescriptor::dump(int fd, int verbosity, int indentation) const {
+
+    size_t size = mTagToNameMap.size();
+    if (size == 0) {
+        dprintf(fd, "%*sDumping configured vendor tag descriptors: None set\n",
+                indentation, "");
+        return;
+    }
+
+    dprintf(fd, "%*sDumping configured vendor tag descriptors: %zu entries\n",
+            indentation, "", size);
+    for (size_t i = 0; i < size; ++i) {
+        uint32_t tag =  mTagToNameMap.keyAt(i);
+
+        if (verbosity < 1) {
+            dprintf(fd, "%*s0x%x\n", indentation + 2, "", tag);
+            continue;
+        }
+        String8 name = mTagToNameMap.valueAt(i);
+        uint32_t sectionId = mTagToSectionMap.valueFor(tag);
+        String8 sectionName = mSections[sectionId];
+        int type = mTagToTypeMap.valueFor(tag);
+        const char* typeName = (type >= 0 && type < NUM_TYPES) ?
+                camera_metadata_type_names[type] : "UNKNOWN";
+        dprintf(fd, "%*s0x%x (%s) with type %d (%s) defined in section %s\n", indentation + 2,
+            "", tag, name.string(), type, typeName, sectionName.string());
+    }
+
+}
+
+} // namespace params
+} // namespace camera2
+
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
+extern "C" {
+
+static int vendor_tag_descriptor_get_tag_count(const vendor_tag_ops_t* v);
+static void vendor_tag_descriptor_get_all_tags(const vendor_tag_ops_t* v, uint32_t* tagArray);
+static const char* vendor_tag_descriptor_get_section_name(const vendor_tag_ops_t* v, uint32_t tag);
+static const char* vendor_tag_descriptor_get_tag_name(const vendor_tag_ops_t* v, uint32_t tag);
+static int vendor_tag_descriptor_get_tag_type(const vendor_tag_ops_t* v, uint32_t tag);
+
+} /* extern "C" */
+
+static Mutex sLock;
+static sp<VendorTagDescriptor> sGlobalVendorTagDescriptor;
+
+status_t VendorTagDescriptor::createDescriptorFromOps(const vendor_tag_ops_t* vOps,
+            /*out*/
+            sp<VendorTagDescriptor>& descriptor) {
+    if (vOps == NULL) {
+        ALOGE("%s: vendor_tag_ops argument was NULL.", __FUNCTION__);
+        return BAD_VALUE;
+    }
+
+    int tagCount = vOps->get_tag_count(vOps);
+    if (tagCount < 0 || tagCount > INT32_MAX) {
+        ALOGE("%s: tag count %d from vendor ops is invalid.", __FUNCTION__, tagCount);
+        return BAD_VALUE;
+    }
+
+    Vector<uint32_t> tagArray;
+    LOG_ALWAYS_FATAL_IF(tagArray.resize(tagCount) != tagCount,
+            "%s: too many (%u) vendor tags defined.", __FUNCTION__, tagCount);
+
+    vOps->get_all_tags(vOps, /*out*/tagArray.editArray());
+
+    sp<VendorTagDescriptor> desc = new VendorTagDescriptor();
+    desc->mTagCount = tagCount;
+
+    SortedVector<String8> sections;
+    KeyedVector<uint32_t, String8> tagToSectionMap;
+
+    for (size_t i = 0; i < static_cast<size_t>(tagCount); ++i) {
+        uint32_t tag = tagArray[i];
+        if (tag < CAMERA_METADATA_VENDOR_TAG_BOUNDARY) {
+            ALOGE("%s: vendor tag %d not in vendor tag section.", __FUNCTION__, tag);
+            return BAD_VALUE;
+        }
+        const char *tagName = vOps->get_tag_name(vOps, tag);
+        if (tagName == NULL) {
+            ALOGE("%s: no tag name defined for vendor tag %d.", __FUNCTION__, tag);
+            return BAD_VALUE;
+        }
+        desc->mTagToNameMap.add(tag, String8(tagName));
+        const char *sectionName = vOps->get_section_name(vOps, tag);
+        if (sectionName == NULL) {
+            ALOGE("%s: no section name defined for vendor tag %d.", __FUNCTION__, tag);
+            return BAD_VALUE;
+        }
+
+        String8 sectionString(sectionName);
+
+        sections.add(sectionString);
+        tagToSectionMap.add(tag, sectionString);
+
+        int tagType = vOps->get_tag_type(vOps, tag);
+        if (tagType < 0 || tagType >= NUM_TYPES) {
+            ALOGE("%s: tag type %d from vendor ops does not exist.", __FUNCTION__, tagType);
+            return BAD_VALUE;
+        }
+        desc->mTagToTypeMap.add(tag, tagType);
+    }
+
+    desc->mSections = sections;
+
+    for (size_t i = 0; i < static_cast<size_t>(tagCount); ++i) {
+        uint32_t tag = tagArray[i];
+        String8 sectionString = tagToSectionMap.valueFor(tag);
+
+        // Set up tag to section index map
+        ssize_t index = sections.indexOf(sectionString);
+        LOG_ALWAYS_FATAL_IF(index < 0, "index %zd must be non-negative", index);
+        desc->mTagToSectionMap.add(tag, static_cast<uint32_t>(index));
+
+        // Set up reverse mapping
+        ssize_t reverseIndex = -1;
+        if ((reverseIndex = desc->mReverseMapping.indexOfKey(sectionString)) < 0) {
+            KeyedVector<String8, uint32_t>* nameMapper = new KeyedVector<String8, uint32_t>();
+            reverseIndex = desc->mReverseMapping.add(sectionString, nameMapper);
+        }
+        desc->mReverseMapping[reverseIndex]->add(desc->mTagToNameMap.valueFor(tag), tag);
+    }
+
+    descriptor = desc;
+    return OK;
+}
+
+status_t VendorTagDescriptor::setAsGlobalVendorTagDescriptor(const sp<VendorTagDescriptor>& desc) {
+    status_t res = OK;
+    Mutex::Autolock al(sLock);
+    sGlobalVendorTagDescriptor = desc;
+
+    vendor_tag_ops_t* opsPtr = NULL;
+    if (desc != NULL) {
+        opsPtr = &(desc->mVendorOps);
+        opsPtr->get_tag_count = vendor_tag_descriptor_get_tag_count;
+        opsPtr->get_all_tags = vendor_tag_descriptor_get_all_tags;
+        opsPtr->get_section_name = vendor_tag_descriptor_get_section_name;
+        opsPtr->get_tag_name = vendor_tag_descriptor_get_tag_name;
+        opsPtr->get_tag_type = vendor_tag_descriptor_get_tag_type;
+    }
+    if((res = set_camera_metadata_vendor_ops(opsPtr)) != OK) {
+        ALOGE("%s: Could not set vendor tag descriptor, received error %s (%d)."
+                , __FUNCTION__, strerror(-res), res);
+    }
+    return res;
+}
+
+void VendorTagDescriptor::clearGlobalVendorTagDescriptor() {
+    Mutex::Autolock al(sLock);
+    set_camera_metadata_vendor_ops(NULL);
+    sGlobalVendorTagDescriptor.clear();
+}
+
+sp<VendorTagDescriptor> VendorTagDescriptor::getGlobalVendorTagDescriptor() {
+    Mutex::Autolock al(sLock);
+    return sGlobalVendorTagDescriptor;
+}
+
+extern "C" {
+
+int vendor_tag_descriptor_get_tag_count(const vendor_tag_ops_t* /*v*/) {
+    Mutex::Autolock al(sLock);
+    if (sGlobalVendorTagDescriptor == NULL) {
+        ALOGE("%s: Vendor tag descriptor not initialized.", __FUNCTION__);
+        return VENDOR_TAG_COUNT_ERR;
+    }
+    return sGlobalVendorTagDescriptor->getTagCount();
+}
+
+void vendor_tag_descriptor_get_all_tags(const vendor_tag_ops_t* /*v*/, uint32_t* tagArray) {
+    Mutex::Autolock al(sLock);
+    if (sGlobalVendorTagDescriptor == NULL) {
+        ALOGE("%s: Vendor tag descriptor not initialized.", __FUNCTION__);
+        return;
+    }
+    sGlobalVendorTagDescriptor->getTagArray(tagArray);
+}
+
+const char* vendor_tag_descriptor_get_section_name(const vendor_tag_ops_t* /*v*/, uint32_t tag) {
+    Mutex::Autolock al(sLock);
+    if (sGlobalVendorTagDescriptor == NULL) {
+        ALOGE("%s: Vendor tag descriptor not initialized.", __FUNCTION__);
+        return VENDOR_SECTION_NAME_ERR;
+    }
+    return sGlobalVendorTagDescriptor->getSectionName(tag);
+}
+
+const char* vendor_tag_descriptor_get_tag_name(const vendor_tag_ops_t* /*v*/, uint32_t tag) {
+    Mutex::Autolock al(sLock);
+    if (sGlobalVendorTagDescriptor == NULL) {
+        ALOGE("%s: Vendor tag descriptor not initialized.", __FUNCTION__);
+        return VENDOR_TAG_NAME_ERR;
+    }
+    return sGlobalVendorTagDescriptor->getTagName(tag);
+}
+
+int vendor_tag_descriptor_get_tag_type(const vendor_tag_ops_t* /*v*/, uint32_t tag) {
+    Mutex::Autolock al(sLock);
+    if (sGlobalVendorTagDescriptor == NULL) {
+        ALOGE("%s: Vendor tag descriptor not initialized.", __FUNCTION__);
+        return VENDOR_TAG_TYPE_ERR;
+    }
+    return sGlobalVendorTagDescriptor->getTagType(tag);
+}
+
+} /* extern "C" */
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
diff --git a/camera/common/1.0/default/include/CameraMetadata.h b/camera/common/1.0/default/include/CameraMetadata.h
new file mode 100644
index 0000000..d5e4d56
--- /dev/null
+++ b/camera/common/1.0/default/include/CameraMetadata.h
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef CAMERA_COMMON_1_0_CAMERAMETADATA_H
+#define CAMERA_COMMON_1_0_CAMERAMETADATA_H
+
+#include "system/camera_metadata.h"
+
+#include <utils/String8.h>
+#include <utils/Vector.h>
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
+class VendorTagDescriptor;
+
+/**
+ * A convenience wrapper around the C-based camera_metadata_t library.
+ */
+class CameraMetadata {
+  public:
+    /** Creates an empty object; best used when expecting to acquire contents
+     * from elsewhere */
+    CameraMetadata();
+    /** Creates an object with space for entryCapacity entries, with
+     * dataCapacity extra storage */
+    CameraMetadata(size_t entryCapacity, size_t dataCapacity = 10);
+
+    ~CameraMetadata();
+
+    /** Takes ownership of passed-in buffer */
+    CameraMetadata(camera_metadata_t *buffer);
+    /** Clones the metadata */
+    CameraMetadata(const CameraMetadata &other);
+
+    /**
+     * Assignment clones metadata buffer.
+     */
+    CameraMetadata &operator=(const CameraMetadata &other);
+    CameraMetadata &operator=(const camera_metadata_t *buffer);
+
+    /**
+     * Get reference to the underlying metadata buffer. Ownership remains with
+     * the CameraMetadata object, but non-const CameraMetadata methods will not
+     * work until unlock() is called. Note that the lock has nothing to do with
+     * thread-safety, it simply prevents the camera_metadata_t pointer returned
+     * here from being accidentally invalidated by CameraMetadata operations.
+     */
+    const camera_metadata_t* getAndLock() const;
+
+    /**
+     * Unlock the CameraMetadata for use again. After this unlock, the pointer
+     * given from getAndLock() may no longer be used. The pointer passed out
+     * from getAndLock must be provided to guarantee that the right object is
+     * being unlocked.
+     */
+    status_t unlock(const camera_metadata_t *buffer) const;
+
+    /**
+     * Release a raw metadata buffer to the caller. After this call,
+     * CameraMetadata no longer references the buffer, and the caller takes
+     * responsibility for freeing the raw metadata buffer (using
+     * free_camera_metadata()), or for handing it to another CameraMetadata
+     * instance.
+     */
+    camera_metadata_t* release();
+
+    /**
+     * Clear the metadata buffer and free all storage used by it
+     */
+    void clear();
+
+    /**
+     * Acquire a raw metadata buffer from the caller. After this call,
+     * the caller no longer owns the raw buffer, and must not free or manipulate it.
+     * If CameraMetadata already contains metadata, it is freed.
+     */
+    void acquire(camera_metadata_t* buffer);
+
+    /**
+     * Acquires raw buffer from other CameraMetadata object. After the call, the argument
+     * object no longer has any metadata.
+     */
+    void acquire(CameraMetadata &other);
+
+    /**
+     * Append metadata from another CameraMetadata object.
+     */
+    status_t append(const CameraMetadata &other);
+
+    /**
+     * Append metadata from a raw camera_metadata buffer
+     */
+    status_t append(const camera_metadata* other);
+
+    /**
+     * Number of metadata entries.
+     */
+    size_t entryCount() const;
+
+    /**
+     * Is the buffer empty (no entires)
+     */
+    bool isEmpty() const;
+
+    /**
+     * Sort metadata buffer for faster find
+     */
+    status_t sort();
+
+    /**
+     * Update metadata entry. Will create entry if it doesn't exist already, and
+     * will reallocate the buffer if insufficient space exists. Overloaded for
+     * the various types of valid data.
+     */
+    status_t update(uint32_t tag,
+            const uint8_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const int32_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const float *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const int64_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const double *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const camera_metadata_rational_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const String8 &string);
+    status_t update(const camera_metadata_ro_entry &entry);
+
+
+    template<typename T>
+    status_t update(uint32_t tag, Vector<T> data) {
+        return update(tag, data.array(), data.size());
+    }
+
+    /**
+     * Check if a metadata entry exists for a given tag id
+     *
+     */
+    bool exists(uint32_t tag) const;
+
+    /**
+     * Get metadata entry by tag id
+     */
+    camera_metadata_entry find(uint32_t tag);
+
+    /**
+     * Get metadata entry by tag id, with no editing
+     */
+    camera_metadata_ro_entry find(uint32_t tag) const;
+
+    /**
+     * Delete metadata entry by tag
+     */
+    status_t erase(uint32_t tag);
+
+    /**
+     * Swap the underlying camera metadata between this and the other
+     * metadata object.
+     */
+    void swap(CameraMetadata &other);
+
+    /**
+     * Dump contents into FD for debugging. The verbosity levels are
+     * 0: Tag entry information only, no data values
+     * 1: Level 0 plus at most 16 data values per entry
+     * 2: All information
+     *
+     * The indentation parameter sets the number of spaces to add to the start
+     * each line of output.
+     */
+    void dump(int fd, int verbosity = 1, int indentation = 0) const;
+
+    /**
+     * Find tag id for a given tag name, also checking vendor tags if available.
+     * On success, returns OK and writes the tag id into tag.
+     *
+     * This is a slow method.
+     */
+    static status_t getTagFromName(const char *name,
+            const VendorTagDescriptor* vTags, uint32_t *tag);
+
+  private:
+    camera_metadata_t *mBuffer;
+    mutable bool       mLocked;
+
+    /**
+     * Check if tag has a given type
+     */
+    status_t checkType(uint32_t tag, uint8_t expectedType);
+
+    /**
+     * Base update entry method
+     */
+    status_t updateImpl(uint32_t tag, const void *data, size_t data_count);
+
+    /**
+     * Resize metadata buffer if needed by reallocating it and copying it over.
+     */
+    status_t resizeIfNeeded(size_t extraEntries, size_t extraData);
+
+};
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
+
+#endif
diff --git a/camera/common/1.0/default/include/CameraModule.h b/camera/common/1.0/default/include/CameraModule.h
new file mode 100644
index 0000000..68d4f90
--- /dev/null
+++ b/camera/common/1.0/default/include/CameraModule.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef CAMERA_COMMON_1_0_CAMERAMODULE_H
+#define CAMERA_COMMON_1_0_CAMERAMODULE_H
+
+#include <hardware/camera.h>
+#include <utils/Mutex.h>
+#include <utils/KeyedVector.h>
+
+#include "CameraMetadata.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+/**
+ * A wrapper class for HAL camera module.
+ *
+ * This class wraps camera_module_t returned from HAL to provide a wrapped
+ * get_camera_info implementation which CameraService generates some
+ * camera characteristics keys defined in newer HAL version on an older HAL.
+ */
+class CameraModule : public RefBase {
+public:
+    explicit CameraModule(camera_module_t *module);
+    virtual ~CameraModule();
+
+    // Must be called after construction
+    // Returns OK on success, NO_INIT on failure
+    int init();
+
+    int getCameraInfo(int cameraId, struct camera_info *info);
+    int getDeviceVersion(int cameraId);
+    int getNumberOfCameras(void);
+    int open(const char* id, struct hw_device_t** device);
+    bool isOpenLegacyDefined() const;
+    int openLegacy(const char* id, uint32_t halVersion, struct hw_device_t** device);
+    int setCallbacks(const camera_module_callbacks_t *callbacks);
+    bool isVendorTagDefined() const;
+    void getVendorTagOps(vendor_tag_ops_t* ops);
+    bool isSetTorchModeSupported() const;
+    int setTorchMode(const char* camera_id, bool enable);
+    uint16_t getModuleApiVersion() const;
+    const char* getModuleName() const;
+    uint16_t getHalApiVersion() const;
+    const char* getModuleAuthor() const;
+    // Only used by CameraModuleFixture native test. Do NOT use elsewhere.
+    void *getDso();
+
+private:
+    // Derive camera characteristics keys defined after HAL device version
+    static void deriveCameraCharacteristicsKeys(uint32_t deviceVersion, CameraMetadata &chars);
+    // Helper function to append available[request|result|chars]Keys
+    static void appendAvailableKeys(CameraMetadata &chars,
+            int32_t keyTag, const Vector<int32_t>& appendKeys);
+    status_t filterOpenErrorCode(status_t err);
+    camera_module_t *mModule;
+    KeyedVector<int, camera_info> mCameraInfoMap;
+    KeyedVector<int, int> mDeviceVersionMap;
+    Mutex mCameraInfoLock;
+};
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
+
+#endif
diff --git a/camera/common/1.0/default/include/VendorTagDescriptor.h b/camera/common/1.0/default/include/VendorTagDescriptor.h
new file mode 100644
index 0000000..8d8ded9
--- /dev/null
+++ b/camera/common/1.0/default/include/VendorTagDescriptor.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H
+#define CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H
+
+#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
+#include <utils/String8.h>
+#include <utils/RefBase.h>
+#include <system/camera_vendor_tags.h>
+
+#include <stdint.h>
+
+namespace android {
+namespace hardware {
+namespace camera2 {
+namespace params {
+
+/**
+ * VendorTagDescriptor objects are containers for the vendor tag
+ * definitions provided, and are typically used to pass the vendor tag
+ * information enumerated by the HAL to clients of the camera service.
+ */
+class VendorTagDescriptor {
+    public:
+        virtual ~VendorTagDescriptor();
+
+        VendorTagDescriptor();
+        VendorTagDescriptor(const VendorTagDescriptor& src);
+        VendorTagDescriptor& operator=(const VendorTagDescriptor& rhs);
+
+        void copyFrom(const VendorTagDescriptor& src);
+
+        /**
+         * The following 'get*' methods implement the corresponding
+         * functions defined in
+         * system/media/camera/include/system/camera_vendor_tags.h
+         */
+
+        // Returns the number of vendor tags defined.
+        int getTagCount() const;
+
+        // Returns an array containing the id's of vendor tags defined.
+        void getTagArray(uint32_t* tagArray) const;
+
+        // Returns the section name string for a given vendor tag id.
+        const char* getSectionName(uint32_t tag) const;
+
+        // Returns the index in section vectors returned in getAllSectionNames()
+        // for a given vendor tag id. -1 if input tag does not exist.
+        ssize_t getSectionIndex(uint32_t tag) const;
+
+        // Returns the tag name string for a given vendor tag id.
+        const char* getTagName(uint32_t tag) const;
+
+        // Returns the tag type for a given vendor tag id.
+        int getTagType(uint32_t tag) const;
+
+        /**
+         * Convenience method to get a vector containing all vendor tag
+         * sections, or an empty vector if none are defined.
+         * The pointer is valid for the lifetime of the VendorTagDescriptor,
+         * or until copyFrom is invoked.
+         */
+        const SortedVector<String8>* getAllSectionNames() const;
+
+        /**
+         * Lookup the tag id for a given tag name and section.
+         *
+         * Returns OK on success, or a negative error code.
+         */
+        status_t lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const;
+
+        /**
+         * Dump the currently configured vendor tags to a file descriptor.
+         */
+        void dump(int fd, int verbosity, int indentation) const;
+
+    protected:
+        KeyedVector<String8, KeyedVector<String8, uint32_t>*> mReverseMapping;
+        KeyedVector<uint32_t, String8> mTagToNameMap;
+        KeyedVector<uint32_t, uint32_t> mTagToSectionMap; // Value is offset in mSections
+        KeyedVector<uint32_t, int32_t> mTagToTypeMap;
+        SortedVector<String8> mSections;
+        // must be int32_t to be compatible with Parcel::writeInt32
+        int32_t mTagCount;
+
+        vendor_tag_ops mVendorOps;
+};
+} /* namespace params */
+} /* namespace camera2 */
+
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
+/**
+ * This version of VendorTagDescriptor must be stored in Android sp<>, and adds support for using it
+ * as a global tag descriptor.
+ *
+ * It's a child class of the basic hardware::camera2::params::VendorTagDescriptor since basic
+ * Parcelable objects cannot require being kept in an sp<> and still work with auto-generated AIDL
+ * interface implementations.
+ */
+class VendorTagDescriptor :
+            public ::android::hardware::camera2::params::VendorTagDescriptor,
+            public LightRefBase<VendorTagDescriptor> {
+
+  public:
+
+    /**
+     * Create a VendorTagDescriptor object from the given vendor_tag_ops_t
+     * struct.
+     *
+     * Returns OK on success, or a negative error code.
+     */
+    static status_t createDescriptorFromOps(const vendor_tag_ops_t* vOps,
+            /*out*/
+            sp<VendorTagDescriptor>& descriptor);
+
+    /**
+     * Sets the global vendor tag descriptor to use for this process.
+     * Camera metadata operations that access vendor tags will use the
+     * vendor tag definitions set this way.
+     *
+     * Returns OK on success, or a negative error code.
+     */
+    static status_t setAsGlobalVendorTagDescriptor(const sp<VendorTagDescriptor>& desc);
+
+    /**
+     * Returns the global vendor tag descriptor used by this process.
+     * This will contain NULL if no vendor tags are defined.
+     */
+    static sp<VendorTagDescriptor> getGlobalVendorTagDescriptor();
+
+    /**
+     * Clears the global vendor tag descriptor used by this process.
+     */
+    static void clearGlobalVendorTagDescriptor();
+
+};
+
+} // namespace helper
+} // namespace V1_0
+} // namespace common
+} // namespace camera
+} // namespace hardware
+} // namespace android
+
+#endif /* CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H */
diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp
index 29e2d81..9a6941a 100644
--- a/camera/device/1.0/Android.bp
+++ b/camera/device/1.0/Android.bp
@@ -32,18 +32,18 @@
         "android/hardware/camera/device/1.0/types.h",
         "android/hardware/camera/device/1.0/ICameraDevice.h",
         "android/hardware/camera/device/1.0/IHwCameraDevice.h",
-        "android/hardware/camera/device/1.0/BnCameraDevice.h",
-        "android/hardware/camera/device/1.0/BpCameraDevice.h",
+        "android/hardware/camera/device/1.0/BnHwCameraDevice.h",
+        "android/hardware/camera/device/1.0/BpHwCameraDevice.h",
         "android/hardware/camera/device/1.0/BsCameraDevice.h",
         "android/hardware/camera/device/1.0/ICameraDeviceCallback.h",
         "android/hardware/camera/device/1.0/IHwCameraDeviceCallback.h",
-        "android/hardware/camera/device/1.0/BnCameraDeviceCallback.h",
-        "android/hardware/camera/device/1.0/BpCameraDeviceCallback.h",
+        "android/hardware/camera/device/1.0/BnHwCameraDeviceCallback.h",
+        "android/hardware/camera/device/1.0/BpHwCameraDeviceCallback.h",
         "android/hardware/camera/device/1.0/BsCameraDeviceCallback.h",
         "android/hardware/camera/device/1.0/ICameraDevicePreviewCallback.h",
         "android/hardware/camera/device/1.0/IHwCameraDevicePreviewCallback.h",
-        "android/hardware/camera/device/1.0/BnCameraDevicePreviewCallback.h",
-        "android/hardware/camera/device/1.0/BpCameraDevicePreviewCallback.h",
+        "android/hardware/camera/device/1.0/BnHwCameraDevicePreviewCallback.h",
+        "android/hardware/camera/device/1.0/BpHwCameraDevicePreviewCallback.h",
         "android/hardware/camera/device/1.0/BsCameraDevicePreviewCallback.h",
     ],
 }
diff --git a/camera/device/3.2/Android.bp b/camera/device/3.2/Android.bp
index 921aced..8b72d5b 100644
--- a/camera/device/3.2/Android.bp
+++ b/camera/device/3.2/Android.bp
@@ -32,18 +32,18 @@
         "android/hardware/camera/device/3.2/types.h",
         "android/hardware/camera/device/3.2/ICameraDevice.h",
         "android/hardware/camera/device/3.2/IHwCameraDevice.h",
-        "android/hardware/camera/device/3.2/BnCameraDevice.h",
-        "android/hardware/camera/device/3.2/BpCameraDevice.h",
+        "android/hardware/camera/device/3.2/BnHwCameraDevice.h",
+        "android/hardware/camera/device/3.2/BpHwCameraDevice.h",
         "android/hardware/camera/device/3.2/BsCameraDevice.h",
         "android/hardware/camera/device/3.2/ICameraDeviceCallback.h",
         "android/hardware/camera/device/3.2/IHwCameraDeviceCallback.h",
-        "android/hardware/camera/device/3.2/BnCameraDeviceCallback.h",
-        "android/hardware/camera/device/3.2/BpCameraDeviceCallback.h",
+        "android/hardware/camera/device/3.2/BnHwCameraDeviceCallback.h",
+        "android/hardware/camera/device/3.2/BpHwCameraDeviceCallback.h",
         "android/hardware/camera/device/3.2/BsCameraDeviceCallback.h",
         "android/hardware/camera/device/3.2/ICameraDeviceSession.h",
         "android/hardware/camera/device/3.2/IHwCameraDeviceSession.h",
-        "android/hardware/camera/device/3.2/BnCameraDeviceSession.h",
-        "android/hardware/camera/device/3.2/BpCameraDeviceSession.h",
+        "android/hardware/camera/device/3.2/BnHwCameraDeviceSession.h",
+        "android/hardware/camera/device/3.2/BpHwCameraDeviceSession.h",
         "android/hardware/camera/device/3.2/BsCameraDeviceSession.h",
     ],
 }
diff --git a/camera/device/3.2/ICameraDeviceSession.hal b/camera/device/3.2/ICameraDeviceSession.hal
index c8cc246..e92d756 100644
--- a/camera/device/3.2/ICameraDeviceSession.hal
+++ b/camera/device/3.2/ICameraDeviceSession.hal
@@ -48,6 +48,8 @@
      *     INTERNAL_ERROR:
      *         An unexpected internal error occurred, and the default settings
      *         are not available.
+     *     ILLEGAL_ARGUMENT:
+     *         The camera HAL does not support the input template type
      *     CAMERA_DISCONNECTED:
      *         An external camera device has been disconnected, and is no longer
      *         available. This camera device interface is now stale, and a new
diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp
new file mode 100644
index 0000000..9820220
--- /dev/null
+++ b/camera/device/3.2/default/Android.bp
@@ -0,0 +1,22 @@
+cc_library_shared {
+    name: "android.hardware.camera.device@3.2-impl",
+    srcs: ["CameraDevice.cpp",
+           "CameraDeviceSession.cpp",
+           "convert.cpp"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+        "android.hardware.camera.device@3.2",
+        "android.hardware.camera.provider@2.4",
+        "liblog",
+        "libhardware",
+        "libcamera_metadata"
+    ],
+    static_libs: [
+        "android.hardware.camera.common@1.0-helper"
+    ],
+    export_include_dirs: ["."]
+}
diff --git a/camera/device/3.2/default/CameraDevice.cpp b/camera/device/3.2/default/CameraDevice.cpp
new file mode 100644
index 0000000..18e0e7b
--- /dev/null
+++ b/camera/device/3.2/default/CameraDevice.cpp
@@ -0,0 +1,285 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CamDev@3.2-impl"
+#include <android/log.h>
+
+#include <utils/Vector.h>
+#include <utils/Trace.h>
+#include "CameraDevice.h"
+#include <include/convert.h>
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+using ::android::hardware::camera::common::V1_0::Status;
+
+CameraDevice::CameraDevice(
+    sp<CameraModule> module, const std::string& cameraId,
+    const SortedVector<std::pair<std::string, std::string>>& cameraDeviceNames) :
+        mModule(module),
+        mCameraId(cameraId),
+        mDisconnected(false),
+        mCameraDeviceNames(cameraDeviceNames) {
+    mCameraIdInt = atoi(mCameraId.c_str());
+    // Should not reach here as provider also validate ID
+    if (mCameraIdInt < 0 || mCameraIdInt >= module->getNumberOfCameras()) {
+        ALOGE("%s: Invalid camera id: %s", __FUNCTION__, mCameraId.c_str());
+        mInitFail = true;
+    }
+
+    mDeviceVersion = mModule->getDeviceVersion(mCameraIdInt);
+    if (mDeviceVersion < CAMERA_DEVICE_API_VERSION_3_2) {
+        ALOGE("%s: Camera id %s does not support HAL3.2+",
+                __FUNCTION__, mCameraId.c_str());
+        mInitFail = true;
+    }
+}
+
+CameraDevice::~CameraDevice() {}
+
+Status CameraDevice::initStatus() const {
+    Mutex::Autolock _l(mLock);
+    Status status = Status::OK;
+    if (mInitFail) {
+        status = Status::INTERNAL_ERROR;
+    } else if (mDisconnected) {
+        status = Status::CAMERA_DISCONNECTED;
+    }
+    return status;
+}
+
+void CameraDevice::setConnectionStatus(bool connected) {
+    Mutex::Autolock _l(mLock);
+    mDisconnected = !connected;
+    if (mSession == nullptr) {
+        return;
+    }
+    sp<CameraDeviceSession> session = mSession.promote();
+    if (session == nullptr) {
+        return;
+    }
+    // Only notify active session disconnect events.
+    // Users will need to re-open camera after disconnect event
+    if (!connected) {
+        session->disconnect();
+    }
+    return;
+}
+
+Status CameraDevice::getHidlStatus(int status) {
+    switch (status) {
+        case 0: return Status::OK;
+        case -ENOSYS: return Status::OPERATION_NOT_SUPPORTED;
+        case -EBUSY : return Status::CAMERA_IN_USE;
+        case -EUSERS: return Status::MAX_CAMERAS_IN_USE;
+        case -ENODEV: return Status::INTERNAL_ERROR;
+        case -EINVAL: return Status::ILLEGAL_ARGUMENT;
+        default:
+            ALOGE("%s: unknown HAL status code %d", __FUNCTION__, status);
+            return Status::INTERNAL_ERROR;
+    }
+}
+
+// Methods from ::android::hardware::camera::device::V3_2::ICameraDevice follow.
+Return<void> CameraDevice::getResourceCost(getResourceCost_cb _hidl_cb)  {
+    Status status = initStatus();
+    CameraResourceCost resCost;
+    if (status == Status::OK) {
+        int cost = 100;
+        std::vector<std::string> conflicting_devices;
+        struct camera_info info;
+
+        // If using post-2.4 module version, query the cost + conflicting devices from the HAL
+        if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4) {
+            int ret = mModule->getCameraInfo(mCameraIdInt, &info);
+            if (ret == OK) {
+                cost = info.resource_cost;
+                for (size_t i = 0; i < info.conflicting_devices_length; i++) {
+                    std::string cameraId(info.conflicting_devices[i]);
+                    for (const auto& pair : mCameraDeviceNames) {
+                        if (cameraId == pair.first) {
+                            conflicting_devices.push_back(pair.second);
+                        }
+                    }
+                }
+            } else {
+                status = Status::INTERNAL_ERROR;
+            }
+        }
+
+        if (status == Status::OK) {
+            resCost.resourceCost = cost;
+            resCost.conflictingDevices.resize(conflicting_devices.size());
+            for (size_t i = 0; i < conflicting_devices.size(); i++) {
+                resCost.conflictingDevices[i] = conflicting_devices[i];
+                ALOGV("CamDevice %s is conflicting with camDevice %s",
+                        mCameraId.c_str(), resCost.conflictingDevices[i].c_str());
+            }
+        }
+    }
+    _hidl_cb(status, resCost);
+    return Void();
+}
+
+Return<void> CameraDevice::getCameraCharacteristics(getCameraCharacteristics_cb _hidl_cb)  {
+    Status status = initStatus();
+    CameraMetadata cameraCharacteristics;
+    if (status == Status::OK) {
+        //Module 2.1+ codepath.
+        struct camera_info info;
+        int ret = mModule->getCameraInfo(mCameraIdInt, &info);
+        if (ret == OK) {
+            convertToHidl(info.static_camera_characteristics, &cameraCharacteristics);
+        } else {
+            ALOGE("%s: get camera info failed!", __FUNCTION__);
+            status = Status::INTERNAL_ERROR;
+        }
+    }
+    _hidl_cb(status, cameraCharacteristics);
+    return Void();
+}
+
+Return<Status> CameraDevice::setTorchMode(TorchMode mode)  {
+    if (!mModule->isSetTorchModeSupported()) {
+        return Status::METHOD_NOT_SUPPORTED;
+    }
+
+    Status status = initStatus();
+    if (status == Status::OK) {
+        bool enable = (mode == TorchMode::ON) ? true : false;
+        status = getHidlStatus(mModule->setTorchMode(mCameraId.c_str(), enable));
+    }
+    return status;
+}
+
+Return<void> CameraDevice::open(const sp<ICameraDeviceCallback>& callback, open_cb _hidl_cb)  {
+    Status status = initStatus();
+    sp<CameraDeviceSession> session = nullptr;
+
+    if (callback == nullptr) {
+        ALOGE("%s: cannot open camera %s. callback is null!",
+                __FUNCTION__, mCameraId.c_str());
+        _hidl_cb(Status::ILLEGAL_ARGUMENT, session);
+        return Void();
+    }
+
+    if (status != Status::OK) {
+        // Provider will never pass initFailed device to client, so
+        // this must be a disconnected camera
+        ALOGE("%s: cannot open camera %s. camera is disconnected!",
+                __FUNCTION__, mCameraId.c_str());
+        _hidl_cb(Status::CAMERA_DISCONNECTED, session);
+        return Void();
+    } else {
+        mLock.lock();
+
+        ALOGV("%s: Initializing device for camera %d", __FUNCTION__, mCameraIdInt);
+        session = mSession.promote();
+        if (session != nullptr && !session->isClosed()) {
+            ALOGE("%s: cannot open an already opened camera!", __FUNCTION__);
+            mLock.unlock();
+            _hidl_cb(Status::CAMERA_IN_USE, nullptr);
+            return Void();
+        }
+
+        /** Open HAL device */
+        status_t res;
+        camera3_device_t *device;
+
+        ATRACE_BEGIN("camera3->open");
+        res = mModule->open(mCameraId.c_str(),
+                reinterpret_cast<hw_device_t**>(&device));
+        ATRACE_END();
+
+        if (res != OK) {
+            ALOGE("%s: cannot open camera %s!", __FUNCTION__, mCameraId.c_str());
+            mLock.unlock();
+            _hidl_cb(getHidlStatus(res), nullptr);
+            return Void();
+        }
+
+        /** Cross-check device version */
+        if (device->common.version < CAMERA_DEVICE_API_VERSION_3_2) {
+            ALOGE("%s: Could not open camera: "
+                    "Camera device should be at least %x, reports %x instead",
+                    __FUNCTION__,
+                    CAMERA_DEVICE_API_VERSION_3_2,
+                    device->common.version);
+            device->common.close(&device->common);
+            mLock.unlock();
+            _hidl_cb(Status::ILLEGAL_ARGUMENT, nullptr);
+            return Void();
+        }
+
+        session = new CameraDeviceSession(device, callback);
+        if (session == nullptr) {
+            ALOGE("%s: camera device session allocation failed", __FUNCTION__);
+            mLock.unlock();
+            _hidl_cb(Status::INTERNAL_ERROR, nullptr);
+            return Void();
+        }
+        if (session->isInitFailed()) {
+            ALOGE("%s: camera device session init failed", __FUNCTION__);
+            session = nullptr;
+            mLock.unlock();
+            _hidl_cb(Status::INTERNAL_ERROR, nullptr);
+            return Void();
+        }
+        mSession = session;
+        mLock.unlock();
+    }
+    _hidl_cb(status, session);
+    return Void();
+}
+
+Return<void> CameraDevice::dumpState(const ::android::hardware::hidl_handle& handle)  {
+    Mutex::Autolock _l(mLock);
+    if (handle.getNativeHandle() == nullptr) {
+        ALOGE("%s: handle must not be null", __FUNCTION__);
+        return Void();
+    }
+    if (handle->numFds != 1 || handle->numInts != 0) {
+        ALOGE("%s: handle must contain 1 FD and 0 integers! Got %d FDs and %d ints",
+                __FUNCTION__, handle->numFds, handle->numInts);
+        return Void();
+    }
+    int fd = handle->data[0];
+    if (mSession == nullptr) {
+        dprintf(fd, "No active camera device session instance\n");
+        return Void();
+    }
+    sp<CameraDeviceSession> session = mSession.promote();
+    if (session == nullptr) {
+        dprintf(fd, "No active camera device session instance\n");
+        return Void();
+    }
+    // Call into active session to dump states
+    session->dumpState(handle);
+    return Void();
+}
+// End of methods from ::android::hardware::camera::device::V3_2::ICameraDevice.
+
+} // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
diff --git a/camera/device/3.2/default/CameraDevice.h b/camera/device/3.2/default/CameraDevice.h
new file mode 100644
index 0000000..317eea5
--- /dev/null
+++ b/camera/device/3.2/default/CameraDevice.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE_H
+#define ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE_H
+
+#include "utils/Mutex.h"
+#include "CameraModule.h"
+#include "CameraMetadata.h"
+#include "CameraDeviceSession.h"
+
+#include <android/hardware/camera/device/3.2/ICameraDevice.h>
+#include <hidl/Status.h>
+#include <hidl/MQDescriptor.h>
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+using ::android::hardware::camera::device::V3_2::RequestTemplate;
+using ::android::hardware::camera::device::V3_2::ICameraDevice;
+using ::android::hardware::camera::device::V3_2::ICameraDeviceCallback;
+using ::android::hardware::camera::device::V3_2::ICameraDeviceSession;
+using ::android::hardware::camera::common::V1_0::CameraResourceCost;
+using ::android::hardware::camera::common::V1_0::Status;
+using ::android::hardware::camera::common::V1_0::TorchMode;
+using ::android::hardware::camera::common::V1_0::helper::CameraModule;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+using ::android::Mutex;
+
+/*
+ * The camera device HAL implementation is opened lazily (via the open call)
+ */
+struct CameraDevice : public ICameraDevice {
+    // Called by provider HAL. Provider HAL must ensure the uniqueness of
+    // CameraDevice object per cameraId, or there could be multiple CameraDevice
+    // trying to access the same physical camera.
+    // Also, provider will have to keep track of all CameraDevice object in
+    // order to notify CameraDevice when the underlying camera is detached
+    CameraDevice(sp<CameraModule> module,
+                 const std::string& cameraId,
+                 const SortedVector<std::pair<std::string, std::string>>& cameraDeviceNames);
+    ~CameraDevice();
+    // Caller must use this method to check if CameraDevice ctor failed
+    bool isInitFailed() { return mInitFail; }
+    // Used by provider HAL to signal external camera disconnected
+    void setConnectionStatus(bool connected);
+
+    /* Methods from ::android::hardware::camera::device::V3_2::ICameraDevice follow. */
+    // The following method can be called without opening the actual camera device
+    Return<void> getResourceCost(getResourceCost_cb _hidl_cb) override;
+    Return<void> getCameraCharacteristics(getCameraCharacteristics_cb _hidl_cb) override;
+    Return<Status> setTorchMode(TorchMode mode) override;
+
+    // Open the device HAL and also return a default capture session
+    Return<void> open(const sp<ICameraDeviceCallback>& callback, open_cb _hidl_cb) override;
+
+
+    // Forward the dump call to the opened session, or do nothing
+    Return<void> dumpState(const ::android::hardware::hidl_handle& fd) override;
+    /* End of Methods from ::android::hardware::camera::device::V3_2::ICameraDevice */
+
+private:
+    // Passed from provider HAL. Should not change.
+    sp<CameraModule> mModule;
+    const std::string mCameraId;
+    // const after ctor
+    int   mCameraIdInt;
+    int   mDeviceVersion;
+    bool  mInitFail = false;
+    // Set by provider (when external camera is connected/disconnected)
+    bool  mDisconnected;
+    wp<CameraDeviceSession> mSession = nullptr;
+
+    const SortedVector<std::pair<std::string, std::string>>& mCameraDeviceNames;
+
+    // gating access to mSession and mDisconnected
+    mutable Mutex mLock;
+
+    // convert conventional HAL status to HIDL Status
+    static Status getHidlStatus(int);
+
+    Status initStatus() const;
+};
+
+}  // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE_H
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
new file mode 100644
index 0000000..26b7b73
--- /dev/null
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -0,0 +1,747 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CamDevSession@3.2-impl"
+#include <android/log.h>
+
+#include <utils/Trace.h>
+#include <hardware/gralloc.h>
+#include <hardware/gralloc1.h>
+#include "CameraDeviceSession.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+namespace {
+
+// Copy pasted from Hwc.cpp. Use this until gralloc mapper HAL is working
+class HandleImporter {
+public:
+    HandleImporter() : mInitialized(false) {}
+
+    bool initialize()
+    {
+        // allow only one client
+        if (mInitialized) {
+            return false;
+        }
+
+        if (!openGralloc()) {
+            return false;
+        }
+
+        mInitialized = true;
+        return true;
+    }
+
+    void cleanup()
+    {
+        if (!mInitialized) {
+            return;
+        }
+
+        closeGralloc();
+        mInitialized = false;
+    }
+
+    // In IComposer, any buffer_handle_t is owned by the caller and we need to
+    // make a clone for hwcomposer2.  We also need to translate empty handle
+    // to nullptr.  This function does that, in-place.
+    bool importBuffer(buffer_handle_t& handle)
+    {
+        if (!handle->numFds && !handle->numInts) {
+            handle = nullptr;
+            return true;
+        }
+
+        buffer_handle_t clone = cloneBuffer(handle);
+        if (!clone) {
+            return false;
+        }
+
+        handle = clone;
+        return true;
+    }
+
+    void freeBuffer(buffer_handle_t handle)
+    {
+        if (!handle) {
+            return;
+        }
+
+        releaseBuffer(handle);
+    }
+
+    bool importFence(const native_handle_t* handle, int& fd)
+    {
+        if (handle == nullptr || handle->numFds == 0) {
+            fd = -1;
+        } else if (handle->numFds == 1) {
+            fd = dup(handle->data[0]);
+            if (fd < 0) {
+                ALOGE("failed to dup fence fd %d", handle->data[0]);
+                return false;
+            }
+        } else {
+            ALOGE("invalid fence handle with %d file descriptors",
+                    handle->numFds);
+            return false;
+        }
+
+        return true;
+    }
+
+    void closeFence(int fd)
+    {
+        if (fd >= 0) {
+            close(fd);
+        }
+    }
+
+private:
+    bool mInitialized;
+
+    // Some existing gralloc drivers do not support retaining more than once,
+    // when we are in passthrough mode.
+#ifdef BINDERIZED
+    bool openGralloc()
+    {
+        const hw_module_t* module;
+        int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+        if (err) {
+            ALOGE("failed to get gralloc module");
+            return false;
+        }
+
+        uint8_t major = (module->module_api_version >> 8) & 0xff;
+        if (major > 1) {
+            ALOGE("unknown gralloc module major version %d", major);
+            return false;
+        }
+
+        if (major == 1) {
+            err = gralloc1_open(module, &mDevice);
+            if (err) {
+                ALOGE("failed to open gralloc1 device");
+                return false;
+            }
+
+            mRetain = reinterpret_cast<GRALLOC1_PFN_RETAIN>(
+                    mDevice->getFunction(mDevice, GRALLOC1_FUNCTION_RETAIN));
+            mRelease = reinterpret_cast<GRALLOC1_PFN_RELEASE>(
+                    mDevice->getFunction(mDevice, GRALLOC1_FUNCTION_RELEASE));
+            if (!mRetain || !mRelease) {
+                ALOGE("invalid gralloc1 device");
+                gralloc1_close(mDevice);
+                return false;
+            }
+        } else {
+            mModule = reinterpret_cast<const gralloc_module_t*>(module);
+        }
+
+        return true;
+    }
+
+    void closeGralloc()
+    {
+        if (mDevice) {
+            gralloc1_close(mDevice);
+        }
+    }
+
+    buffer_handle_t cloneBuffer(buffer_handle_t handle)
+    {
+        native_handle_t* clone = native_handle_clone(handle);
+        if (!clone) {
+            ALOGE("failed to clone buffer %p", handle);
+            return nullptr;
+        }
+
+        bool err;
+        if (mDevice) {
+            err = (mRetain(mDevice, clone) != GRALLOC1_ERROR_NONE);
+        } else {
+            err = (mModule->registerBuffer(mModule, clone) != 0);
+        }
+
+        if (err) {
+            ALOGE("failed to retain/register buffer %p", clone);
+            native_handle_close(clone);
+            native_handle_delete(clone);
+            return nullptr;
+        }
+
+        return clone;
+    }
+
+    void releaseBuffer(buffer_handle_t handle)
+    {
+        if (mDevice) {
+            mRelease(mDevice, handle);
+        } else {
+            mModule->unregisterBuffer(mModule, handle);
+            native_handle_close(handle);
+            native_handle_delete(const_cast<native_handle_t*>(handle));
+        }
+    }
+
+    // gralloc1
+    gralloc1_device_t* mDevice;
+    GRALLOC1_PFN_RETAIN mRetain;
+    GRALLOC1_PFN_RELEASE mRelease;
+
+    // gralloc0
+    const gralloc_module_t* mModule;
+#else
+    bool openGralloc() { return true; }
+    void closeGralloc() {}
+    buffer_handle_t cloneBuffer(buffer_handle_t handle) { return handle; }
+    void releaseBuffer(buffer_handle_t) {}
+#endif
+};
+
+HandleImporter sHandleImporter;
+
+} // Anonymous namespace
+
+CameraDeviceSession::CameraDeviceSession(
+    camera3_device_t* device, const sp<ICameraDeviceCallback>& callback) :
+        camera3_callback_ops({&sProcessCaptureResult, &sNotify}),
+        mDevice(device),
+        mCallback(callback) {
+    // For now, we init sHandleImporter but do not cleanup (keep it alive until
+    // HAL process ends)
+    sHandleImporter.initialize();
+
+    mInitFail = initialize();
+}
+
+bool CameraDeviceSession::initialize() {
+    /** Initialize device with callback functions */
+    ATRACE_BEGIN("camera3->initialize");
+    status_t res = mDevice->ops->initialize(mDevice, this);
+    ATRACE_END();
+
+    if (res != OK) {
+        ALOGE("%s: Unable to initialize HAL device: %s (%d)",
+                __FUNCTION__, strerror(-res), res);
+        mDevice->common.close(&mDevice->common);
+        mClosed = true;
+        return true;
+    }
+    return false;
+}
+
+CameraDeviceSession::~CameraDeviceSession() {
+    if (!isClosed()) {
+        ALOGE("CameraDeviceSession deleted before close!");
+        close();
+    }
+}
+
+bool CameraDeviceSession::isClosed() {
+    Mutex::Autolock _l(mStateLock);
+    return mClosed;
+}
+
+Status CameraDeviceSession::initStatus() const {
+    Mutex::Autolock _l(mStateLock);
+    Status status = Status::OK;
+    if (mInitFail) {
+        status = Status::INTERNAL_ERROR;
+    } else if (mDisconnected) {
+        status = Status::CAMERA_DISCONNECTED;
+    } else if (mClosed) {
+        status = Status::INTERNAL_ERROR;
+    }
+    return status;
+}
+
+void CameraDeviceSession::disconnect() {
+    Mutex::Autolock _l(mStateLock);
+    mDisconnected = true;
+    ALOGW("%s: Camera device is disconnected. Closing.", __FUNCTION__);
+    if (!mClosed) {
+        mDevice->common.close(&mDevice->common);
+        mClosed = true;
+    }
+}
+
+void CameraDeviceSession::dumpState(const native_handle_t* fd) {
+    if (!isClosed()) {
+        mDevice->ops->dump(mDevice, fd->data[0]);
+    }
+}
+
+Status CameraDeviceSession::importRequest(
+        const CaptureRequest& request,
+        hidl_vec<buffer_handle_t*>& allBufPtrs,
+        hidl_vec<int>& allFences) {
+    bool hasInputBuf = (request.inputBuffer.streamId != -1 &&
+            request.inputBuffer.bufferId != 0);
+    size_t numOutputBufs = request.outputBuffers.size();
+    size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
+    // Validate all I/O buffers
+    hidl_vec<buffer_handle_t> allBufs;
+    hidl_vec<uint64_t> allBufIds;
+    allBufs.resize(numBufs);
+    allBufIds.resize(numBufs);
+    allBufPtrs.resize(numBufs);
+    allFences.resize(numBufs);
+    std::vector<int32_t> streamIds(numBufs);
+
+    for (size_t i = 0; i < numOutputBufs; i++) {
+        allBufs[i] = request.outputBuffers[i].buffer.getNativeHandle();
+        allBufIds[i] = request.outputBuffers[i].bufferId;
+        allBufPtrs[i] = &allBufs[i];
+        streamIds[i] = request.outputBuffers[i].streamId;
+    }
+    if (hasInputBuf) {
+        allBufs[numOutputBufs] = request.inputBuffer.buffer.getNativeHandle();
+        allBufIds[numOutputBufs] = request.inputBuffer.bufferId;
+        allBufPtrs[numOutputBufs] = &allBufs[numOutputBufs];
+        streamIds[numOutputBufs] = request.inputBuffer.streamId;
+    }
+
+    for (size_t i = 0; i < numBufs; i++) {
+        buffer_handle_t buf = allBufs[i];
+        uint64_t bufId = allBufIds[i];
+        CirculatingBuffers& cbs = mCirculatingBuffers[streamIds[i]];
+        if (cbs.count(bufId) == 0) {
+            if (buf == nullptr) {
+                ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId);
+                return Status::ILLEGAL_ARGUMENT;
+            }
+            // Register a newly seen buffer
+            buffer_handle_t importedBuf = buf;
+            sHandleImporter.importBuffer(importedBuf);
+            if (importedBuf == nullptr) {
+                ALOGE("%s: output buffer %zu is invalid!", __FUNCTION__, i);
+                return Status::INTERNAL_ERROR;
+            } else {
+                cbs[bufId] = importedBuf;
+            }
+        }
+        allBufPtrs[i] = &cbs[bufId];
+    }
+
+    // All buffers are imported. Now validate output buffer acquire fences
+    for (size_t i = 0; i < numOutputBufs; i++) {
+        if (!sHandleImporter.importFence(
+                request.outputBuffers[i].acquireFence, allFences[i])) {
+            ALOGE("%s: output buffer %zu acquire fence is invalid", __FUNCTION__, i);
+            cleanupInflightFences(allFences, i);
+            return Status::INTERNAL_ERROR;
+        }
+    }
+
+    // Validate input buffer acquire fences
+    if (hasInputBuf) {
+        if (!sHandleImporter.importFence(
+                request.inputBuffer.acquireFence, allFences[numOutputBufs])) {
+            ALOGE("%s: input buffer acquire fence is invalid", __FUNCTION__);
+            cleanupInflightFences(allFences, numOutputBufs);
+            return Status::INTERNAL_ERROR;
+        }
+    }
+    return Status::OK;
+}
+
+void CameraDeviceSession::cleanupInflightFences(
+        hidl_vec<int>& allFences, size_t numFences) {
+    for (size_t j = 0; j < numFences; j++) {
+        sHandleImporter.closeFence(allFences[j]);
+    }
+}
+
+// Methods from ::android::hardware::camera::device::V3_2::ICameraDeviceSession follow.
+Return<void> CameraDeviceSession::constructDefaultRequestSettings(
+        RequestTemplate type, constructDefaultRequestSettings_cb _hidl_cb)  {
+    Status status = initStatus();
+    CameraMetadata outMetadata;
+    const camera_metadata_t *rawRequest;
+    if (status == Status::OK) {
+        ATRACE_BEGIN("camera3->construct_default_request_settings");
+        rawRequest = mDevice->ops->construct_default_request_settings(mDevice, (int) type);
+        ATRACE_END();
+        if (rawRequest == nullptr) {
+            ALOGI("%s: template %d is not supported on this camera device",
+                  __FUNCTION__, type);
+            status = Status::ILLEGAL_ARGUMENT;
+        } else {
+            convertToHidl(rawRequest, &outMetadata);
+        }
+    }
+    _hidl_cb(status, outMetadata);
+    return Void();
+}
+
+Return<void> CameraDeviceSession::configureStreams(
+        const StreamConfiguration& requestedConfiguration, configureStreams_cb _hidl_cb)  {
+    Status status = initStatus();
+    HalStreamConfiguration outStreams;
+
+    // hold the inflight lock for entire configureStreams scope since there must not be any
+    // inflight request/results during stream configuration.
+    Mutex::Autolock _l(mInflightLock);
+    if (!mInflightBuffers.empty()) {
+        ALOGE("%s: trying to configureStreams while there are still %zu inflight buffers!",
+                __FUNCTION__, mInflightBuffers.size());
+        _hidl_cb(Status::INTERNAL_ERROR, outStreams);
+        return Void();
+    }
+
+
+
+    if (status == Status::OK) {
+        camera3_stream_configuration_t stream_list;
+        hidl_vec<camera3_stream_t*> streams;
+
+        stream_list.operation_mode = (uint32_t) requestedConfiguration.operationMode;
+        stream_list.num_streams = requestedConfiguration.streams.size();
+        streams.resize(stream_list.num_streams);
+        stream_list.streams = streams.data();
+
+        for (uint32_t i = 0; i < stream_list.num_streams; i++) {
+            int id = requestedConfiguration.streams[i].id;
+
+            if (mStreamMap.count(id) == 0) {
+                Camera3Stream stream;
+                convertFromHidl(requestedConfiguration.streams[i], &stream);
+                mStreamMap[id] = stream;
+                mCirculatingBuffers.emplace(stream.mId, CirculatingBuffers{});
+            } else {
+                // width/height/format must not change, but usage/rotation might need to change
+                if (mStreamMap[id].stream_type !=
+                        (int) requestedConfiguration.streams[i].streamType ||
+                        mStreamMap[id].width != requestedConfiguration.streams[i].width ||
+                        mStreamMap[id].height != requestedConfiguration.streams[i].height ||
+                        mStreamMap[id].format != (int) requestedConfiguration.streams[i].format ||
+                        mStreamMap[id].data_space != (android_dataspace_t)
+                                requestedConfiguration.streams[i].dataSpace) {
+                    ALOGE("%s: stream %d configuration changed!", __FUNCTION__, id);
+                    _hidl_cb(Status::INTERNAL_ERROR, outStreams);
+                    return Void();
+                }
+                mStreamMap[id].rotation = (int) requestedConfiguration.streams[i].rotation;
+                mStreamMap[id].usage = (uint32_t) requestedConfiguration.streams[i].usage;
+            }
+            streams[i] = &mStreamMap[id];
+        }
+
+        ATRACE_BEGIN("camera3->configure_streams");
+        status_t ret = mDevice->ops->configure_streams(mDevice, &stream_list);
+        ATRACE_END();
+
+        // delete unused streams, note we do this after adding new streams to ensure new stream
+        // will not have the same address as deleted stream, and HAL has a chance to reference
+        // the to be deleted stream in configure_streams call
+        for(auto it = mStreamMap.begin(); it != mStreamMap.end();) {
+            int id = it->first;
+            bool found = false;
+            for (const auto& stream : requestedConfiguration.streams) {
+                if (id == stream.id) {
+                    found = true;
+                    break;
+                }
+            }
+            if (!found) {
+                // Unmap all buffers of deleted stream
+                for (auto& pair : mCirculatingBuffers.at(id)) {
+                    sHandleImporter.freeBuffer(pair.second);
+                }
+                mCirculatingBuffers[id].clear();
+                mCirculatingBuffers.erase(id);
+                it = mStreamMap.erase(it);
+            } else {
+                ++it;
+            }
+        }
+
+        if (ret == -EINVAL) {
+            status = Status::ILLEGAL_ARGUMENT;
+        } else if (ret != OK) {
+            status = Status::INTERNAL_ERROR;
+        } else {
+            convertToHidl(stream_list, &outStreams);
+        }
+
+    }
+    _hidl_cb(status, outStreams);
+    return Void();
+}
+
+Return<Status> CameraDeviceSession::processCaptureRequest(const CaptureRequest& request)  {
+    Status status = initStatus();
+    if (status != Status::OK) {
+        ALOGE("%s: camera init failed or disconnected", __FUNCTION__);
+        return status;
+    }
+
+    camera3_capture_request_t halRequest;
+    halRequest.frame_number = request.frameNumber;
+    bool converted = convertFromHidl(request.settings, &halRequest.settings);
+    if (!converted) {
+        ALOGE("%s: capture request settings metadata is corrupt!", __FUNCTION__);
+        return Status::INTERNAL_ERROR;
+    }
+
+    hidl_vec<buffer_handle_t*> allBufPtrs;
+    hidl_vec<int> allFences;
+    bool hasInputBuf = (request.inputBuffer.streamId != -1 &&
+            request.inputBuffer.bufferId != 0);
+    size_t numOutputBufs = request.outputBuffers.size();
+    size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
+    status = importRequest(request, allBufPtrs, allFences);
+    if (status != Status::OK) {
+        return status;
+    }
+
+    hidl_vec<camera3_stream_buffer_t> outHalBufs;
+    outHalBufs.resize(numOutputBufs);
+    {
+        Mutex::Autolock _l(mInflightLock);
+        if (hasInputBuf) {
+            auto key = std::make_pair(request.inputBuffer.streamId, request.frameNumber);
+            auto& bufCache = mInflightBuffers[key] = camera3_stream_buffer_t{};
+            convertFromHidl(
+                    allBufPtrs[numOutputBufs], request.inputBuffer.status,
+                    &mStreamMap[request.inputBuffer.streamId], allFences[numOutputBufs],
+                    &bufCache);
+            halRequest.input_buffer = &bufCache;
+        } else {
+            halRequest.input_buffer = nullptr;
+        }
+
+        halRequest.num_output_buffers = numOutputBufs;
+        for (size_t i = 0; i < numOutputBufs; i++) {
+            auto key = std::make_pair(request.outputBuffers[i].streamId, request.frameNumber);
+            auto& bufCache = mInflightBuffers[key] = camera3_stream_buffer_t{};
+            convertFromHidl(
+                    allBufPtrs[i], request.outputBuffers[i].status,
+                    &mStreamMap[request.outputBuffers[i].streamId], allFences[i],
+                    &bufCache);
+            outHalBufs[i] = bufCache;
+        }
+        halRequest.output_buffers = outHalBufs.data();
+    }
+
+    ATRACE_ASYNC_BEGIN("frame capture", request.frameNumber);
+    ATRACE_BEGIN("camera3->process_capture_request");
+    status_t ret = mDevice->ops->process_capture_request(mDevice, &halRequest);
+    ATRACE_END();
+    if (ret != OK) {
+        Mutex::Autolock _l(mInflightLock);
+        ALOGE("%s: HAL process_capture_request call failed!", __FUNCTION__);
+
+        cleanupInflightFences(allFences, numBufs);
+        if (hasInputBuf) {
+            auto key = std::make_pair(request.inputBuffer.streamId, request.frameNumber);
+            mInflightBuffers.erase(key);
+        }
+        for (size_t i = 0; i < numOutputBufs; i++) {
+            auto key = std::make_pair(request.outputBuffers[i].streamId, request.frameNumber);
+            mInflightBuffers.erase(key);
+        }
+        return Status::INTERNAL_ERROR;
+    }
+
+    return Status::OK;
+}
+
+Return<Status> CameraDeviceSession::flush()  {
+    Status status = initStatus();
+    if (status == Status::OK) {
+        // Flush is always supported on device 3.1 or later
+        status_t ret = mDevice->ops->flush(mDevice);
+        if (ret != OK) {
+            status = Status::INTERNAL_ERROR;
+        }
+    }
+    return status;
+}
+
+Return<void> CameraDeviceSession::close()  {
+    Mutex::Autolock _l(mStateLock);
+    if (!mClosed) {
+        {
+            Mutex::Autolock _l(mInflightLock);
+            if (!mInflightBuffers.empty()) {
+                ALOGE("%s: trying to close while there are still %zu inflight buffers!",
+                        __FUNCTION__, mInflightBuffers.size());
+            }
+        }
+
+        ATRACE_BEGIN("camera3->close");
+        mDevice->common.close(&mDevice->common);
+        ATRACE_END();
+
+        // free all imported buffers
+        for(auto& pair : mCirculatingBuffers) {
+            CirculatingBuffers& buffers = pair.second;
+            for (auto& p2 : buffers) {
+                sHandleImporter.freeBuffer(p2.second);
+            }
+        }
+
+        mClosed = true;
+    }
+    return Void();
+}
+
+/**
+ * Static callback forwarding methods from HAL to instance
+ */
+void CameraDeviceSession::sProcessCaptureResult(
+        const camera3_callback_ops *cb,
+        const camera3_capture_result *hal_result) {
+    CameraDeviceSession *d =
+            const_cast<CameraDeviceSession*>(static_cast<const CameraDeviceSession*>(cb));
+
+    uint32_t frameNumber = hal_result->frame_number;
+    bool hasInputBuf = (hal_result->input_buffer != nullptr);
+    size_t numOutputBufs = hal_result->num_output_buffers;
+    size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
+    Status status = Status::OK;
+    {
+        Mutex::Autolock _l(d->mInflightLock);
+        if (hasInputBuf) {
+            int streamId = static_cast<Camera3Stream*>(hal_result->input_buffer->stream)->mId;
+            // validate if buffer is inflight
+            auto key = std::make_pair(streamId, frameNumber);
+            if (d->mInflightBuffers.count(key) != 1) {
+                ALOGE("%s: input buffer for stream %d frame %d is not inflight!",
+                        __FUNCTION__, streamId, frameNumber);
+                return;
+            }
+        }
+
+        for (size_t i = 0; i < numOutputBufs; i++) {
+            int streamId = static_cast<Camera3Stream*>(hal_result->output_buffers[i].stream)->mId;
+            // validate if buffer is inflight
+            auto key = std::make_pair(streamId, frameNumber);
+            if (d->mInflightBuffers.count(key) != 1) {
+                ALOGE("%s: output buffer for stream %d frame %d is not inflight!",
+                        __FUNCTION__, streamId, frameNumber);
+                return;
+            }
+        }
+    }
+    // We don't need to validate/import fences here since we will be passing them to camera service
+    // within the scope of this function
+
+    CaptureResult result;
+    hidl_vec<native_handle_t*> releaseFences;
+    releaseFences.resize(numBufs);
+    result.frameNumber = frameNumber;
+    result.partialResult = hal_result->partial_result;
+    convertToHidl(hal_result->result, &result.result);
+    if (hasInputBuf) {
+        result.inputBuffer.streamId =
+                static_cast<Camera3Stream*>(hal_result->input_buffer->stream)->mId;
+        result.inputBuffer.buffer = nullptr;
+        result.inputBuffer.status = (BufferStatus) hal_result->input_buffer->status;
+        // skip acquire fence since it's no use to camera service
+        if (hal_result->input_buffer->release_fence != -1) {
+            releaseFences[numOutputBufs] = native_handle_create(/*numFds*/1, /*numInts*/0);
+            releaseFences[numOutputBufs]->data[0] = hal_result->input_buffer->release_fence;
+            result.inputBuffer.releaseFence = releaseFences[numOutputBufs];
+        } else {
+            releaseFences[numOutputBufs] = nullptr;
+        }
+    } else {
+        result.inputBuffer.streamId = -1;
+    }
+
+    result.outputBuffers.resize(numOutputBufs);
+    for (size_t i = 0; i < numOutputBufs; i++) {
+        result.outputBuffers[i].streamId =
+                static_cast<Camera3Stream*>(hal_result->output_buffers[i].stream)->mId;
+        result.outputBuffers[i].buffer = nullptr;
+        result.outputBuffers[i].status = (BufferStatus) hal_result->output_buffers[i].status;
+        // skip acquire fence since it's of no use to camera service
+        if (hal_result->output_buffers[i].release_fence != -1) {
+            releaseFences[i] = native_handle_create(/*numFds*/1, /*numInts*/0);
+            releaseFences[i]->data[0] = hal_result->output_buffers[i].release_fence;
+            result.outputBuffers[i].releaseFence = releaseFences[i];
+        } else {
+            releaseFences[i] = nullptr;
+        }
+    }
+
+    // Free inflight record/fences.
+    // Do this before call back to camera service because camera service might jump to
+    // configure_streams right after the processCaptureResult call so we need to finish
+    // updating inflight queues first
+    {
+        Mutex::Autolock _l(d->mInflightLock);
+        if (hasInputBuf) {
+            int streamId = static_cast<Camera3Stream*>(hal_result->input_buffer->stream)->mId;
+            auto key = std::make_pair(streamId, frameNumber);
+            // TODO (b/34169301): currently HAL closed the fence
+            //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+            d->mInflightBuffers.erase(key);
+        }
+
+        for (size_t i = 0; i < numOutputBufs; i++) {
+            int streamId = static_cast<Camera3Stream*>(hal_result->output_buffers[i].stream)->mId;
+            auto key = std::make_pair(streamId, frameNumber);
+            // TODO (b/34169301): currently HAL closed the fence
+            //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+            d->mInflightBuffers.erase(key);
+        }
+
+        if (d->mInflightBuffers.empty()) {
+            ALOGV("%s: inflight buffer queue is now empty!", __FUNCTION__);
+        }
+    }
+
+    d->mCallback->processCaptureResult(result);
+
+    for (size_t i = 0; i < releaseFences.size(); i++) {
+        // We don't close the FD here as HAL needs to signal it later.
+        native_handle_delete(releaseFences[i]);
+    }
+}
+
+void CameraDeviceSession::sNotify(
+        const camera3_callback_ops *cb,
+        const camera3_notify_msg *msg) {
+    CameraDeviceSession *d =
+            const_cast<CameraDeviceSession*>(static_cast<const CameraDeviceSession*>(cb));
+    NotifyMsg hidlMsg;
+    convertToHidl(msg, &hidlMsg);
+    if (hidlMsg.type == (MsgType) CAMERA3_MSG_ERROR &&
+            hidlMsg.msg.error.errorStreamId != -1) {
+        if (d->mStreamMap.count(hidlMsg.msg.error.errorStreamId) != 1) {
+            ALOGE("%s: unknown stream ID %d reports an error!",
+                    __FUNCTION__, hidlMsg.msg.error.errorStreamId);
+        }
+        return;
+    }
+    d->mCallback->notify(hidlMsg);
+}
+
+} // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
diff --git a/camera/device/3.2/default/CameraDeviceSession.h b/camera/device/3.2/default/CameraDeviceSession.h
new file mode 100644
index 0000000..ca9d24d
--- /dev/null
+++ b/camera/device/3.2/default/CameraDeviceSession.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE3SESSION_H
+#define ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE3SESSION_H
+
+#include <unordered_map>
+#include "hardware/camera_common.h"
+#include "hardware/camera3.h"
+#include "utils/Mutex.h"
+#include <android/hardware/camera/device/3.2/ICameraDevice.h>
+#include <android/hardware/camera/device/3.2/ICameraDeviceSession.h>
+#include <hidl/Status.h>
+#include <hidl/MQDescriptor.h>
+#include <include/convert.h>
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+using ::android::hardware::camera::device::V3_2::CaptureRequest;
+using ::android::hardware::camera::device::V3_2::HalStreamConfiguration;
+using ::android::hardware::camera::device::V3_2::StreamConfiguration;
+using ::android::hardware::camera::device::V3_2::ICameraDeviceSession;
+using ::android::hardware::camera::common::V1_0::Status;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+using ::android::Mutex;
+
+/**
+ * Function pointer types with C calling convention to
+ * use for HAL callback functions.
+ */
+extern "C" {
+    typedef void (callbacks_process_capture_result_t)(
+        const struct camera3_callback_ops *,
+        const camera3_capture_result_t *);
+
+    typedef void (callbacks_notify_t)(
+        const struct camera3_callback_ops *,
+        const camera3_notify_msg_t *);
+}
+
+struct CameraDeviceSession : public ICameraDeviceSession, private camera3_callback_ops  {
+
+    CameraDeviceSession(camera3_device_t*, const sp<ICameraDeviceCallback>&);
+    ~CameraDeviceSession();
+    // Call by CameraDevice to dump active device states
+    void dumpState(const native_handle_t* fd);
+    // Caller must use this method to check if CameraDeviceSession ctor failed
+    bool isInitFailed() { return mInitFail; }
+    // Used by CameraDevice to signal external camera disconnected
+    void disconnect();
+    bool isClosed();
+
+    // Methods from ::android::hardware::camera::device::V3_2::ICameraDeviceSession follow.
+    Return<void> constructDefaultRequestSettings(RequestTemplate type, constructDefaultRequestSettings_cb _hidl_cb) override;
+    Return<void> configureStreams(const StreamConfiguration& requestedConfiguration, configureStreams_cb _hidl_cb) override;
+    Return<Status> processCaptureRequest(const CaptureRequest& request) override;
+    Return<Status> flush() override;
+    Return<void> close() override;
+
+private:
+    // protecting mClosed/mDisconnected/mInitFail
+    mutable Mutex mStateLock;
+    // device is closed either
+    //    - closed by user
+    //    - init failed
+    //    - camera disconnected
+    bool mClosed = false;
+
+    // Set by CameraDevice (when external camera is disconnected)
+    bool mDisconnected = false;
+
+    camera3_device_t* mDevice;
+    const sp<ICameraDeviceCallback> mCallback;
+    // Stream ID -> Camera3Stream cache
+    std::map<int, Camera3Stream> mStreamMap;
+
+    mutable Mutex mInflightLock; // protecting mInflightBuffers and mCirculatingBuffers
+    // (streamID, frameNumber) -> inflight buffer cache
+    std::map<std::pair<int, uint32_t>, camera3_stream_buffer_t>  mInflightBuffers;
+
+    // buffers currently ciculating between HAL and camera service
+    // key: bufferId sent via HIDL interface
+    // value: imported buffer_handle_t
+    // Buffer will be imported during process_capture_request and will be freed
+    // when the its stream is deleted or camera device session is closed
+    typedef std::unordered_map<uint64_t, buffer_handle_t> CirculatingBuffers;
+    // Stream ID -> circulating buffers map
+    std::map<int, CirculatingBuffers> mCirculatingBuffers;
+
+    bool mInitFail;
+    bool initialize();
+
+    Status initStatus() const;
+
+    // Validate and import request's input buffer and acquire fence
+    Status importRequest(
+            const CaptureRequest& request,
+            hidl_vec<buffer_handle_t*>& allBufPtrs,
+            hidl_vec<int>& allFences);
+
+    static void cleanupInflightFences(
+            hidl_vec<int>& allFences, size_t numFences);
+
+    /**
+     * Static callback forwarding methods from HAL to instance
+     */
+    static callbacks_process_capture_result_t sProcessCaptureResult;
+    static callbacks_notify_t sNotify;
+};
+
+}  // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_CAMERA_DEVICE_V3_2_CAMERADEVICE3SESSION_H
diff --git a/camera/device/3.2/default/convert.cpp b/camera/device/3.2/default/convert.cpp
new file mode 100644
index 0000000..35676df
--- /dev/null
+++ b/camera/device/3.2/default/convert.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.camera.device@3.2-convert-impl"
+#include <android/log.h>
+
+#include "include/convert.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+using ::android::hardware::graphics::common::V1_0::Dataspace;
+using ::android::hardware::graphics::common::V1_0::PixelFormat;
+using ::android::hardware::camera::device::V3_2::ConsumerUsageFlags;
+using ::android::hardware::camera::device::V3_2::ProducerUsageFlags;
+
+bool convertFromHidl(const CameraMetadata &src, const camera_metadata_t** dst) {
+    if (src.size() == 0) {
+        // Special case for null metadata
+        *dst = nullptr;
+        return true;
+    }
+
+    const uint8_t* data = src.data();
+    // sanity check the size of CameraMetadata match underlying camera_metadata_t
+    if (get_camera_metadata_size((camera_metadata_t*)data) != src.size()) {
+        ALOGE("%s: input CameraMetadata is corrupt!", __FUNCTION__);
+        return false;
+    }
+    *dst = (camera_metadata_t*) data;
+    return true;
+}
+
+// Note: existing data in dst will be gone. Caller still owns the memory of src
+void convertToHidl(const camera_metadata_t *src, CameraMetadata* dst) {
+    if (src == nullptr) {
+        return;
+    }
+    size_t size = get_camera_metadata_size(src);
+    dst->setToExternal((uint8_t *) src, size);
+    return;
+}
+
+void convertFromHidl(const Stream &src, Camera3Stream* dst) {
+    dst->mId = src.id;
+    dst->stream_type = (int) src.streamType;
+    dst->width = src.width;
+    dst->height = src.height;
+    dst->format = (int) src.format;
+    dst->data_space = (android_dataspace_t) src.dataSpace;
+    dst->rotation = (int) src.rotation;
+    dst->usage = (uint32_t) src.usage;
+    // Fields to be filled by HAL (max_buffers, priv) are initialized to 0
+    dst->max_buffers = 0;
+    dst->priv = 0;
+    return;
+}
+
+void convertToHidl(const Camera3Stream* src, HalStream* dst) {
+    dst->id = src->mId;
+    dst->overrideFormat = (PixelFormat) src->format;
+    dst->maxBuffers = src->max_buffers;
+    if (src->stream_type == CAMERA3_STREAM_OUTPUT) {
+        dst->consumerUsage = (ConsumerUsageFlags) 0;
+        dst->producerUsage = (ProducerUsageFlags) src->usage;
+    } else if (src->stream_type == CAMERA3_STREAM_INPUT) {
+        dst->producerUsage = (ProducerUsageFlags) 0;
+        dst->consumerUsage = (ConsumerUsageFlags) src->usage;
+    } else {
+        //Should not reach here per current HIDL spec, but we might end up adding
+        // bi-directional stream to HIDL.
+        ALOGW("%s: Stream type %d is not currently supported!",
+                __FUNCTION__, src->stream_type);
+    }
+}
+
+void convertToHidl(const camera3_stream_configuration_t& src, HalStreamConfiguration* dst) {
+    dst->streams.resize(src.num_streams);
+    for (uint32_t i = 0; i < src.num_streams; i++) {
+        convertToHidl(static_cast<Camera3Stream*>(src.streams[i]), &dst->streams[i]);
+    }
+    return;
+}
+
+void convertFromHidl(
+        buffer_handle_t* bufPtr, BufferStatus status, camera3_stream_t* stream, int acquireFence,
+        camera3_stream_buffer_t* dst) {
+    dst->stream = stream;
+    dst->buffer = bufPtr;
+    dst->status = (int) status;
+    dst->acquire_fence = acquireFence;
+    dst->release_fence = -1; // meant for HAL to fill in
+}
+
+void convertToHidl(const camera3_notify_msg* src, NotifyMsg* dst) {
+    dst->type = (MsgType) src->type;
+    switch (src->type) {
+        case CAMERA3_MSG_ERROR:
+            {
+                // The camera3_stream_t* must be the same as what wrapper HAL passed to conventional
+                // HAL, or the ID lookup will return garbage. Caller should validate the ID here is
+                // indeed one of active stream IDs
+                Camera3Stream* stream = static_cast<Camera3Stream*>(
+                        src->message.error.error_stream);
+                dst->msg.error.frameNumber = src->message.error.frame_number;
+                dst->msg.error.errorStreamId = (stream != nullptr) ? stream->mId : -1;
+                dst->msg.error.errorCode = (ErrorCode) src->message.error.error_code;
+            }
+            break;
+        case CAMERA3_MSG_SHUTTER:
+            dst->msg.shutter.frameNumber = src->message.shutter.frame_number;
+            dst->msg.shutter.timestamp = src->message.shutter.timestamp;
+            break;
+        default:
+            ALOGE("%s: HIDL type converion failed. Unknown msg type 0x%x",
+                    __FUNCTION__, src->type);
+    }
+    return;
+}
+
+}  // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
diff --git a/camera/device/3.2/default/include/convert.h b/camera/device/3.2/default/include/convert.h
new file mode 100644
index 0000000..96891f0
--- /dev/null
+++ b/camera/device/3.2/default/include/convert.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HARDWARE_INTERFACES_CAMERA_DEVICE_V3_2_DEFAULT_INCLUDE_CONVERT_H_
+
+#define HARDWARE_INTERFACES_CAMERA_DEVICE_V3_2_DEFAULT_INCLUDE_CONVERT_H_
+
+#include <set>
+
+
+#include <android/hardware/graphics/common/1.0/types.h>
+#include <android/hardware/camera/device/3.2/types.h>
+#include "hardware/camera3.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace device {
+namespace V3_2 {
+namespace implementation {
+
+// The camera3_stream_t sent to conventional HAL. Added mId fields to enable stream ID lookup
+// fromt a downcasted camera3_stream
+struct Camera3Stream : public camera3_stream {
+    int mId;
+};
+
+// *dst will point to the data owned by src, but src still owns the data after this call returns.
+bool convertFromHidl(const CameraMetadata &src, const camera_metadata_t** dst);
+void convertToHidl(const camera_metadata_t* src, CameraMetadata* dst);
+
+void convertFromHidl(const Stream &src, Camera3Stream* dst);
+void convertToHidl(const Camera3Stream* src, HalStream* dst);
+
+void convertFromHidl(
+        buffer_handle_t*, BufferStatus, camera3_stream_t*, int acquireFence, // inputs
+        camera3_stream_buffer_t* dst);
+
+void convertToHidl(const camera3_stream_configuration_t& src, HalStreamConfiguration* dst);
+
+// The camera3_stream_t* in src must be the same as what wrapper HAL passed to conventional
+// HAL, or the ID lookup will return garbage. Caller should validate the ID in ErrorMsg is
+// indeed one of active stream IDs
+void convertToHidl(const camera3_notify_msg* src, NotifyMsg* dst);
+
+}  // namespace implementation
+}  // namespace V3_2
+}  // namespace device
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HARDWARE_INTERFACES_CAMERA_DEVICE_V3_2_DEFAULT_INCLUDE_CONVERT_H_
diff --git a/camera/device/3.2/types.hal b/camera/device/3.2/types.hal
index a7ab4ab..c07a670 100644
--- a/camera/device/3.2/types.hal
+++ b/camera/device/3.2/types.hal
@@ -403,16 +403,35 @@
  */
 struct StreamBuffer {
     /**
-     * The ID of the stream this buffer is associated with
+     * The ID of the stream this buffer is associated with. -1 indicates an
+     * invalid (empty) StreamBuffer, in which case buffer must also point to
+     * null and bufferId must be 0.
      */
     int32_t streamId;
 
     /**
+     * The unique ID of the buffer within this StreamBuffer. 0 indicates this
+     * StreamBuffer contains no buffer.
+     * For StreamBuffers sent to the HAL in a CaptureRequest, this ID uniquely
+     * identifies a buffer. When a buffer is sent to HAL for the first time,
+     * both bufferId and buffer handle must be filled. HAL must keep track of
+     * the mapping between bufferId and corresponding buffer until the
+     * corresponding stream is removed from stream configuration or until camera
+     * device session is closed. After the first time a buffer is introduced to
+     * HAL, in the future camera service must refer to the same buffer using
+     * only bufferId, and keep the buffer handle null.
+     */
+    uint64_t bufferId;
+
+    /**
      * The graphics buffer handle to the buffer.
      *
-     * For StreamBuffers sent to the HAL in a CaptureRequest, this must be a
+     * For StreamBuffers sent to the HAL in a CaptureRequest, if the bufferId
+     * is not seen by the HAL before, this buffer handle is guaranteed to be a
      * valid handle to a graphics buffer, with dimensions and format matching
-     * that of the stream.
+     * that of the stream. If the bufferId has been sent to the HAL before, this
+     * buffer handle must be null and HAL must look up the actual buffer handle
+     * to use from its own bufferId to buffer handle map.
      *
      * For StreamBuffers returned in a CaptureResult, this must be null, since
      * the handle to the buffer is already known to the client (since the client
@@ -605,7 +624,7 @@
 };
 
 /**
- * MotifyMsg:
+ * NotifyMsg:
  *
  * The message structure sent to ICameraDevice3Callback::notify()
  */
diff --git a/camera/provider/2.4/Android.bp b/camera/provider/2.4/Android.bp
index ce22cb0..f5f10de 100644
--- a/camera/provider/2.4/Android.bp
+++ b/camera/provider/2.4/Android.bp
@@ -25,13 +25,13 @@
     out: [
         "android/hardware/camera/provider/2.4/ICameraProvider.h",
         "android/hardware/camera/provider/2.4/IHwCameraProvider.h",
-        "android/hardware/camera/provider/2.4/BnCameraProvider.h",
-        "android/hardware/camera/provider/2.4/BpCameraProvider.h",
+        "android/hardware/camera/provider/2.4/BnHwCameraProvider.h",
+        "android/hardware/camera/provider/2.4/BpHwCameraProvider.h",
         "android/hardware/camera/provider/2.4/BsCameraProvider.h",
         "android/hardware/camera/provider/2.4/ICameraProviderCallback.h",
         "android/hardware/camera/provider/2.4/IHwCameraProviderCallback.h",
-        "android/hardware/camera/provider/2.4/BnCameraProviderCallback.h",
-        "android/hardware/camera/provider/2.4/BpCameraProviderCallback.h",
+        "android/hardware/camera/provider/2.4/BnHwCameraProviderCallback.h",
+        "android/hardware/camera/provider/2.4/BpHwCameraProviderCallback.h",
         "android/hardware/camera/provider/2.4/BsCameraProviderCallback.h",
     ],
 }
diff --git a/camera/provider/2.4/ICameraProvider.hal b/camera/provider/2.4/ICameraProvider.hal
index 564167b..3015b7d 100644
--- a/camera/provider/2.4/ICameraProvider.hal
+++ b/camera/provider/2.4/ICameraProvider.hal
@@ -120,6 +120,30 @@
             generates (Status status, vec<string> cameraDeviceNames);
 
     /**
+     * isSetTorchModeSupported:
+     *
+     * Returns if the camera devices known to this camera provider support
+     * setTorchMode API or not. If the provider does not support setTorchMode
+     * API, calling to setTorchMode will return METHOD_NOT_SUPPORTED.
+     *
+     * Note that not every camera device has a flash unit, so even this API
+     * returns true, setTorchMode call might still fail due to the camera device
+     * does not have a flash unit. In such case, the returned status will be
+     * OPERATION_NOT_SUPPORTED.
+     *
+     * @return status Status code for the operation, one of:
+     *     OK:
+     *         On a succesful call
+     *     INTERNAL_ERROR:
+     *         Torch API support cannot be queried. This may be due to
+     *         a failure to initialize the camera subsystem, for example.
+     * @return support Whether the camera devices known to this provider
+     *     supports setTorchMode API or not.
+     *
+     */
+    isSetTorchModeSupported() generates (Status status, bool support);
+
+    /**
      * getCameraDeviceInterface_VN_x:
      *
      * Return a android.hardware.camera.device@N.x/ICameraDevice interface for
diff --git a/camera/provider/2.4/default/Android.bp b/camera/provider/2.4/default/Android.bp
new file mode 100644
index 0000000..f28c9cd
--- /dev/null
+++ b/camera/provider/2.4/default/Android.bp
@@ -0,0 +1,23 @@
+cc_library_shared {
+    name: "android.hardware.camera.provider@2.4-impl",
+    relative_install_path: "hw",
+    srcs: ["CameraProvider.cpp"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+        "android.hardware.camera.device@1.0",
+        "android.hardware.camera.device@3.2",
+        "android.hardware.camera.device@3.2-impl",
+        "android.hardware.camera.provider@2.4",
+        "android.hardware.camera.common@1.0",
+        "liblog",
+        "libhardware",
+        "libcamera_metadata"
+    ],
+    static_libs: [
+        "android.hardware.camera.common@1.0-helper"
+    ]
+}
diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp
new file mode 100644
index 0000000..9617d8d
--- /dev/null
+++ b/camera/provider/2.4/default/CameraProvider.cpp
@@ -0,0 +1,411 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CamProvider@2.4-impl"
+#include <android/log.h>
+
+#include <regex>
+
+#include "CameraProvider.h"
+#include "CameraDevice.h"
+#include <string.h>
+#include <utils/Trace.h>
+
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace provider {
+namespace V2_4 {
+namespace implementation {
+
+namespace {
+const char *kLegacyProviderName = "legacy/0";
+// "device@<version>/legacy/<id>"
+const std::regex kDeviceNameRE("device@([0-9]+\\.[0-9]+)/legacy/(.+)");
+const char *kHAL3_2 = "3.2";
+const char *kHAL1_0 = "1.0";
+const int kMaxCameraDeviceNameLen = 128;
+const int kMaxCameraIdLen = 16;
+
+} // anonymous namespace
+
+using ::android::hardware::camera::common::V1_0::CameraMetadataType;
+using ::android::hardware::camera::common::V1_0::Status;
+
+/**
+ * static callback forwarding methods from HAL to instance
+ */
+void CameraProvider::sCameraDeviceStatusChange(
+        const struct camera_module_callbacks* callbacks,
+        int camera_id,
+        int new_status) {
+    ALOGI("%s++", __FUNCTION__);
+    sp<CameraProvider> cp = const_cast<CameraProvider*>(
+            static_cast<const CameraProvider*>(callbacks));
+
+    if (cp == nullptr) {
+        ALOGE("%s: callback ops is null", __FUNCTION__);
+        return;
+    }
+
+    ALOGI("%s resolved provider %p", __FUNCTION__, cp.get());
+
+    Mutex::Autolock _l(cp->mCbLock);
+    char cameraId[kMaxCameraIdLen];
+    snprintf(cameraId, sizeof(cameraId), "%d", camera_id);
+    std::string cameraIdStr(cameraId);
+    cp->mCameraStatusMap[cameraIdStr] = (camera_device_status_t) new_status;
+    if (cp->mCallbacks != nullptr) {
+        CameraDeviceStatus status = (CameraDeviceStatus) new_status;
+        for (auto const& deviceNamePair : cp->mCameraDeviceNames) {
+            if (cameraIdStr.compare(deviceNamePair.first) == 0) {
+                cp->mCallbacks->cameraDeviceStatusChange(
+                        deviceNamePair.second, status);
+            }
+        }
+    }
+    ALOGI("%s--", __FUNCTION__);
+}
+
+void CameraProvider::sTorchModeStatusChange(
+        const struct camera_module_callbacks* callbacks,
+        const char* camera_id,
+        int new_status) {
+    ALOGI("%s++", __FUNCTION__);
+    sp<CameraProvider> cp = const_cast<CameraProvider*>(
+            static_cast<const CameraProvider*>(callbacks));
+
+    if (cp == nullptr) {
+        ALOGE("%s: callback ops is null", __FUNCTION__);
+        return;
+    }
+
+    ALOGI("%s resolved provider %p", __FUNCTION__, cp.get());
+
+    Mutex::Autolock _l(cp->mCbLock);
+    if (cp->mCallbacks != nullptr) {
+        std::string cameraIdStr(camera_id);
+        TorchModeStatus status = (TorchModeStatus) new_status;
+        for (auto const& deviceNamePair : cp->mCameraDeviceNames) {
+            if (cameraIdStr.compare(deviceNamePair.first) == 0) {
+                cp->mCallbacks->torchModeStatusChange(
+                        deviceNamePair.second, status);
+            }
+        }
+    }
+    ALOGI("%s--", __FUNCTION__);
+}
+
+Status CameraProvider::getHidlStatus(int status) {
+    switch (status) {
+        case 0: return Status::OK;
+        case -ENODEV: return Status::INTERNAL_ERROR;
+        case -EINVAL: return Status::ILLEGAL_ARGUMENT;
+        default:
+            ALOGE("%s: unknown HAL status code %d", __FUNCTION__, status);
+            return Status::INTERNAL_ERROR;
+    }
+}
+
+bool CameraProvider::matchDeviceName(const hidl_string& deviceName, std::smatch& sm) {
+    std::string deviceNameStd(deviceName.c_str());
+    return std::regex_match(deviceNameStd, sm, kDeviceNameRE);
+}
+
+std::string CameraProvider::getLegacyCameraId(const hidl_string& deviceName) {
+    std::smatch sm;
+    bool match = matchDeviceName(deviceName, sm);
+    if (!match) {
+        return std::string("");
+    }
+    return sm[2];
+}
+
+int CameraProvider::getCameraDeviceVersion(const hidl_string& deviceName) {
+    std::smatch sm;
+    bool match = matchDeviceName(deviceName, sm);
+    if (!match) {
+        return -1;
+    }
+    if (sm[1].compare(kHAL3_2) == 0) {
+        // maybe switched to 3.4 or define the hidl version enum later
+        return CAMERA_DEVICE_API_VERSION_3_2;
+    } else if (sm[1].compare(kHAL1_0) == 0) {
+        return CAMERA_DEVICE_API_VERSION_1_0;
+    }
+    return 0;
+}
+
+std::string CameraProvider::getHidlDeviceName(
+        std::string cameraId, int deviceVersion) {
+    // Maybe consider create a version check method and SortedVec to speed up?
+    if (deviceVersion != CAMERA_DEVICE_API_VERSION_1_0 &&
+            deviceVersion != CAMERA_DEVICE_API_VERSION_3_2 &&
+            deviceVersion != CAMERA_DEVICE_API_VERSION_3_3 &&
+            deviceVersion != CAMERA_DEVICE_API_VERSION_3_4 ) {
+        return hidl_string("");
+    }
+    const char* versionStr = (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) ? kHAL1_0 : kHAL3_2;
+    char deviceName[kMaxCameraDeviceNameLen];
+    snprintf(deviceName, sizeof(deviceName), "device@%s/legacy/%s",
+            versionStr, cameraId.c_str());
+    return deviceName;
+}
+
+CameraProvider::CameraProvider() :
+        camera_module_callbacks_t({sCameraDeviceStatusChange,
+                                   sTorchModeStatusChange}) {
+    mInitFailed = initialize();
+}
+
+CameraProvider::~CameraProvider() {}
+
+bool CameraProvider::initialize() {
+    camera_module_t *rawModule;
+    int err = hw_get_module(CAMERA_HARDWARE_MODULE_ID,
+            (const hw_module_t **)&rawModule);
+    if (err < 0) {
+        ALOGE("Could not load camera HAL module: %d (%s)", err, strerror(-err));
+        return true;
+    }
+
+    mModule = new CameraModule(rawModule);
+    err = mModule->init();
+    if (err != OK) {
+        ALOGE("Could not initialize camera HAL module: %d (%s)", err,
+            strerror(-err));
+        mModule.clear();
+        return true;
+    }
+    ALOGI("Loaded \"%s\" camera module", mModule->getModuleName());
+
+    mNumberOfLegacyCameras = mModule->getNumberOfCameras();
+    for (int i = 0; i < mNumberOfLegacyCameras; i++) {
+        char cameraId[kMaxCameraIdLen];
+        snprintf(cameraId, sizeof(cameraId), "%d", i);
+        std::string cameraIdStr(cameraId);
+        mCameraStatusMap[cameraIdStr] = CAMERA_DEVICE_STATUS_PRESENT;
+        mCameraIds.add(cameraIdStr);
+
+        // initialize mCameraDeviceNames and mOpenLegacySupported
+        mOpenLegacySupported[cameraIdStr] = false;
+        int deviceVersion = mModule->getDeviceVersion(i);
+        mCameraDeviceNames.add(
+                std::make_pair(cameraIdStr,
+                               getHidlDeviceName(cameraIdStr, deviceVersion)));
+        if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_2 &&
+                mModule->isOpenLegacyDefined()) {
+            // try open_legacy to see if it actually works
+            struct hw_device_t* halDev = nullptr;
+            int ret = mModule->openLegacy(cameraId, CAMERA_DEVICE_API_VERSION_1_0, &halDev);
+            if (ret == 0) {
+                mOpenLegacySupported[cameraIdStr] = true;
+                halDev->close(halDev);
+                mCameraDeviceNames.add(
+                        std::make_pair(cameraIdStr,
+                                getHidlDeviceName(cameraIdStr, CAMERA_DEVICE_API_VERSION_1_0)));
+            } else if (ret == -EBUSY || ret == -EUSERS) {
+                // Looks like this provider instance is not initialized during
+                // system startup and there are other camera users already.
+                // Not a good sign but not fatal.
+                ALOGW("%s: open_legacy try failed!", __FUNCTION__);
+            }
+        }
+    }
+
+    // Setup vendor tags here so HAL can setup vendor keys in camera characteristics
+    VendorTagDescriptor::clearGlobalVendorTagDescriptor();
+    bool setupSucceed = setUpVendorTags();
+    return !setupSucceed; // return flag here is mInitFailed
+}
+
+bool CameraProvider::setUpVendorTags() {
+    ATRACE_CALL();
+    vendor_tag_ops_t vOps = vendor_tag_ops_t();
+
+    // Check if vendor operations have been implemented
+    if (!mModule->isVendorTagDefined()) {
+        ALOGI("%s: No vendor tags defined for this device.", __FUNCTION__);
+        return false;
+    }
+
+    mModule->getVendorTagOps(&vOps);
+
+    // Ensure all vendor operations are present
+    if (vOps.get_tag_count == nullptr || vOps.get_all_tags == nullptr ||
+            vOps.get_section_name == nullptr || vOps.get_tag_name == nullptr ||
+            vOps.get_tag_type == nullptr) {
+        ALOGE("%s: Vendor tag operations not fully defined. Ignoring definitions."
+               , __FUNCTION__);
+        return false;
+    }
+
+    // Read all vendor tag definitions into a descriptor
+    sp<VendorTagDescriptor> desc;
+    status_t res;
+    if ((res = VendorTagDescriptor::createDescriptorFromOps(&vOps, /*out*/desc))
+            != OK) {
+        ALOGE("%s: Could not generate descriptor from vendor tag operations,"
+              "received error %s (%d). Camera clients will not be able to use"
+              "vendor tags", __FUNCTION__, strerror(res), res);
+        return false;
+    }
+
+    // Set the global descriptor to use with camera metadata
+    VendorTagDescriptor::setAsGlobalVendorTagDescriptor(desc);
+    const SortedVector<String8>* sectionNames = desc->getAllSectionNames();
+    size_t numSections = sectionNames->size();
+    std::vector<std::vector<VendorTag>> tagsBySection(numSections);
+    int tagCount = desc->getTagCount();
+    std::vector<uint32_t> tags(tagCount);
+    desc->getTagArray(tags.data());
+    for (int i = 0; i < tagCount; i++) {
+        VendorTag vt;
+        vt.tagId = tags[i];
+        vt.tagName = desc->getTagName(tags[i]);
+        vt.tagType = (CameraMetadataType) desc->getTagType(tags[i]);
+        ssize_t sectionIdx = desc->getSectionIndex(tags[i]);
+        tagsBySection[sectionIdx].push_back(vt);
+    }
+    mVendorTagSections.resize(numSections);
+    for (size_t s = 0; s < numSections; s++) {
+        mVendorTagSections[s].sectionName = (*sectionNames)[s].string();
+        mVendorTagSections[s].tags = tagsBySection[s];
+    }
+    return true;
+}
+
+// Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
+Return<Status> CameraProvider::setCallback(const sp<ICameraProviderCallback>& callback)  {
+    {
+        Mutex::Autolock _l(mCbLock);
+        mCallbacks = callback;
+    } // release lock here because HAL might send callbacks in setCallbacks call
+    return getHidlStatus(mModule->setCallbacks(this));
+}
+
+Return<void> CameraProvider::getVendorTags(getVendorTags_cb _hidl_cb)  {
+    _hidl_cb(Status::OK, mVendorTagSections);
+    return Void();
+}
+
+Return<void> CameraProvider::getCameraIdList(getCameraIdList_cb _hidl_cb)  {
+    std::vector<hidl_string> deviceNameList;
+    for (auto const& deviceNamePair : mCameraDeviceNames) {
+        if (mCameraStatusMap[deviceNamePair.first] == CAMERA_DEVICE_STATUS_PRESENT) {
+            deviceNameList.push_back(deviceNamePair.second);
+        }
+    }
+    hidl_vec<hidl_string> hidlDeviceNameList(deviceNameList);
+    _hidl_cb(Status::OK, hidlDeviceNameList);
+    return Void();
+}
+
+Return<void> CameraProvider::isSetTorchModeSupported(isSetTorchModeSupported_cb _hidl_cb) {
+    bool support = mModule->isSetTorchModeSupported();
+    _hidl_cb (Status::OK, support);
+    return Void();
+}
+
+Return<void> CameraProvider::getCameraDeviceInterface_V1_x(
+        const hidl_string& /*cameraDeviceName*/, getCameraDeviceInterface_V1_x_cb /*_hidl_cb*/)  {
+    // TODO implement after device 1.0 is implemented
+    return Void();
+}
+
+Return<void> CameraProvider::getCameraDeviceInterface_V3_x(
+        const hidl_string& cameraDeviceName, getCameraDeviceInterface_V3_x_cb _hidl_cb)  {
+    std::smatch sm;
+    bool match = matchDeviceName(cameraDeviceName, sm);
+    if (!match) {
+        _hidl_cb(Status::ILLEGAL_ARGUMENT, nullptr);
+        return Void();
+    }
+
+    std::string cameraId = sm[2];
+    std::string deviceVersion = sm[1];
+    std::string deviceName(cameraDeviceName.c_str());
+    ssize_t index = mCameraDeviceNames.indexOf(std::make_pair(cameraId, deviceName));
+    if (index == NAME_NOT_FOUND) { // Either an illegal name or a device version mismatch
+        Status status = Status::OK;
+        ssize_t idx = mCameraIds.indexOf(cameraId);
+        if (idx == NAME_NOT_FOUND) {
+            ALOGE("%s: cannot find camera %s!", __FUNCTION__, cameraId.c_str());
+            status = Status::ILLEGAL_ARGUMENT;
+        } else { // invalid version
+            ALOGE("%s: camera device %s does not support version %s!",
+                    __FUNCTION__, cameraId.c_str(), deviceVersion.c_str());
+            status = Status::OPERATION_NOT_SUPPORTED;
+        }
+        _hidl_cb(status, nullptr);
+        return Void();
+    }
+
+    if (mCameraStatusMap.count(cameraId) == 0 ||
+            mCameraStatusMap[cameraId] != CAMERA_DEVICE_STATUS_PRESENT) {
+        _hidl_cb(Status::ILLEGAL_ARGUMENT, nullptr);
+        return Void();
+    }
+
+    // TODO: we also need to keep a wp list of all generated devices to notify
+    //       devices of device present status change, but then each device might
+    //       need a sp<provider> to keep provider alive until all device closed?
+    //       Problem: do we have external camera products to test this?
+    sp<android::hardware::camera::device::V3_2::implementation::CameraDevice> device =
+            new android::hardware::camera::device::V3_2::implementation::CameraDevice(
+                    mModule, cameraId, mCameraDeviceNames);
+
+    if (device == nullptr) {
+        ALOGE("%s: cannot allocate camera device for id %s", __FUNCTION__, cameraId.c_str());
+        _hidl_cb(Status::INTERNAL_ERROR, nullptr);
+        return Void();
+    }
+
+    if (device->isInitFailed()) {
+        ALOGE("%s: camera device %s init failed!", __FUNCTION__, cameraId.c_str());
+        device = nullptr;
+        _hidl_cb(Status::INTERNAL_ERROR, nullptr);
+        return Void();
+    }
+
+    _hidl_cb (Status::OK, device);
+    return Void();
+}
+
+ICameraProvider* HIDL_FETCH_ICameraProvider(const char* name) {
+    if (strcmp(name, kLegacyProviderName) != 0) {
+        return nullptr;
+    }
+    CameraProvider* provider = new CameraProvider();
+    if (provider == nullptr) {
+        ALOGE("%s: cannot allocate camera provider!", __FUNCTION__);
+        return nullptr;
+    }
+    if (provider->isInitFailed()) {
+        ALOGE("%s: camera provider init failed!", __FUNCTION__);
+        delete provider;
+        return nullptr;
+    }
+    return provider;
+}
+
+} // namespace implementation
+}  // namespace V2_4
+}  // namespace provider
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
diff --git a/camera/provider/2.4/default/CameraProvider.h b/camera/provider/2.4/default/CameraProvider.h
new file mode 100644
index 0000000..8497ff3
--- /dev/null
+++ b/camera/provider/2.4/default/CameraProvider.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
+#define ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
+
+#include "hardware/camera_common.h"
+#include "utils/Mutex.h"
+#include "utils/SortedVector.h"
+#include <android/hardware/camera/provider/2.4/ICameraProvider.h>
+#include <hidl/Status.h>
+#include <hidl/MQDescriptor.h>
+#include "CameraModule.h"
+#include "VendorTagDescriptor.h"
+
+namespace android {
+namespace hardware {
+namespace camera {
+namespace provider {
+namespace V2_4 {
+namespace implementation {
+
+using ::android::hardware::camera::common::V1_0::CameraDeviceStatus;
+using ::android::hardware::camera::common::V1_0::Status;
+using ::android::hardware::camera::common::V1_0::TorchModeStatus;
+using ::android::hardware::camera::common::V1_0::VendorTag;
+using ::android::hardware::camera::common::V1_0::VendorTagSection;
+using ::android::hardware::camera::common::V1_0::helper::CameraModule;
+using ::android::hardware::camera::common::V1_0::helper::VendorTagDescriptor;
+using ::android::hardware::camera::provider::V2_4::ICameraProvider;
+using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+using ::android::Mutex;
+
+struct CameraProvider : public ICameraProvider, public camera_module_callbacks_t {
+    CameraProvider();
+    ~CameraProvider();
+
+    // Caller must use this method to check if CameraProvider ctor failed
+    bool isInitFailed() { return mInitFailed; }
+
+    // Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
+    Return<Status> setCallback(const sp<ICameraProviderCallback>& callback) override;
+    Return<void> getVendorTags(getVendorTags_cb _hidl_cb) override;
+    Return<void> getCameraIdList(getCameraIdList_cb _hidl_cb) override;
+    Return<void> isSetTorchModeSupported(isSetTorchModeSupported_cb _hidl_cb) override;
+    Return<void> getCameraDeviceInterface_V1_x(
+            const hidl_string& cameraDeviceName,
+            getCameraDeviceInterface_V1_x_cb _hidl_cb) override;
+    Return<void> getCameraDeviceInterface_V3_x(
+            const hidl_string& cameraDeviceName,
+            getCameraDeviceInterface_V3_x_cb _hidl_cb) override;
+
+private:
+    Mutex mCbLock;
+    sp<ICameraProviderCallback> mCallbacks = nullptr;
+
+    sp<CameraModule> mModule;
+
+    int mNumberOfLegacyCameras;
+    std::map<std::string, camera_device_status_t> mCameraStatusMap; // camera id -> status
+    std::map<std::string, bool> mOpenLegacySupported; // camera id -> open_legacy HAL1.0 supported
+    SortedVector<std::string> mCameraIds; // the "0"/"1" legacy camera Ids
+    // (cameraId string, hidl device name) pairs
+    SortedVector<std::pair<std::string, std::string>> mCameraDeviceNames;
+
+    // Must be queried before using any APIs.
+    // APIs will only work when this returns true
+    bool mInitFailed;
+    bool initialize();
+
+    hidl_vec<VendorTagSection> mVendorTagSections;
+    bool setUpVendorTags();
+
+    // extract legacy camera ID/device version from a HIDL device name
+    static bool matchDeviceName(const hidl_string& deviceName, std::smatch& sm);
+    static std::string getLegacyCameraId(const hidl_string& deviceName);
+    static int getCameraDeviceVersion(const hidl_string& deviceName);
+
+    // create HIDL device name from camera ID and device version
+    static std::string getHidlDeviceName(std::string cameraId, int deviceVersion);
+
+    // convert conventional HAL status to HIDL Status
+    static Status getHidlStatus(int);
+
+    // static callback forwarding methods
+    static void sCameraDeviceStatusChange(
+        const struct camera_module_callbacks* callbacks,
+        int camera_id,
+        int new_status);
+    static void sTorchModeStatusChange(
+        const struct camera_module_callbacks* callbacks,
+        const char* camera_id,
+        int new_status);
+};
+
+extern "C" ICameraProvider* HIDL_FETCH_ICameraProvider(const char* name);
+
+}  // namespace implementation
+}  // namespace V2_4
+}  // namespace provider
+}  // namespace camera
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp
new file mode 100644
index 0000000..4947c17
--- /dev/null
+++ b/camera/provider/2.4/vts/functional/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "camera_hidl_hal_test",
+    gtest: true,
+    srcs: ["camera_hidl_hal_test.cpp"],
+    shared_libs: [
+        "liblog",
+        "libhidlbase",
+        "libhidltransport",
+        "libcutils",
+        "libutils",
+        "android.hardware.camera.provider@2.4",
+        "android.hardware.camera.device@3.2",
+        "libcamera_metadata"
+    ],
+    static_libs: ["libgtest"],
+    cflags: [
+        "-O0",
+        "-g",
+    ],
+}
diff --git a/camera/provider/2.4/vts/functional/camera_hidl_hal_test.cpp b/camera/provider/2.4/vts/functional/camera_hidl_hal_test.cpp
new file mode 100644
index 0000000..0eb291c
--- /dev/null
+++ b/camera/provider/2.4/vts/functional/camera_hidl_hal_test.cpp
@@ -0,0 +1,515 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "camera_hidl_hal_test"
+#include <android/hardware/camera/provider/2.4/ICameraProvider.h>
+#include <android/hardware/camera/device/3.2/ICameraDevice.h>
+#include <android/log.h>
+#include <gtest/gtest.h>
+#include <regex>
+#include "system/camera_metadata.h"
+
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::sp;
+using ::android::hardware::camera::common::V1_0::Status;
+using ::android::hardware::camera::common::V1_0::CameraDeviceStatus;
+using ::android::hardware::camera::common::V1_0::TorchMode;
+using ::android::hardware::camera::common::V1_0::TorchModeStatus;
+using ::android::hardware::camera::provider::V2_4::ICameraProvider;
+using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
+using ::android::hardware::camera::device::V3_2::CaptureRequest;
+using ::android::hardware::camera::device::V3_2::CaptureResult;
+using ::android::hardware::camera::device::V3_2::ICameraDeviceCallback;
+using ::android::hardware::camera::device::V3_2::ICameraDeviceSession;
+using ::android::hardware::camera::device::V3_2::NotifyMsg;
+using ::android::hardware::camera::device::V3_2::RequestTemplate;
+
+#define CAMERA_PASSTHROUGH_SERVICE_NAME "legacy/0"
+
+namespace {
+    // "device@<version>/legacy/<id>"
+    const char *kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/legacy/(.+)";
+    const int CAMERA_DEVICE_API_VERSION_3_2 = 0x302;
+    const int CAMERA_DEVICE_API_VERSION_1_0 = 0x100;
+    const char *kHAL3_2 = "3.2";
+    const char *kHAL1_0 = "1.0";
+
+    bool matchDeviceName(const hidl_string& deviceName, std::smatch& sm) {
+        std::regex e(kDeviceNameRE);
+        std::string deviceNameStd(deviceName.c_str());
+        return std::regex_match(deviceNameStd, sm, e);
+    }
+
+    int getCameraDeviceVersion(const hidl_string& deviceName) {
+        std::smatch sm;
+        bool match = matchDeviceName(deviceName, sm);
+        if (!match) {
+            return -1;
+        }
+        if (sm[1].compare(kHAL3_2) == 0) {
+            // maybe switched to 3.4 or define the hidl version enumlater
+            return CAMERA_DEVICE_API_VERSION_3_2;
+        } else if (sm[1].compare(kHAL1_0) == 0) {
+            return CAMERA_DEVICE_API_VERSION_1_0;
+        }
+        return 0;
+    }
+}
+
+// Test environment for camera
+class CameraHidlEnvironment : public ::testing::Environment {
+public:
+    // get the test environment singleton
+    static CameraHidlEnvironment* Instance() {
+        static CameraHidlEnvironment* instance = new CameraHidlEnvironment;
+        return instance;
+    }
+
+    virtual void SetUp() override;
+    virtual void TearDown() override;
+
+    sp<ICameraProvider> mProvider;
+
+private:
+    CameraHidlEnvironment() {}
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(CameraHidlEnvironment);
+};
+
+void CameraHidlEnvironment::SetUp() {
+    // TODO: test the binderized mode
+    mProvider = ICameraProvider::getService(CAMERA_PASSTHROUGH_SERVICE_NAME, true);
+    // TODO: handle the device doesn't have any camera case
+    ALOGI_IF(mProvider, "provider is not nullptr, %p", mProvider.get());
+    ASSERT_NE(mProvider, nullptr);
+}
+
+void CameraHidlEnvironment::TearDown() {
+    ALOGI("TearDown CameraHidlEnvironment");
+}
+
+// The main test class for camera HIDL HAL.
+class CameraHidlTest : public ::testing::Test {
+public:
+    virtual void SetUp() override {}
+    virtual void TearDown() override {}
+
+    hidl_vec<hidl_string> getCameraDeviceNames();
+
+    struct EmptyDeviceCb : public ICameraDeviceCallback {
+        virtual Return<void> processCaptureResult(const CaptureResult& /*result*/) override {
+            ALOGI("processCaptureResult callback");
+            ADD_FAILURE(); // Empty callback should not reach here
+            return Void();
+        }
+
+        virtual Return<void> notify(const NotifyMsg& /*msg*/) override {
+            ALOGI("notify callback");
+            ADD_FAILURE(); // Empty callback should not reach here
+            return Void();
+        }
+    };
+};
+
+hidl_vec<hidl_string> CameraHidlTest::getCameraDeviceNames() {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames;
+    env->mProvider->getCameraIdList(
+        [&](auto status, const auto& idList) {
+            ALOGI("getCameraIdList returns status:%d", (int)status);
+            for (size_t i = 0; i < idList.size(); i++) {
+                ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str());
+            }
+            ASSERT_EQ(Status::OK, status);
+            cameraDeviceNames = idList;
+        });
+    return cameraDeviceNames;
+}
+
+// Test if ICameraProvider::isTorchModeSupported returns Status::OK
+TEST_F(CameraHidlTest, isTorchModeSupported) {
+    CameraHidlEnvironment::Instance()->mProvider->isSetTorchModeSupported(
+        [&](auto status, bool support) {
+            ALOGI("isSetTorchModeSupported returns status:%d supported:%d",
+                    (int)status, support);
+            ASSERT_EQ(Status::OK, status);
+        });
+}
+
+// TODO: consider removing this test if getCameraDeviceNames() has the same coverage
+TEST_F(CameraHidlTest, getCameraIdList) {
+    CameraHidlEnvironment::Instance()->mProvider->getCameraIdList(
+        [&](auto status, const auto& idList) {
+            ALOGI("getCameraIdList returns status:%d", (int)status);
+            for (size_t i = 0; i < idList.size(); i++) {
+                ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str());
+            }
+            ASSERT_EQ(Status::OK, status);
+            // This is true for internal camera provider.
+            // Not necessary hold for external cameras providers
+            ASSERT_GT(idList.size(), 0u);
+        });
+}
+
+// Test if ICameraProvider::getVendorTags returns Status::OK
+TEST_F(CameraHidlTest, getVendorTags) {
+    CameraHidlEnvironment::Instance()->mProvider->getVendorTags(
+        [&](auto status, const auto& vendorTagSecs) {
+            ALOGI("getVendorTags returns status:%d numSections %zu",
+                    (int)status, vendorTagSecs.size());
+            for (size_t i = 0; i < vendorTagSecs.size(); i++) {
+                ALOGI("Vendor tag section %zu name %s",
+                        i, vendorTagSecs[i].sectionName.c_str());
+                for (size_t j = 0; j < vendorTagSecs[i].tags.size(); j++) {
+                    const auto& tag = vendorTagSecs[i].tags[j];
+                    ALOGI("Vendor tag id %u name %s type %d",
+                            tag.tagId,
+                            tag.tagName.c_str(),
+                            (int) tag.tagType);
+                }
+            }
+            ASSERT_EQ(Status::OK, status);
+        });
+}
+
+// Test if ICameraProvider::setCallback returns Status::OK
+TEST_F(CameraHidlTest, setCallback) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    struct ProviderCb : public ICameraProviderCallback {
+        virtual Return<void> cameraDeviceStatusChange(
+                const hidl_string& cameraDeviceName,
+                CameraDeviceStatus newStatus) override {
+            ALOGI("camera device status callback name %s, status %d",
+                    cameraDeviceName.c_str(), (int) newStatus);
+            return Void();
+        }
+
+        virtual Return<void> torchModeStatusChange(
+                const hidl_string& cameraDeviceName,
+                TorchModeStatus newStatus) override {
+            ALOGI("Torch mode status callback name %s, status %d",
+                    cameraDeviceName.c_str(), (int) newStatus);
+            return Void();
+        }
+    };
+    sp<ProviderCb> cb = new ProviderCb;
+    auto status = env->mProvider->setCallback(cb);
+    ASSERT_EQ(Status::OK, status);
+    // TODO: right now no callbacks are fired because there is no external camera
+    //       or torch mode change. Need to test torch API in CameraDevice test later.
+}
+
+// Test if ICameraProvider::getCameraDeviceInterface_V3_x returns Status::OK and non-null device
+TEST_F(CameraHidlTest, getCameraDeviceInterface_V3_x) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device3_2) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device3_2, nullptr);
+                });
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, getResourceCost) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("getResourceCost: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            device3_2->getResourceCost(
+                [&](auto status, const auto& resourceCost) {
+                    ALOGI("getResourceCost returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ALOGI("    Resource cost is %d", resourceCost.resourceCost);
+                    ASSERT_LE(resourceCost.resourceCost, 100u);
+                    for (const auto& name : resourceCost.conflictingDevices) {
+                        ALOGI("    Conflicting device: %s", name.c_str());
+                    }
+                });
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, getCameraCharacteristics) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            device3_2->getCameraCharacteristics(
+                [&](auto status, const auto& chars) {
+                    ALOGI("getCameraCharacteristics returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    const camera_metadata_t* metadata = (camera_metadata_t*) chars.data();
+                    size_t expectedSize = chars.size();
+                    ASSERT_EQ(0, validate_camera_metadata_structure(metadata, &expectedSize));
+                    size_t entryCount = get_camera_metadata_entry_count(metadata);
+                    // TODO: we can do better than 0 here. Need to check how many required
+                    // characteristics keys we've defined.
+                    ASSERT_GT(entryCount, 0u);
+                    ALOGI("getCameraCharacteristics metadata entry count is %zu", entryCount);
+                });
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, setTorchMode) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+    bool torchControlSupported = false;
+
+    CameraHidlEnvironment::Instance()->mProvider->isSetTorchModeSupported(
+        [&](auto status, bool support) {
+            ALOGI("isSetTorchModeSupported returns status:%d supported:%d",
+                    (int)status, support);
+            ASSERT_EQ(Status::OK, status);
+            torchControlSupported = support;
+        });
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("setTorchMode: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            Status status = device3_2->setTorchMode(TorchMode::ON);
+            ALOGI("setTorchMode return status %d", (int)status);
+            if (!torchControlSupported) {
+                ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, status);
+            } else {
+                ASSERT_TRUE(status == Status::OK || status == Status::OPERATION_NOT_SUPPORTED);
+                if (status == Status::OK) {
+                    status = device3_2->setTorchMode(TorchMode::OFF);
+                    ASSERT_EQ(Status::OK, status);
+                }
+            }
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, dumpState) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("dumpState: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = 1; // std out
+            hidl_handle handle = raw_handle;
+            device3_2->dumpState(handle);
+            native_handle_delete(raw_handle);
+        }
+    }
+}
+
+// Open, dumpStates, then close
+TEST_F(CameraHidlTest, openClose) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("openClose: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
+            sp<ICameraDeviceSession> session;
+            device3_2->open(
+                cb,
+                [&](auto status, const auto& newSession) {
+                    ALOGI("device::open returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(newSession, nullptr);
+                    session = newSession;
+                });
+
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = 1; // std out
+            hidl_handle handle = raw_handle;
+            device3_2->dumpState(handle);
+            native_handle_delete(raw_handle);
+
+            session->close();
+            // TODO: test all session API calls return INTERNAL_ERROR after close
+            // TODO: keep a wp copy here and verify session cannot be promoted out of this scope
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, constructDefaultRequestSettings) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("constructDefaultRequestSettings: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
+            sp<ICameraDeviceSession> session;
+            device3_2->open(
+                cb,
+                [&](auto status, const auto& newSession) {
+                    ALOGI("device::open returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(newSession, nullptr);
+                    session = newSession;
+                });
+
+            for (uint32_t t = (uint32_t) RequestTemplate::PREVIEW;
+                    t <= (uint32_t) RequestTemplate::MANUAL; t++) {
+                RequestTemplate reqTemplate = (RequestTemplate) t;
+                session->constructDefaultRequestSettings(
+                    reqTemplate,
+                    [&](auto status, const auto& req) {
+                        ALOGI("constructDefaultRequestSettings returns status:%d", (int)status);
+                        if (reqTemplate == RequestTemplate::ZERO_SHUTTER_LAG ||
+                                reqTemplate == RequestTemplate::MANUAL) {
+                            // optional templates
+                            ASSERT_TRUE(status == Status::OK || status == Status::ILLEGAL_ARGUMENT);
+                        } else {
+                            ASSERT_EQ(Status::OK, status);
+                        }
+
+                        if (status == Status::OK) {
+                            const camera_metadata_t* metadata =
+                                (camera_metadata_t*) req.data();
+                            size_t expectedSize = req.size();
+                            ASSERT_EQ(0, validate_camera_metadata_structure(
+                                    metadata, &expectedSize));
+                            size_t entryCount = get_camera_metadata_entry_count(metadata);
+                            // TODO: we can do better than 0 here. Need to check how many required
+                            // request keys we've defined for each template
+                            ASSERT_GT(entryCount, 0u);
+                            ALOGI("template %u metadata entry count is %zu", t, entryCount);
+                        } else {
+                            ASSERT_EQ(0u, req.size());
+                        }
+                    });
+            }
+            session->close();
+        }
+    }
+}
+
+TEST_F(CameraHidlTest, configureStreams) {
+    CameraHidlEnvironment* env = CameraHidlEnvironment::Instance();
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames();
+
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("configureStreams: Testing camera device %s", name.c_str());
+            env->mProvider->getCameraDeviceInterface_V3_x(
+                name,
+                [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+
+            sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
+            sp<ICameraDeviceSession> session;
+            device3_2->open(
+                cb,
+                [&](auto status, const auto& newSession) {
+                    ALOGI("device::open returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(newSession, nullptr);
+                    session = newSession;
+                });
+
+
+            session->close();
+        }
+    }
+}
+
+int main(int argc, char **argv) {
+  ::testing::AddGlobalTestEnvironment(CameraHidlEnvironment::Instance());
+  ::testing::InitGoogleTest(&argc, argv);
+  int status = RUN_ALL_TESTS();
+  ALOGI("Test result = %d", status);
+  return status;
+}
diff --git a/contexthub/1.0/Android.bp b/contexthub/1.0/Android.bp
index d34c418..5798306 100644
--- a/contexthub/1.0/Android.bp
+++ b/contexthub/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/contexthub/1.0/types.h",
         "android/hardware/contexthub/1.0/IContexthub.h",
         "android/hardware/contexthub/1.0/IHwContexthub.h",
-        "android/hardware/contexthub/1.0/BnContexthub.h",
-        "android/hardware/contexthub/1.0/BpContexthub.h",
+        "android/hardware/contexthub/1.0/BnHwContexthub.h",
+        "android/hardware/contexthub/1.0/BpHwContexthub.h",
         "android/hardware/contexthub/1.0/BsContexthub.h",
         "android/hardware/contexthub/1.0/IContexthubCallback.h",
         "android/hardware/contexthub/1.0/IHwContexthubCallback.h",
-        "android/hardware/contexthub/1.0/BnContexthubCallback.h",
-        "android/hardware/contexthub/1.0/BpContexthubCallback.h",
+        "android/hardware/contexthub/1.0/BnHwContexthubCallback.h",
+        "android/hardware/contexthub/1.0/BpHwContexthubCallback.h",
         "android/hardware/contexthub/1.0/BsContexthubCallback.h",
     ],
 }
diff --git a/contexthub/1.0/Android.mk b/contexthub/1.0/Android.mk
index 1286e66..c73c5c4 100644
--- a/contexthub/1.0/Android.mk
+++ b/contexthub/1.0/Android.mk
@@ -74,6 +74,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (HubAppInfo)
 #
 GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
@@ -381,6 +400,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (HubAppInfo)
 #
 GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal
index 8c792fd..c0928d5 100644
--- a/contexthub/1.0/IContexthub.hal
+++ b/contexthub/1.0/IContexthub.hal
@@ -18,6 +18,13 @@
 
 import IContexthubCallback;
 
+/*
+ * The Context Hub HAL provides an interface to a separate low-power processing
+ * domain that has direct access to contextual information, such as sensors.
+ * Native applications that run within a context hub are known as nanoapps, and
+ * they execute within the Context Hub Runtime Environment (CHRE), which is
+ * standardized via the CHRE API, defined elsewhere.
+ */
 interface IContexthub {
     /*
      * Enumerate all available context hubs on the system.
@@ -62,8 +69,16 @@
      *
      * Loading a nanoapp must not take more than 30 seconds.
      *
+     * Depending on the implementation, nanoApps loaded via this API may or may
+     * not persist across reboots of the hub. If they do persist, the
+     * implementation must initially place nanoApps in the disabled state upon a
+     * reboot, and not start them until a call is made to enableNanoApp(). In
+     * this case, the app must also be unloaded upon a factory reset of the
+     * device.
+     *
      * @param hubId identifer of the contextHub
-     *        appBinary serialized NanoApppBinary for the nanoApp
+     *        appBinary contains the binary representation of the nanoApp, plus
+     *                  metadata
      *        transactionId transactionId for this call
      *
      * @return result OK if transation started
@@ -74,7 +89,7 @@
      *
      */
     loadNanoApp(uint32_t hubId,
-                vec<uint8_t> appBinary,
+                NanoAppBinary appBinary,
                 uint32_t transactionId)
             generates (Result result);
 
@@ -154,18 +169,4 @@
      *
      */
     queryApps(uint32_t hubId) generates (Result result);
-
-    /**
-     * Reboots context hub OS, restarts all the nanoApps.
-     * No reboot notification is sent to nanoApps; reboot happens immediately
-     * and unconditionally; all volatile contexthub state and any data is lost
-     * as a result.
-     *
-     * @param hubId identifer of the contextHub
-     *
-     * @return result OK on success
-     *                BAD_VALUE if parameters are not sane
-     *
-     */
-    reboot(uint32_t hubId) generates (Result result);
 };
diff --git a/contexthub/1.0/IContexthubCallback.hal b/contexthub/1.0/IContexthubCallback.hal
index 9e9cf27..9a6db4c 100644
--- a/contexthub/1.0/IContexthubCallback.hal
+++ b/contexthub/1.0/IContexthubCallback.hal
@@ -49,6 +49,20 @@
      */
      handleHubEvent(AsyncEventType evt);
 
+    /*
+     * This callback is passed by the Contexthub service to the HAL
+     * implementation to allow the HAL to send a notification to the service
+     * that a nanp-app has aborted.
+     * This method must be called when a nanoapp invokes chreAbort(...)).
+     *
+     * @params appId : app identifier
+     *               : abortCode code passed by the nanoApp.
+     *
+     * Also see chreAbort(...)
+     *
+     */
+     handleAppAbort(uint64_t appId, uint32_t abortCode);
+
      /*
       * This callback is passed by the Contexthub service to the HAL
       * implementation to allow the HAL to send information about the
diff --git a/contexthub/1.0/default/Contexthub.cpp b/contexthub/1.0/default/Contexthub.cpp
index d530a87..4a6b3f2 100644
--- a/contexthub/1.0/default/Contexthub.cpp
+++ b/contexthub/1.0/default/Contexthub.cpp
@@ -18,9 +18,11 @@
 
 #include <inttypes.h>
 
-#include <android/log.h>
+#include <log/log.h>
+
 #include <android/hardware/contexthub/1.0/IContexthub.h>
 #include <hardware/context_hub.h>
+#include <sys/endian.h>
 
 #undef LOG_TAG
 #define LOG_TAG "ContextHubHalAdapter"
@@ -384,7 +386,7 @@
 }
 
 Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
-                                       const ::android::hardware::hidl_vec<uint8_t>& appBinary,
+                                       const NanoAppBinary& appBinary,
                                        uint32_t transactionId) {
     if (!isInitialized()) {
       return Result::NOT_INIT;
@@ -400,11 +402,34 @@
         return Result::BAD_PARAMS;
     }
 
-    hubMsg.message_type = CONTEXT_HUB_LOAD_APP;
-    hubMsg.message_len = appBinary.size();
-    hubMsg.message = appBinary.data();
+    // Data from the nanoapp header is passed through HIDL as explicit fields,
+    // but the legacy HAL expects it prepended to the binary, therefore we must
+    // reconstruct it here prior to passing to the legacy HAL.
+    uint32_t targetChreApiVersion =
+        (appBinary.targetChreApiMajorVersion << 24) |
+        (appBinary.targetChreApiMinorVersion << 16);
+    const struct nano_app_binary_t header = {
+        .header_version = htole32(1),
+        .magic          = htole32(NANOAPP_MAGIC),
+        .app_id.id      = htole64(appBinary.appId),
+        .app_version    = htole32(appBinary.appVersion),
+        .flags          = htole32(appBinary.flags),
+        .hw_hub_type    = htole64(0),
+        .reserved[0]    = htole32(targetChreApiVersion),
+        .reserved[1]    = 0,
+    };
+    const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);
 
-    if(mContextHubModule->send_message(hubId, &hubMsg) != 0) {
+    std::vector<uint8_t> binaryWithHeader(appBinary.customBinary);
+    binaryWithHeader.insert(binaryWithHeader.begin(),
+                            headerBytes,
+                            headerBytes + sizeof(header));
+
+    hubMsg.message_type = CONTEXT_HUB_LOAD_APP;
+    hubMsg.message_len = binaryWithHeader.size();
+    hubMsg.message = binaryWithHeader.data();
+
+    if (mContextHubModule->send_message(hubId, &hubMsg) != 0) {
         return Result::TRANSACTION_FAILED;
     } else {
         mTransactionId = transactionId;
diff --git a/contexthub/1.0/default/Contexthub.h b/contexthub/1.0/default/Contexthub.h
index 0883ce8..236e079 100644
--- a/contexthub/1.0/default/Contexthub.h
+++ b/contexthub/1.0/default/Contexthub.h
@@ -40,7 +40,7 @@
                                     const ContextHubMsg &msg) override;
 
     Return<Result> loadNanoApp(uint32_t hubId,
-                               const ::android::hardware::hidl_vec<uint8_t>& appBinary,
+                               const NanoAppBinary& appBinary,
                                uint32_t transactionId) override;
 
     Return<Result> unloadNanoApp(uint32_t hubId,
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index 043bb39..4950627 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -20,27 +20,32 @@
     OK,                  // Success
     UNKNOWN_FAILURE,     // Failure, unknown reason
     BAD_PARAMS,          // Parameters not sane
-    NOT_INIT,            // not initialized
-    TRANSACTION_FAILED,  // transaction failed
+    NOT_INIT,            // Not initialized
+    TRANSACTION_FAILED,  // Transaction failed
     TRANSACTION_PENDING, // Pending transaction, cannot accept a new request
 };
 
-
 enum NanoAppFlags : uint32_t {
-    SIGNED = (1<<0),   // Signed nanoapp
-    ENCRYPTED = (1<<1),// Encrypted nanoapp
+    SIGNED    = 1 << 0,
+    ENCRYPTED = 1 << 1,
 };
 
 struct NanoAppBinary {
-    uint32_t headerVersion;    // 0x1 for this version
-    uint32_t magic;            // "NANO"
-    uint64_t appId;            // App Id contains vendor id
-    uint32_t appVersion;       // Version of the app
-    uint32_t flags;            // mask of NanoAppFlags
-    uint64_t hwHubType;        // which hub type is this compiled for
-                               // a unique UUID for each h/w + toolchain
-                               // combination.
-    vec<uint8_t> customBinary; // start of custom binary data
+    uint64_t appId;            // Nanoapp identifier
+    uint32_t appVersion;       // Version of the app (semantics defined by app)
+    bitfield<NanoAppFlags> flags;
+
+    // The version of the CHRE API that this nanoApp was compiled against. See
+    // the CHRE API header file chre/version.h for more information. The hub
+    // implementation must use this to confirm compatibility before loading
+    // this nanoApp.
+    uint8_t targetChreApiMajorVersion;
+    uint8_t targetChreApiMinorVersion;
+
+    // Implementation-specific binary nanoapp data. This does not include the
+    // common nanoapp header that contains the app ID, etc., as this data is
+    // explicitly passed through the other fields in this struct.
+    vec<uint8_t> customBinary;
 };
 
 enum SensorType : uint32_t {
@@ -51,6 +56,8 @@
     BAROMETER,
     PROXIMITY_SENSOR,
     AMBIENT_LIGHT_SENSOR,
+    STATIONARY_DETECT,
+    INSTANT_MOTION_DETECT,
 
     GPS = 0x100,
     // Reserving this space for variants on GPS
@@ -65,6 +72,10 @@
     // Reserving this space for variants on Camera
 
     BLE = 0x500,
+    // Reserving this space for variants on Bluetooth Low Energy
+
+    WWAN = 0x600,
+    // Reserving this space for variants on WWAN
 
     PRIVATE_SENSOR_BASE = 0x10000,
     // Sensor types beyond PRIVATE_SENSOR_BASE are custom types
@@ -82,38 +93,69 @@
                                  // definition may be different from say the
                                  // number advertised in the sensors HAL
                                  // which allows for batching in a hub.
-    uint32_t fifoMaxCount;       // maximum number of batchable events.
-    uint64_t minDelayMs;         // in milliseconds, corresponding to highest
+    uint32_t fifoMaxCount;       // Maximum number of batchable events.
+    uint64_t minDelayMs;         // In milliseconds, corresponding to highest
                                  // sampling freq.
-    uint64_t maxDelayMs;         // in milliseconds, corresponds to minimum
+    uint64_t maxDelayMs;         // In milliseconds, corresponds to minimum
                                  // sampling frequency
     float peakPowerMw;           // At max frequency & no batching, power
                                  // in milliwatts
 };
 
 struct ContextHub {
-    string name;                // descriptive name eg: "Awesome Hub #1"
-    string vendor;              // hub hardware vendor eg: "Qualcomm"
-    string toolchain;           // toolchain to make binaries eg: "gcc ARM"
+    string name;                // Descriptive name eg: "Awesome Hub #1"
+    string vendor;              // Hub hardware vendor eg: "Qualcomm"
+    string toolchain;           // Toolchain to make binaries eg: "gcc ARM"
     uint32_t platformVersion;   // Version of the hardware : eg 0x20
     uint32_t toolchainVersion;  // Version of the toolchain : eg: 0x484
-    uint32_t hubId;             // a device unique id for this hub
+    uint32_t hubId;             // A device unique ID for this hub
 
     float peakMips;             // Peak MIPS platform can deliver
-    float stoppedPowerDrawMw;   // if stopped, retention power, milliwatts
-    float sleepPowerDrawMw;     // if sleeping, retention power, milliwatts
-    float peakPowerDrawMw;      // for a busy CPUm power in milliwatts
+    float stoppedPowerDrawMw;   // If stopped, retention power, milliwatts
+    float sleepPowerDrawMw;     // If sleeping, retention power, milliwatts
+    float peakPowerDrawMw;      // For a busy CPU, power in milliwatts
 
-    vec<PhysicalSensor> connectedSensors; // array of connected sensors
+    vec<PhysicalSensor> connectedSensors; // Array of connected sensors
 
     uint32_t maxSupportedMsgLen;// This is the maximum size of the message that can
                                 // be sent to the hub in one chunk (in bytes)
+
+    // Machine-readable CHRE platform ID, returned to nanoapps in the CHRE API
+    // function call chreGetPlatformId(). This field pairs with
+    // chreApiMajorVersion, chreApiMinorVersion, and chrePatchVersion to fully
+    // specify the CHRE implementation version. See also the CHRE API header
+    // file chre/version.h.
+    uint64_t chrePlatformId;
+
+    // The version of the CHRE implementation returned to nanoApps in the CHRE
+    // API function call chreGetVersion(). The major and minor version specify
+    // the implemented version of the CHRE API, while the patch version
+    // describes the implementation version within the scope of the platform
+    // ID. See also the CHRE API header file chre/version.h.
+    uint8_t chreApiMajorVersion;
+    uint8_t chreApiMinorVersion;
+    uint16_t chrePatchVersion;
+};
+
+enum HostEndPoint : uint16_t {
+    BROADCAST = 0xFFFF, // The message endpoint is a broadcast end point.
+                        // This value must never be used for a message from
+                        // the host to the hub.
+                        // If BROADCAST is specified as a destination for a
+                        // message from the context hub to the ContextHub
+                        // service, the message must be broadcast to all
+                        // registered clients by the Context Hub service.
+    UNSPECIFIED = 0xFFFE, // The message endpoint is unspecified. This value
+                          // must not be used for messages from the hub to host.
+                          // This value may be used for messages from the host
+                          // to the hub.
 };
 
 struct ContextHubMsg {
-    uint64_t appName; // intended recipient
-    uint32_t msgType; // identifier for message
-    vec<uint8_t> msg; // message body
+    uint64_t appName;      // Intended recipient (appId)
+    uint16_t hostEndPoint; // identifier for the endpoint. (also see enum HostEndPoint)
+    uint32_t msgType;      // Identifier for message
+    vec<uint8_t> msg;      // Message body
 };
 
 enum HubMemoryType : uint32_t {
@@ -123,30 +165,32 @@
 };
 
 enum HubMemoryFlag : uint32_t {
-    READ  = (1<<0), // Readable
-    WRITE = (1<<1), // Writable
-    EXEC  = (1<<2), // Executable
+    READ  = 1 << 0, // Readable
+    WRITE = 1 << 1, // Writable
+    EXEC  = 1 << 2, // Executable
 };
 
 struct MemRange {
-    uint32_t totalBytes; // total capacity in bytes
-    uint32_t freeBytes;  // free capacity in bytes
-    HubMemoryType type;  // type of memory, see HubMemoryType
-    uint32_t flags;      // mask of HubMemoryFlag
+    uint32_t totalBytes; // Total capacity in bytes
+    uint32_t freeBytes;  // Free capacity in bytes
+    HubMemoryType type;  // Type of memory, see HubMemoryType
+    bitfield<HubMemoryFlag> flags;
 };
 
 enum AsyncEventType : uint32_t {
-    RESTARTED = 1, // Hub restarted unexpectedly
+    RESTARTED = 1,   // Hub restarted unexpectedly
 };
 
 enum TransactionResult : int32_t {
-    SUCCESS,      // successful completion of transaction
-    FAILURE,      // failed transaction
+    SUCCESS,      // Successful completion of transaction
+    FAILURE,      // Failed transaction
 };
 
 struct HubAppInfo {
     uint64_t appId;         // Identifier of the app
-    uint32_t version;       // version of the app
+    uint32_t version;       // Version of the app
     vec<MemRange> memUsage; // Memory used by this app
+    bool enabled;           // true if the app is currently enabled and running,
+                            // or false if in the loaded but disabled state
 };
 
diff --git a/drm/1.0/default/Android.mk b/drm/1.0/default/Android.mk
new file mode 100644
index 0000000..87a0019
--- /dev/null
+++ b/drm/1.0/default/Android.mk
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.drm@1.0-service
+LOCAL_INIT_RC := android.hardware.drm@1.0-service.rc
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+  service.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+  libhidlbase \
+  libhidltransport \
+  liblog \
+  libhwbinder \
+  libutils \
+  libhardware \
+  android.hardware.drm.drm@1.0 \
+  android.hardware.drm.crypto@1.0 \
+  android.hidl.memory@1.0 \
+
+
+LOCAL_C_INCLUDES := \
+  hardware/interfaces/drm
+
+# TODO: The legacy DRM plugins only support 32-bit. They need
+# to be migrated to 64-bit (b/18948909)
+LOCAL_32_BIT_ONLY := true
+
+include $(BUILD_EXECUTABLE)
diff --git a/drm/1.0/default/android.hardware.drm@1.0-service.rc b/drm/1.0/default/android.hardware.drm@1.0-service.rc
new file mode 100644
index 0000000..281dc4b
--- /dev/null
+++ b/drm/1.0/default/android.hardware.drm@1.0-service.rc
@@ -0,0 +1,6 @@
+service drm-hal-1-0 /system/bin/hw/android.hardware.drm@1.0-service
+    class hal
+    user media
+    group mediadrm drmrpc
+    ioprio rt 4
+    writepid /dev/cpuset/foreground/tasks
diff --git a/drm/1.0/default/service.cpp b/drm/1.0/default/service.cpp
new file mode 100644
index 0000000..3531e03
--- /dev/null
+++ b/drm/1.0/default/service.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.drm@1.0-service"
+
+#include <crypto/1.0/default/CryptoFactory.h>
+#include <drm/1.0/default/DrmFactory.h>
+
+#include <hidl/HidlTransportSupport.h>
+#include <hidl/LegacySupport.h>
+
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::hardware::registerPassthroughServiceImplementation;
+
+using android::hardware::drm::crypto::V1_0::ICryptoFactory;
+using android::hardware::drm::drm::V1_0::IDrmFactory;
+
+int main() {
+    ALOGD("android.hardware.drm@1.0-service starting...");
+    configureRpcThreadpool(8, true /* callerWillJoin */);
+    registerPassthroughServiceImplementation<IDrmFactory>("drm");
+    registerPassthroughServiceImplementation<ICryptoFactory>("crypto");
+    joinRpcThreadpool();
+}
diff --git a/drm/crypto/1.0/Android.bp b/drm/crypto/1.0/Android.bp
index dd6805d..73eded1 100644
--- a/drm/crypto/1.0/Android.bp
+++ b/drm/crypto/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/drm/crypto/1.0/types.h",
         "android/hardware/drm/crypto/1.0/ICryptoFactory.h",
         "android/hardware/drm/crypto/1.0/IHwCryptoFactory.h",
-        "android/hardware/drm/crypto/1.0/BnCryptoFactory.h",
-        "android/hardware/drm/crypto/1.0/BpCryptoFactory.h",
+        "android/hardware/drm/crypto/1.0/BnHwCryptoFactory.h",
+        "android/hardware/drm/crypto/1.0/BpHwCryptoFactory.h",
         "android/hardware/drm/crypto/1.0/BsCryptoFactory.h",
         "android/hardware/drm/crypto/1.0/ICryptoPlugin.h",
         "android/hardware/drm/crypto/1.0/IHwCryptoPlugin.h",
-        "android/hardware/drm/crypto/1.0/BnCryptoPlugin.h",
-        "android/hardware/drm/crypto/1.0/BpCryptoPlugin.h",
+        "android/hardware/drm/crypto/1.0/BnHwCryptoPlugin.h",
+        "android/hardware/drm/crypto/1.0/BpHwCryptoPlugin.h",
         "android/hardware/drm/crypto/1.0/BsCryptoPlugin.h",
     ],
 }
diff --git a/drm/crypto/1.0/ICryptoPlugin.hal b/drm/crypto/1.0/ICryptoPlugin.hal
index e892e3c..52c1d02 100644
--- a/drm/crypto/1.0/ICryptoPlugin.hal
+++ b/drm/crypto/1.0/ICryptoPlugin.hal
@@ -73,6 +73,8 @@
      * of clear and encrypted bytes to process. This allows the decrypt
      * call to operate on a range of subsamples in a single call
      * @param source the input buffer for the decryption
+     * @param offset the offset of the first byte of encrypted data from
+     * the base of the source buffer
      * @param destination the output buffer for the decryption
      * @return status the status of the call. The status must be OK or one of
      * the following errors: ERROR_DRM_NO_LICENSE if no license keys have been
@@ -83,9 +85,12 @@
      * ERROR_DRM_SESSION_NOT_OPENED if the decrypt session is not opened, or
      * ERROR_DRM_CANNOT_HANDLE in other failure cases.
      * @return bytesWritten the number of bytes output from the decryption
+     * @return detailedError if the error is a vendor-specific error, the
+     * vendor's crypto HAL may provide a detailed error string to help
+     * describe the error.
      */
     decrypt(bool secure, uint8_t[16] keyId, uint8_t[16] iv, Mode mode,
         Pattern pattern, vec<SubSample> subSamples,
-            memory source, DestinationBuffer destination)
-        generates(Status status, uint32_t bytesWritten);
+            memory source, uint32_t offset, DestinationBuffer destination)
+        generates(Status status, uint32_t bytesWritten, string detailedError);
 };
diff --git a/drm/crypto/1.0/default/Android.mk b/drm/crypto/1.0/default/Android.mk
index 83794ac..27fca98 100644
--- a/drm/crypto/1.0/default/Android.mk
+++ b/drm/crypto/1.0/default/Android.mk
@@ -32,10 +32,15 @@
     libmediadrm \
     libstagefright_foundation \
     android.hardware.drm.crypto@1.0 \
-    android.hidl.memory@1.0
+    android.hidl.memory@1.0 \
 
 LOCAL_C_INCLUDES := \
     frameworks/native/include \
     frameworks/av/include
 
+# TODO: The legacy DRM plugins only support 32-bit. They need
+# to be migrated to 64-bit (b/18948909)
+LOCAL_32_BIT_ONLY := true
+
+
 include $(BUILD_SHARED_LIBRARY)
diff --git a/drm/crypto/1.0/default/CryptoFactory.cpp b/drm/crypto/1.0/default/CryptoFactory.cpp
index 187d564..9519d01 100644
--- a/drm/crypto/1.0/default/CryptoFactory.cpp
+++ b/drm/crypto/1.0/default/CryptoFactory.cpp
@@ -27,7 +27,8 @@
 namespace implementation {
 
     CryptoFactory::CryptoFactory() :
-        loader("/vendor/lib/mediadrm", "createCryptoFactory") {}
+        loader("/vendor/lib/mediadrm", "createCryptoFactory") {
+    }
 
     // Methods from ::android::hardware::drm::crypto::V1_0::ICryptoFactory follow.
     Return<bool> CryptoFactory::isCryptoSchemeSupported(
@@ -42,7 +43,6 @@
 
     Return<void> CryptoFactory::createPlugin(const hidl_array<uint8_t, 16>& uuid,
             const hidl_vec<uint8_t>& initData, createPlugin_cb _hidl_cb) {
-
         for (size_t i = 0; i < loader.factoryCount(); i++) {
             if (loader.getFactory(i)->isCryptoSchemeSupported(uuid.data())) {
                 android::CryptoPlugin *legacyPlugin = NULL;
@@ -62,7 +62,7 @@
         return Void();
     }
 
-    ICryptoFactory* HIDL_FETCH_ICryptoFactory(const char /* *name */) {
+    ICryptoFactory* HIDL_FETCH_ICryptoFactory(const char* /* name */) {
         return new CryptoFactory();
     }
 
diff --git a/drm/crypto/1.0/default/CryptoPlugin.cpp b/drm/crypto/1.0/default/CryptoPlugin.cpp
index 7921852..81365c8 100644
--- a/drm/crypto/1.0/default/CryptoPlugin.cpp
+++ b/drm/crypto/1.0/default/CryptoPlugin.cpp
@@ -21,6 +21,7 @@
 
 #include <hidlmemory/mapping.h>
 #include <android/hidl/memory/1.0/IMemory.h>
+#include <utils/Log.h>
 
 using android::hidl::memory::V1_0::IMemory;
 
@@ -53,7 +54,8 @@
             const hidl_array<uint8_t, 16>& keyId,
             const hidl_array<uint8_t, 16>& iv, Mode mode,
             const Pattern& pattern, const hidl_vec<SubSample>& subSamples,
-            const hidl_memory &source, const DestinationBuffer& destination,
+            const hidl_memory& source, uint32_t offset,
+            const DestinationBuffer& destination,
             decrypt_cb _hidl_cb) {
 
         android::CryptoPlugin::Mode legacyMode;
@@ -87,25 +89,32 @@
 
         AString detailMessage;
 
+        sp<IMemory> sharedSourceMemory = mapMemory(source);
+
+        void *srcPtr = static_cast<void *>(sharedSourceMemory->getPointer());
+        uint8_t *offsetSrc = static_cast<uint8_t *>(srcPtr) + offset;
+        srcPtr = static_cast<void *>(offsetSrc);
+
+        sp<IMemory> sharedDestinationMemory;
         void *destPtr = NULL;
-        sp<IMemory> sharedMemory;
 
         if (destination.type == BufferType::SHARED_MEMORY) {
-            sharedMemory = mapMemory(source);
-            destPtr = sharedMemory->getPointer();
-            sharedMemory->update();
+            sharedDestinationMemory = mapMemory(destination.nonsecureMemory);
+            sharedDestinationMemory->update();
+            destPtr = sharedDestinationMemory->getPointer();
         } else if (destination.type == BufferType::NATIVE_HANDLE) {
             native_handle_t *handle = const_cast<native_handle_t *>(
                     destination.secureMemory.getNativeHandle());
             destPtr = static_cast<void *>(handle);
         }
         ssize_t result = mLegacyPlugin->decrypt(secure, keyId.data(), iv.data(),
-                legacyMode, legacyPattern, sharedMemory->getPointer(),
-                legacySubSamples, subSamples.size(), destPtr, &detailMessage);
+                legacyMode, legacyPattern, srcPtr, legacySubSamples,
+                subSamples.size(), destPtr, &detailMessage);
 
         if (destination.type == BufferType::SHARED_MEMORY) {
-            sharedMemory->commit();
+            sharedDestinationMemory->commit();
         }
+
         delete[] legacySubSamples;
 
         uint32_t status;
@@ -119,7 +128,7 @@
             bytesWritten = 0;
         }
 
-        _hidl_cb(toStatus(status), bytesWritten);
+        _hidl_cb(toStatus(status), bytesWritten, detailMessage.c_str());
         return Void();
     }
 
diff --git a/drm/crypto/1.0/default/CryptoPlugin.h b/drm/crypto/1.0/default/CryptoPlugin.h
index b17dade..b1473f1 100644
--- a/drm/crypto/1.0/default/CryptoPlugin.h
+++ b/drm/crypto/1.0/default/CryptoPlugin.h
@@ -42,6 +42,7 @@
 
 struct CryptoPlugin : public ICryptoPlugin {
     CryptoPlugin(android::CryptoPlugin *plugin) : mLegacyPlugin(plugin) {}
+
     ~CryptoPlugin() {delete mLegacyPlugin;}
 
     // Methods from ::android::hardware::drm::crypto::V1_0::ICryptoPlugin
@@ -58,7 +59,8 @@
     Return<void> decrypt(bool secure, const hidl_array<uint8_t, 16>& keyId,
             const hidl_array<uint8_t, 16>& iv, Mode mode, const Pattern& pattern,
             const hidl_vec<SubSample>& subSamples, const hidl_memory& source,
-            const DestinationBuffer& destination, decrypt_cb _hidl_cb) override;
+            uint32_t offset, const DestinationBuffer& destination,
+            decrypt_cb _hidl_cb) override;
 
 private:
     android::CryptoPlugin *mLegacyPlugin;
diff --git a/drm/drm/1.0/Android.bp b/drm/drm/1.0/Android.bp
index 8f198c7..dfff435 100644
--- a/drm/drm/1.0/Android.bp
+++ b/drm/drm/1.0/Android.bp
@@ -32,18 +32,18 @@
         "android/hardware/drm/drm/1.0/types.h",
         "android/hardware/drm/drm/1.0/IDrmFactory.h",
         "android/hardware/drm/drm/1.0/IHwDrmFactory.h",
-        "android/hardware/drm/drm/1.0/BnDrmFactory.h",
-        "android/hardware/drm/drm/1.0/BpDrmFactory.h",
+        "android/hardware/drm/drm/1.0/BnHwDrmFactory.h",
+        "android/hardware/drm/drm/1.0/BpHwDrmFactory.h",
         "android/hardware/drm/drm/1.0/BsDrmFactory.h",
         "android/hardware/drm/drm/1.0/IDrmPlugin.h",
         "android/hardware/drm/drm/1.0/IHwDrmPlugin.h",
-        "android/hardware/drm/drm/1.0/BnDrmPlugin.h",
-        "android/hardware/drm/drm/1.0/BpDrmPlugin.h",
+        "android/hardware/drm/drm/1.0/BnHwDrmPlugin.h",
+        "android/hardware/drm/drm/1.0/BpHwDrmPlugin.h",
         "android/hardware/drm/drm/1.0/BsDrmPlugin.h",
         "android/hardware/drm/drm/1.0/IDrmPluginListener.h",
         "android/hardware/drm/drm/1.0/IHwDrmPluginListener.h",
-        "android/hardware/drm/drm/1.0/BnDrmPluginListener.h",
-        "android/hardware/drm/drm/1.0/BpDrmPluginListener.h",
+        "android/hardware/drm/drm/1.0/BnHwDrmPluginListener.h",
+        "android/hardware/drm/drm/1.0/BpHwDrmPluginListener.h",
         "android/hardware/drm/drm/1.0/BsDrmPluginListener.h",
     ],
 }
diff --git a/drm/drm/1.0/default/Android.mk b/drm/drm/1.0/default/Android.mk
index 952957c..52e67e1 100644
--- a/drm/drm/1.0/default/Android.mk
+++ b/drm/drm/1.0/default/Android.mk
@@ -36,4 +36,8 @@
     frameworks/native/include \
     frameworks/av/include
 
+# TODO: The legacy DRM plugins only support 32-bit. They need
+# to be migrated to 64-bit (b/18948909)
+LOCAL_32_BIT_ONLY := true
+
 include $(BUILD_SHARED_LIBRARY)
diff --git a/drm/drm/1.0/default/DrmFactory.cpp b/drm/drm/1.0/default/DrmFactory.cpp
index f2d4a5a..98a8416 100644
--- a/drm/drm/1.0/default/DrmFactory.cpp
+++ b/drm/drm/1.0/default/DrmFactory.cpp
@@ -27,7 +27,8 @@
 namespace implementation {
 
     DrmFactory::DrmFactory() :
-        loader("/vendor/lib/mediadrm", "createDrmFactory") {}
+        loader("/vendor/lib/mediadrm", "createDrmFactory") {
+    }
 
     // Methods from ::android::hardware::drm::drm::V1_0::IDrmFactory follow.
     Return<bool> DrmFactory::isCryptoSchemeSupported (
diff --git a/drm/drm/1.0/default/DrmPlugin.cpp b/drm/drm/1.0/default/DrmPlugin.cpp
index 5c8f426..0239502 100644
--- a/drm/drm/1.0/default/DrmPlugin.cpp
+++ b/drm/drm/1.0/default/DrmPlugin.cpp
@@ -30,7 +30,6 @@
     // Methods from ::android::hardware::drm::drm::V1_0::IDrmPlugin follow.
 
     Return<void> DrmPlugin::openSession(openSession_cb _hidl_cb) {
-
         Vector<uint8_t> legacySessionId;
         status_t status = mLegacyPlugin->openSession(legacySessionId);
         _hidl_cb(toStatus(status), toHidlVec(legacySessionId));
diff --git a/dumpstate/1.0/Android.bp b/dumpstate/1.0/Android.bp
index 893e2f7..7255937 100644
--- a/dumpstate/1.0/Android.bp
+++ b/dumpstate/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/dumpstate/1.0/IDumpstateDevice.h",
         "android/hardware/dumpstate/1.0/IHwDumpstateDevice.h",
-        "android/hardware/dumpstate/1.0/BnDumpstateDevice.h",
-        "android/hardware/dumpstate/1.0/BpDumpstateDevice.h",
+        "android/hardware/dumpstate/1.0/BnHwDumpstateDevice.h",
+        "android/hardware/dumpstate/1.0/BpHwDumpstateDevice.h",
         "android/hardware/dumpstate/1.0/BsDumpstateDevice.h",
     ],
 }
diff --git a/dumpstate/1.0/default/Android.mk b/dumpstate/1.0/default/Android.mk
index 4d5c908..0b15184 100644
--- a/dumpstate/1.0/default/Android.mk
+++ b/dumpstate/1.0/default/Android.mk
@@ -1,22 +1,22 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.dumpstate@1.0-impl
+LOCAL_MODULE := android.hardware.dumpstate@1.0-service
+LOCAL_INIT_RC := android.hardware.dumpstate@1.0-service.rc
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SRC_FILES := \
     DumpstateDevice.cpp \
+    service.cpp
 
 LOCAL_SHARED_LIBRARIES := \
     android.hardware.dumpstate@1.0 \
     libbase \
     libcutils \
+    libdumpstateutil \
     libhidlbase \
     libhidltransport \
     libhwbinder \
     liblog \
     libutils
 
-LOCAL_STATIC_LIBRARIES := \
-    libdumpstateutil
-
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_EXECUTABLE)
diff --git a/dumpstate/1.0/default/DumpstateDevice.cpp b/dumpstate/1.0/default/DumpstateDevice.cpp
index 4264235..8000d85 100644
--- a/dumpstate/1.0/default/DumpstateDevice.cpp
+++ b/dumpstate/1.0/default/DumpstateDevice.cpp
@@ -22,6 +22,9 @@
 
 #include "DumpstateUtil.h"
 
+using android::os::dumpstate::DumpFileToFd;
+using android::os::dumpstate::RunCommandToFd;
+
 namespace android {
 namespace hardware {
 namespace dumpstate {
@@ -30,6 +33,10 @@
 
 // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
 Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
+    // NOTE: this is just an example on how to use the DumpstateUtil.h functions to implement
+    // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
+    // be called by dumpstate.
+
     if (handle->numFds < 1) {
         ALOGE("no FDs\n");
         return Void();
@@ -51,13 +58,6 @@
     return Void();
 }
 
-
-IDumpstateDevice* HIDL_FETCH_IDumpstateDevice(const char* /* name */) {
-    // TODO: temporary returning nullptr until it's implemented on master devices
-    return nullptr;
-//    return new DumpstateDevice();
-}
-
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace dumpstate
diff --git a/dumpstate/1.0/default/DumpstateDevice.h b/dumpstate/1.0/default/DumpstateDevice.h
index f216304..f8585f5 100644
--- a/dumpstate/1.0/default/DumpstateDevice.h
+++ b/dumpstate/1.0/default/DumpstateDevice.h
@@ -41,8 +41,6 @@
 
 };
 
-extern "C" IDumpstateDevice* HIDL_FETCH_IDumpstateDevice(const char* name);
-
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace dumpstate
diff --git a/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc b/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc
new file mode 100644
index 0000000..99b968e
--- /dev/null
+++ b/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc
@@ -0,0 +1,4 @@
+service dumpstate-1-0 /system/bin/hw/android.hardware.dumpstate@1.0-service
+    class hal
+    user system
+    group system
diff --git a/dumpstate/1.0/default/service.cpp b/dumpstate/1.0/default/service.cpp
new file mode 100644
index 0000000..0d5bd94
--- /dev/null
+++ b/dumpstate/1.0/default/service.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "android.hardware.dumpstate@1.0-service"
+
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "DumpstateDevice.h"
+
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
+using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
+using ::android::hardware::joinRpcThreadpool;
+using ::android::sp;
+
+int main (int /* argc */, char * /* argv */ []) {
+    sp<IDumpstateDevice> dumpstate = new DumpstateDevice;
+    configureRpcThreadpool(1, true);
+    dumpstate->registerAsService("dumpstate");
+    joinRpcThreadpool();
+}
diff --git a/evs/1.0/Android.bp b/evs/1.0/Android.bp
index 86e9c1c..ed29968 100644
--- a/evs/1.0/Android.bp
+++ b/evs/1.0/Android.bp
@@ -35,23 +35,23 @@
         "android/hardware/evs/1.0/types.h",
         "android/hardware/evs/1.0/IEvsCamera.h",
         "android/hardware/evs/1.0/IHwEvsCamera.h",
-        "android/hardware/evs/1.0/BnEvsCamera.h",
-        "android/hardware/evs/1.0/BpEvsCamera.h",
+        "android/hardware/evs/1.0/BnHwEvsCamera.h",
+        "android/hardware/evs/1.0/BpHwEvsCamera.h",
         "android/hardware/evs/1.0/BsEvsCamera.h",
         "android/hardware/evs/1.0/IEvsCameraStream.h",
         "android/hardware/evs/1.0/IHwEvsCameraStream.h",
-        "android/hardware/evs/1.0/BnEvsCameraStream.h",
-        "android/hardware/evs/1.0/BpEvsCameraStream.h",
+        "android/hardware/evs/1.0/BnHwEvsCameraStream.h",
+        "android/hardware/evs/1.0/BpHwEvsCameraStream.h",
         "android/hardware/evs/1.0/BsEvsCameraStream.h",
         "android/hardware/evs/1.0/IEvsDisplay.h",
         "android/hardware/evs/1.0/IHwEvsDisplay.h",
-        "android/hardware/evs/1.0/BnEvsDisplay.h",
-        "android/hardware/evs/1.0/BpEvsDisplay.h",
+        "android/hardware/evs/1.0/BnHwEvsDisplay.h",
+        "android/hardware/evs/1.0/BpHwEvsDisplay.h",
         "android/hardware/evs/1.0/BsEvsDisplay.h",
         "android/hardware/evs/1.0/IEvsEnumerator.h",
         "android/hardware/evs/1.0/IHwEvsEnumerator.h",
-        "android/hardware/evs/1.0/BnEvsEnumerator.h",
-        "android/hardware/evs/1.0/BpEvsEnumerator.h",
+        "android/hardware/evs/1.0/BnHwEvsEnumerator.h",
+        "android/hardware/evs/1.0/BpHwEvsEnumerator.h",
         "android/hardware/evs/1.0/BsEvsEnumerator.h",
     ],
 }
diff --git a/evs/1.0/default/EvsCamera.cpp b/evs/1.0/default/EvsCamera.cpp
index 32d4ed7..6715a2e 100644
--- a/evs/1.0/default/EvsCamera.cpp
+++ b/evs/1.0/default/EvsCamera.cpp
@@ -48,14 +48,14 @@
 
     // Set up dummy data for testing
     if (mDescription.cameraId == kCameraName_Backup) {
-        mDescription.hints                  = UsageHint::USAGE_HINT_REVERSE;
+        mDescription.hints                  = static_cast<uint32_t>(UsageHint::USAGE_HINT_REVERSE);
         mDescription.vendorFlags            = 0xFFFFFFFF;   // Arbitrary value
         mDescription.defaultHorResolution   = 320;          // 1/2 NTSC/VGA
         mDescription.defaultVerResolution   = 240;          // 1/2 NTSC/VGA
     }
     else if (mDescription.cameraId == kCameraName_RightTurn) {
         // Nothing but the name and the usage hint
-        mDescription.hints                  = UsageHint::USAGE_HINT_RIGHT_TURN;
+        mDescription.hints                  = static_cast<uint32_t>(UsageHint::USAGE_HINT_RIGHT_TURN);
     }
     else {
         // Leave empty for a minimalist camera description without even a hint
@@ -149,7 +149,7 @@
     return EvsResult::OK;
 }
 
-Return<EvsResult> EvsCamera::doneWithFrame(uint32_t frameId, const hidl_handle& bufferHandle)  {
+Return<EvsResult> EvsCamera::doneWithFrame(uint32_t /* frameId */, const hidl_handle& bufferHandle)  {
     ALOGD("doneWithFrame");
     std::lock_guard<std::mutex> lock(mAccessLock);
 
diff --git a/evs/1.0/default/EvsEnumerator.cpp b/evs/1.0/default/EvsEnumerator.cpp
index 9f38041..ba8da00 100644
--- a/evs/1.0/default/EvsEnumerator.cpp
+++ b/evs/1.0/default/EvsEnumerator.cpp
@@ -62,8 +62,7 @@
     return Void();
 }
 
-Return<void> EvsEnumerator::openCamera(const hidl_string& cameraId,
-                                             openCamera_cb callback) {
+Return<sp<IEvsCamera>> EvsEnumerator::openCamera(const hidl_string& cameraId) {
     ALOGD("openCamera");
 
     // Find the named camera
@@ -78,20 +77,18 @@
 
     if (!pRecord) {
         ALOGE("Requested camera %s not found", cameraId.c_str());
-        callback(nullptr);
+        return nullptr;
     }
     else if (pRecord->inUse) {
         ALOGE("Cannot open camera %s which is already in use", cameraId.c_str());
-        callback(nullptr);
+        return nullptr;
     }
     else {
         /* TODO(b/33492405):  Do this, When HIDL can give us back a recognizable pointer
         pRecord->inUse = true;
          */
-        callback(pRecord->pCamera);
+        return(pRecord->pCamera);
     }
-
-    return Void();
 }
 
 Return<void> EvsEnumerator::closeCamera(const ::android::sp<IEvsCamera>& camera) {
@@ -112,22 +109,20 @@
     return Void();
 }
 
-Return<void> EvsEnumerator::openDisplay(openDisplay_cb callback) {
+Return<sp<IEvsDisplay>> EvsEnumerator::openDisplay() {
     ALOGD("openDisplay");
 
     // If we already have a display active, then this request must be denied
     if (mActiveDisplay != nullptr) {
         ALOGW("Rejecting openDisplay request the display is already in use.");
-        callback(nullptr);
+        return nullptr;
     }
     else {
         // Create a new display interface and return it
         mActiveDisplay = new EvsDisplay();
         ALOGD("Returning new EvsDisplay object %p", mActiveDisplay.get());
-        callback(mActiveDisplay);
+        return mActiveDisplay;
     }
-
-    return Void();
 }
 
 Return<void> EvsEnumerator::closeDisplay(const ::android::sp<IEvsDisplay>& display) {
diff --git a/evs/1.0/default/EvsEnumerator.h b/evs/1.0/default/EvsEnumerator.h
index 69caa17..90df837 100644
--- a/evs/1.0/default/EvsEnumerator.h
+++ b/evs/1.0/default/EvsEnumerator.h
@@ -34,9 +34,9 @@
 public:
     // Methods from ::android::hardware::evs::V1_0::IEvsEnumerator follow.
     Return<void> getCameraList(getCameraList_cb _hidl_cb)  override;
-    Return<void> openCamera(const hidl_string& cameraId, openCamera_cb callback)  override;
+    Return<sp<IEvsCamera>> openCamera(const hidl_string& cameraId) override;
     Return<void> closeCamera(const ::android::sp<IEvsCamera>& carCamera)  override;
-    Return<void> openDisplay(openDisplay_cb callback)  override;
+    Return<sp<IEvsDisplay>> openDisplay()  override;
     Return<void> closeDisplay(const ::android::sp<IEvsDisplay>& display)  override;
 
     // Implementation details
diff --git a/evs/1.0/types.hal b/evs/1.0/types.hal
index e0051e1..fd9dcdc 100644
--- a/evs/1.0/types.hal
+++ b/evs/1.0/types.hal
@@ -32,7 +32,6 @@
     USAGE_HINT_REVERSE      = 0x00000001,
     USAGE_HINT_LEFT_TURN    = 0x00000002,
     USAGE_HINT_RIGHT_TURN   = 0x00000004,
-    // remaining bits are reserved for future use
 };
 
 
@@ -48,11 +47,11 @@
  * should be set to ZERO.
  */
 struct CameraDesc {
-    string      cameraId;
-    UsageHint   hints;                  // Bit flags (legal to | values together) (TODO: b/31702236)
-    uint32_t    vendorFlags;            // Opaque value from driver
-    uint32_t    defaultHorResolution;   // Units of pixels
-    uint32_t    defaultVerResolution;   // Units of pixels
+    string              cameraId;
+    bitfield<UsageHint> hints;                  // Mask of usage hints
+    uint32_t            vendorFlags;            // Opaque value from driver
+    uint32_t            defaultHorResolution;   // Units of pixels
+    uint32_t            defaultVerResolution;   // Units of pixels
 };
 
 
@@ -90,7 +89,6 @@
 
 
 /* Error codes used in EVS HAL interface. */
-/* TODO:  Adopt a common set of function return codes */
 enum EvsResult : uint32_t {
     OK = 0,
     INVALID_ARG,
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
index 451ac38..cc50b83 100644
--- a/example/extension/light/2.0/Android.bp
+++ b/example/extension/light/2.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/example/extension/light/2.0/types.h",
         "android/hardware/example/extension/light/2.0/IExtLight.h",
         "android/hardware/example/extension/light/2.0/IHwExtLight.h",
-        "android/hardware/example/extension/light/2.0/BnExtLight.h",
-        "android/hardware/example/extension/light/2.0/BpExtLight.h",
+        "android/hardware/example/extension/light/2.0/BnHwExtLight.h",
+        "android/hardware/example/extension/light/2.0/BpHwExtLight.h",
         "android/hardware/example/extension/light/2.0/BsExtLight.h",
     ],
 }
diff --git a/gatekeeper/1.0/Android.bp b/gatekeeper/1.0/Android.bp
index 987411b..8ef33ab 100644
--- a/gatekeeper/1.0/Android.bp
+++ b/gatekeeper/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/gatekeeper/1.0/types.h",
         "android/hardware/gatekeeper/1.0/IGatekeeper.h",
         "android/hardware/gatekeeper/1.0/IHwGatekeeper.h",
-        "android/hardware/gatekeeper/1.0/BnGatekeeper.h",
-        "android/hardware/gatekeeper/1.0/BpGatekeeper.h",
+        "android/hardware/gatekeeper/1.0/BnHwGatekeeper.h",
+        "android/hardware/gatekeeper/1.0/BpHwGatekeeper.h",
         "android/hardware/gatekeeper/1.0/BsGatekeeper.h",
     ],
 }
diff --git a/gatekeeper/1.0/default/Gatekeeper.cpp b/gatekeeper/1.0/default/Gatekeeper.cpp
index 36e044c..dce06e6 100644
--- a/gatekeeper/1.0/default/Gatekeeper.cpp
+++ b/gatekeeper/1.0/default/Gatekeeper.cpp
@@ -15,9 +15,10 @@
  */
 #define LOG_TAG "android.hardware.gatekeeper@1.0-service"
 
-#include <android/log.h>
 #include <dlfcn.h>
 
+#include <log/log.h>
+
 #include "Gatekeeper.h"
 
 namespace android {
diff --git a/gatekeeper/1.0/vts/functional/gatekeeper_hidl_hal_test.cpp b/gatekeeper/1.0/vts/functional/gatekeeper_hidl_hal_test.cpp
index e919b48..09690f8 100644
--- a/gatekeeper/1.0/vts/functional/gatekeeper_hidl_hal_test.cpp
+++ b/gatekeeper/1.0/vts/functional/gatekeeper_hidl_hal_test.cpp
@@ -85,7 +85,7 @@
       auto ret = gatekeeper_->enroll(
           uid_, req.curPwdHandle, req.curPwd, req.newPwd,
           [&rsp](const GatekeeperResponse &cbRsp) { rsp = cbRsp; });
-      ASSERT_TRUE(ret.getStatus().isOk());
+      ASSERT_TRUE(ret.isOk());
       if (rsp.code != GatekeeperStatusCode::ERROR_RETRY_TIMEOUT) break;
       ALOGI("%s: got retry code; retrying in 1 sec", __func__);
       sleep(1);
@@ -97,7 +97,7 @@
       auto ret = gatekeeper_->verify(
           uid_, req.challenge, req.curPwdHandle, req.newPwd,
           [&rsp](const GatekeeperResponse &cb_rsp) { rsp = cb_rsp; });
-      ASSERT_TRUE(ret.getStatus().isOk());
+      ASSERT_TRUE(ret.isOk());
       if (rsp.code != GatekeeperStatusCode::ERROR_RETRY_TIMEOUT) break;
       ALOGI("%s: got retry code; retrying in 1 sec", __func__);
       sleep(1);
@@ -108,7 +108,7 @@
     while (true) {
       auto ret = gatekeeper_->deleteUser(
           uid_, [&rsp](const GatekeeperResponse &cb_rsp) { rsp = cb_rsp; });
-      ASSERT_TRUE(ret.getStatus().isOk());
+      ASSERT_TRUE(ret.isOk());
       if (rsp.code != GatekeeperStatusCode::ERROR_RETRY_TIMEOUT) break;
       ALOGI("%s: got retry code; retrying in 1 sec", __func__);
       sleep(1);
@@ -119,7 +119,7 @@
     while (true) {
       auto ret = gatekeeper_->deleteAllUsers(
           [&rsp](const GatekeeperResponse &cb_rsp) { rsp = cb_rsp; });
-      ASSERT_TRUE(ret.getStatus().isOk());
+      ASSERT_TRUE(ret.isOk());
       if (rsp.code != GatekeeperStatusCode::ERROR_RETRY_TIMEOUT) break;
       ALOGI("%s: got retry code; retrying in 1 sec", __func__);
       sleep(1);
diff --git a/boot/Android.mk b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk
similarity index 76%
copy from boot/Android.mk
copy to gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk
index f9e3276..384b33c 100644
--- a/boot/Android.mk
+++ b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalGatekeeperHidlTargetBasicProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/gatekeeper/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..18bb442
--- /dev/null
+++ b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Gatekeeper HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalGatekeeperHidlTargetBasicProfilingTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/gatekeeper_hidl_hal_test/gatekeeper_hidl_hal_test,
+            _64bit::DATA/nativetest64/gatekeeper_hidl_hal_test/gatekeeper_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="5m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index a69d30b..4d7e26e 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -11,6 +11,8 @@
         "IAGnssRil.hal",
         "IAGnssRilCallback.hal",
         "IGnss.hal",
+        "IGnssBatching.hal",
+        "IGnssBatchingCallback.hal",
         "IGnssCallback.hal",
         "IGnssConfiguration.hal",
         "IGnssDebug.hal",
@@ -32,6 +34,8 @@
         "android/hardware/gnss/1.0/AGnssRilAll.cpp",
         "android/hardware/gnss/1.0/AGnssRilCallbackAll.cpp",
         "android/hardware/gnss/1.0/GnssAll.cpp",
+        "android/hardware/gnss/1.0/GnssBatchingAll.cpp",
+        "android/hardware/gnss/1.0/GnssBatchingCallbackAll.cpp",
         "android/hardware/gnss/1.0/GnssCallbackAll.cpp",
         "android/hardware/gnss/1.0/GnssConfigurationAll.cpp",
         "android/hardware/gnss/1.0/GnssDebugAll.cpp",
@@ -59,6 +63,8 @@
         "IAGnssRil.hal",
         "IAGnssRilCallback.hal",
         "IGnss.hal",
+        "IGnssBatching.hal",
+        "IGnssBatchingCallback.hal",
         "IGnssCallback.hal",
         "IGnssConfiguration.hal",
         "IGnssDebug.hal",
@@ -77,93 +83,103 @@
         "android/hardware/gnss/1.0/types.h",
         "android/hardware/gnss/1.0/IAGnss.h",
         "android/hardware/gnss/1.0/IHwAGnss.h",
-        "android/hardware/gnss/1.0/BnAGnss.h",
-        "android/hardware/gnss/1.0/BpAGnss.h",
+        "android/hardware/gnss/1.0/BnHwAGnss.h",
+        "android/hardware/gnss/1.0/BpHwAGnss.h",
         "android/hardware/gnss/1.0/BsAGnss.h",
         "android/hardware/gnss/1.0/IAGnssCallback.h",
         "android/hardware/gnss/1.0/IHwAGnssCallback.h",
-        "android/hardware/gnss/1.0/BnAGnssCallback.h",
-        "android/hardware/gnss/1.0/BpAGnssCallback.h",
+        "android/hardware/gnss/1.0/BnHwAGnssCallback.h",
+        "android/hardware/gnss/1.0/BpHwAGnssCallback.h",
         "android/hardware/gnss/1.0/BsAGnssCallback.h",
         "android/hardware/gnss/1.0/IAGnssRil.h",
         "android/hardware/gnss/1.0/IHwAGnssRil.h",
-        "android/hardware/gnss/1.0/BnAGnssRil.h",
-        "android/hardware/gnss/1.0/BpAGnssRil.h",
+        "android/hardware/gnss/1.0/BnHwAGnssRil.h",
+        "android/hardware/gnss/1.0/BpHwAGnssRil.h",
         "android/hardware/gnss/1.0/BsAGnssRil.h",
         "android/hardware/gnss/1.0/IAGnssRilCallback.h",
         "android/hardware/gnss/1.0/IHwAGnssRilCallback.h",
-        "android/hardware/gnss/1.0/BnAGnssRilCallback.h",
-        "android/hardware/gnss/1.0/BpAGnssRilCallback.h",
+        "android/hardware/gnss/1.0/BnHwAGnssRilCallback.h",
+        "android/hardware/gnss/1.0/BpHwAGnssRilCallback.h",
         "android/hardware/gnss/1.0/BsAGnssRilCallback.h",
         "android/hardware/gnss/1.0/IGnss.h",
         "android/hardware/gnss/1.0/IHwGnss.h",
-        "android/hardware/gnss/1.0/BnGnss.h",
-        "android/hardware/gnss/1.0/BpGnss.h",
+        "android/hardware/gnss/1.0/BnHwGnss.h",
+        "android/hardware/gnss/1.0/BpHwGnss.h",
         "android/hardware/gnss/1.0/BsGnss.h",
+        "android/hardware/gnss/1.0/IGnssBatching.h",
+        "android/hardware/gnss/1.0/IHwGnssBatching.h",
+        "android/hardware/gnss/1.0/BnHwGnssBatching.h",
+        "android/hardware/gnss/1.0/BpHwGnssBatching.h",
+        "android/hardware/gnss/1.0/BsGnssBatching.h",
+        "android/hardware/gnss/1.0/IGnssBatchingCallback.h",
+        "android/hardware/gnss/1.0/IHwGnssBatchingCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssBatchingCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssBatchingCallback.h",
+        "android/hardware/gnss/1.0/BsGnssBatchingCallback.h",
         "android/hardware/gnss/1.0/IGnssCallback.h",
         "android/hardware/gnss/1.0/IHwGnssCallback.h",
-        "android/hardware/gnss/1.0/BnGnssCallback.h",
-        "android/hardware/gnss/1.0/BpGnssCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssCallback.h",
         "android/hardware/gnss/1.0/BsGnssCallback.h",
         "android/hardware/gnss/1.0/IGnssConfiguration.h",
         "android/hardware/gnss/1.0/IHwGnssConfiguration.h",
-        "android/hardware/gnss/1.0/BnGnssConfiguration.h",
-        "android/hardware/gnss/1.0/BpGnssConfiguration.h",
+        "android/hardware/gnss/1.0/BnHwGnssConfiguration.h",
+        "android/hardware/gnss/1.0/BpHwGnssConfiguration.h",
         "android/hardware/gnss/1.0/BsGnssConfiguration.h",
         "android/hardware/gnss/1.0/IGnssDebug.h",
         "android/hardware/gnss/1.0/IHwGnssDebug.h",
-        "android/hardware/gnss/1.0/BnGnssDebug.h",
-        "android/hardware/gnss/1.0/BpGnssDebug.h",
+        "android/hardware/gnss/1.0/BnHwGnssDebug.h",
+        "android/hardware/gnss/1.0/BpHwGnssDebug.h",
         "android/hardware/gnss/1.0/BsGnssDebug.h",
         "android/hardware/gnss/1.0/IGnssGeofenceCallback.h",
         "android/hardware/gnss/1.0/IHwGnssGeofenceCallback.h",
-        "android/hardware/gnss/1.0/BnGnssGeofenceCallback.h",
-        "android/hardware/gnss/1.0/BpGnssGeofenceCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssGeofenceCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssGeofenceCallback.h",
         "android/hardware/gnss/1.0/BsGnssGeofenceCallback.h",
         "android/hardware/gnss/1.0/IGnssGeofencing.h",
         "android/hardware/gnss/1.0/IHwGnssGeofencing.h",
-        "android/hardware/gnss/1.0/BnGnssGeofencing.h",
-        "android/hardware/gnss/1.0/BpGnssGeofencing.h",
+        "android/hardware/gnss/1.0/BnHwGnssGeofencing.h",
+        "android/hardware/gnss/1.0/BpHwGnssGeofencing.h",
         "android/hardware/gnss/1.0/BsGnssGeofencing.h",
         "android/hardware/gnss/1.0/IGnssMeasurement.h",
         "android/hardware/gnss/1.0/IHwGnssMeasurement.h",
-        "android/hardware/gnss/1.0/BnGnssMeasurement.h",
-        "android/hardware/gnss/1.0/BpGnssMeasurement.h",
+        "android/hardware/gnss/1.0/BnHwGnssMeasurement.h",
+        "android/hardware/gnss/1.0/BpHwGnssMeasurement.h",
         "android/hardware/gnss/1.0/BsGnssMeasurement.h",
         "android/hardware/gnss/1.0/IGnssMeasurementCallback.h",
         "android/hardware/gnss/1.0/IHwGnssMeasurementCallback.h",
-        "android/hardware/gnss/1.0/BnGnssMeasurementCallback.h",
-        "android/hardware/gnss/1.0/BpGnssMeasurementCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssMeasurementCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssMeasurementCallback.h",
         "android/hardware/gnss/1.0/BsGnssMeasurementCallback.h",
         "android/hardware/gnss/1.0/IGnssNavigationMessage.h",
         "android/hardware/gnss/1.0/IHwGnssNavigationMessage.h",
-        "android/hardware/gnss/1.0/BnGnssNavigationMessage.h",
-        "android/hardware/gnss/1.0/BpGnssNavigationMessage.h",
+        "android/hardware/gnss/1.0/BnHwGnssNavigationMessage.h",
+        "android/hardware/gnss/1.0/BpHwGnssNavigationMessage.h",
         "android/hardware/gnss/1.0/BsGnssNavigationMessage.h",
         "android/hardware/gnss/1.0/IGnssNavigationMessageCallback.h",
         "android/hardware/gnss/1.0/IHwGnssNavigationMessageCallback.h",
-        "android/hardware/gnss/1.0/BnGnssNavigationMessageCallback.h",
-        "android/hardware/gnss/1.0/BpGnssNavigationMessageCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssNavigationMessageCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssNavigationMessageCallback.h",
         "android/hardware/gnss/1.0/BsGnssNavigationMessageCallback.h",
         "android/hardware/gnss/1.0/IGnssNi.h",
         "android/hardware/gnss/1.0/IHwGnssNi.h",
-        "android/hardware/gnss/1.0/BnGnssNi.h",
-        "android/hardware/gnss/1.0/BpGnssNi.h",
+        "android/hardware/gnss/1.0/BnHwGnssNi.h",
+        "android/hardware/gnss/1.0/BpHwGnssNi.h",
         "android/hardware/gnss/1.0/BsGnssNi.h",
         "android/hardware/gnss/1.0/IGnssNiCallback.h",
         "android/hardware/gnss/1.0/IHwGnssNiCallback.h",
-        "android/hardware/gnss/1.0/BnGnssNiCallback.h",
-        "android/hardware/gnss/1.0/BpGnssNiCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssNiCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssNiCallback.h",
         "android/hardware/gnss/1.0/BsGnssNiCallback.h",
         "android/hardware/gnss/1.0/IGnssXtra.h",
         "android/hardware/gnss/1.0/IHwGnssXtra.h",
-        "android/hardware/gnss/1.0/BnGnssXtra.h",
-        "android/hardware/gnss/1.0/BpGnssXtra.h",
+        "android/hardware/gnss/1.0/BnHwGnssXtra.h",
+        "android/hardware/gnss/1.0/BpHwGnssXtra.h",
         "android/hardware/gnss/1.0/BsGnssXtra.h",
         "android/hardware/gnss/1.0/IGnssXtraCallback.h",
         "android/hardware/gnss/1.0/IHwGnssXtraCallback.h",
-        "android/hardware/gnss/1.0/BnGnssXtraCallback.h",
-        "android/hardware/gnss/1.0/BpGnssXtraCallback.h",
+        "android/hardware/gnss/1.0/BnHwGnssXtraCallback.h",
+        "android/hardware/gnss/1.0/BpHwGnssXtraCallback.h",
         "android/hardware/gnss/1.0/BsGnssXtraCallback.h",
     ],
 }
diff --git a/gnss/1.0/Android.mk b/gnss/1.0/Android.mk
index d2c7fcf..130c14e 100644
--- a/gnss/1.0/Android.mk
+++ b/gnss/1.0/Android.mk
@@ -55,6 +55,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (GnssLocationFlags)
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/GnssLocationFlags.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::types.GnssLocationFlags
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (GnssMax)
 #
 GEN := $(intermediates)/android/hardware/gnss/V1_0/GnssMax.java
@@ -164,6 +183,8 @@
 $(GEN): $(LOCAL_PATH)/IAGnss.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IAGnssRil.hal
 $(GEN): $(LOCAL_PATH)/IAGnssRil.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssCallback.hal
 $(GEN): $(LOCAL_PATH)/IGnssCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssConfiguration.hal
@@ -195,6 +216,48 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build IGnssBatching.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatching.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::IGnssBatching
+
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGnssBatchingCallback.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatchingCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::IGnssBatchingCallback
+
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build IGnssCallback.hal
 #
 GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssCallback.java
@@ -514,6 +577,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (GnssLocationFlags)
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/GnssLocationFlags.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::types.GnssLocationFlags
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (GnssMax)
 #
 GEN := $(intermediates)/android/hardware/gnss/V1_0/GnssMax.java
@@ -623,6 +705,8 @@
 $(GEN): $(LOCAL_PATH)/IAGnss.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IAGnssRil.hal
 $(GEN): $(LOCAL_PATH)/IAGnssRil.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssCallback.hal
 $(GEN): $(LOCAL_PATH)/IGnssCallback.hal
 $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssConfiguration.hal
@@ -654,6 +738,48 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build IGnssBatching.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatching.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::IGnssBatching
+
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGnssBatchingCallback.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatchingCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.gnss@1.0::IGnssBatchingCallback
+
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build IGnssCallback.hal
 #
 GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssCallback.java
diff --git a/gnss/1.0/IAGnssRilCallback.hal b/gnss/1.0/IAGnssRilCallback.hal
index 17122b2..ba29bd0 100644
--- a/gnss/1.0/IAGnssRilCallback.hal
+++ b/gnss/1.0/IAGnssRilCallback.hal
@@ -32,7 +32,7 @@
      *
      * @param setIdflag Specifies the kind of SET ID that is required by the HAL.
      */
-    requestSetIdCb(ID setIdflag);
+    requestSetIdCb(bitfield<ID> setIdflag);
 
     /*
      * The Hal uses this API to request a reference location.
diff --git a/gnss/1.0/IGnss.hal b/gnss/1.0/IGnss.hal
index cc19ef8..24a5371 100644
--- a/gnss/1.0/IGnss.hal
+++ b/gnss/1.0/IGnss.hal
@@ -18,6 +18,7 @@
 
 import IAGnss;
 import IAGnssRil;
+import IGnssBatching;
 import IGnssCallback;
 import IGnssConfiguration;
 import IGnssDebug;
@@ -81,14 +82,19 @@
     setCallback(IGnssCallback callback) generates (bool success);
 
     /*
-     * Starts navigating.
+     * Starts a location output stream using the IGnssCallback
+     * gnssLocationCb(), following the settings from the most recent call to
+     * setPositionMode().
+     *
+     * This output must operate independently of any GNSS location batching
+     * operations, see the IGnssBatching.hal for details.
      *
      * @return success Returns true on success.
      */
     start() generates (bool success);
 
     /*
-     * Stops navigating.
+     * Stops the location output stream.
      *
      * @return success Returns true on success.
      */
@@ -218,4 +224,11 @@
      * @return debugIface Handle to the IGnssDebug interface.
      */
     getExtensionGnssDebug() generates (IGnssDebug debugIface);
+
+    /*
+     * This method returns the IGnssBatching interface.
+     *
+     * @return batchingIface Handle to the IGnssBatching interface.
+     */
+    getExtensionGnssBatching() generates (IGnssBatching batchingIface);
 };
diff --git a/gnss/1.0/IGnssBatching.hal b/gnss/1.0/IGnssBatching.hal
new file mode 100644
index 0000000..4f0695d
--- /dev/null
+++ b/gnss/1.0/IGnssBatching.hal
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@1.0;
+
+import IGnssBatchingCallback;
+
+/*
+ * Extended interface for GNSS Batching support.
+ *
+ * If this interface is supported, this batching request must be able to run in
+ * parallel with, or without, non-batched location requested by the
+ * IGnss start() & stop() - i.e. both requests must be handled independently,
+ * and not interfere with each other.
+ *
+ * For example, if a 1Hz continuous output is underway on the IGnssCallback,
+ * due to an IGnss start() operation,
+ * and then a IGnssBatching start() is called for a location every 10
+ * seconds, the newly added batching request must not disrupt the 1Hz
+ * continuous location output on the IGnssCallback.
+ *
+ * As with GNSS Location outputs, source of location must be GNSS satellite
+ * measurements, optionally using interial and baro sensors to improve
+ * relative motion filtering. No additional absolute positioning information,
+ * such as WiFi derived location, may be mixed with the GNSS information.
+ */
+
+interface IGnssBatching {
+    /*
+     * Enum which holds the bit masks for batching control.
+     */
+    enum Flag : uint8_t {
+        /*
+         * If this flag is set, the hardware implementation
+         * must wake up the application processor when the FIFO is full, and
+         * call IGnssBatchingCallback to return the locations.
+         *
+         * If the flag is not set, the hardware implementation must drop
+         * the oldest data when the FIFO is full.
+         */
+        WAKEUP_ON_FIFO_FULL = 0x01
+    };
+
+    struct Options {
+        /*
+         * Time interval between samples in the location batch, in nano
+         * seconds.
+         */
+        int64_t periodNanos;
+
+        /*
+         * Flags controlling how batching should behave.
+         */
+        bitfield<Flag> flags;
+    };
+
+    /*
+     * Opens the interface and provides the callback routines
+     * to the implementation of this interface.
+     *
+     * @param callback Callback interface for IGnssBatching.
+     *
+     * @return success Returns true on success.
+     */
+    init(IGnssBatchingCallback callback) generates (bool success);
+
+    /*
+     * Return the batch size (in number of GnssLocation objects)
+     * available in this hardware implementation.
+     *
+     * If the available size is variable, for example, based on other operations
+     * consuming memory, this is the minimum size guaranteed to be available
+     * for batching operations.
+     *
+     * This may, for example, be used by the upper layer, to decide on the
+     * batching interval and whether the AP should be woken up or not.
+     *
+     * @return batchSize number of location objects supported per batch
+     */
+    getBatchSize() generates (uint16_t batchSize);
+
+    /*
+     * Start batching locations. This API is primarily used when the AP is
+     * asleep and the device can batch locations in the hardware.
+     *
+     * IGnssBatchingCallback is used to return the locations.
+     *
+     * When the buffer is full and WAKEUP_ON_FIFO_FULL is used,
+     * IGnssBatchingCallback must be called to return the locations.
+     *
+     * When the buffer is full and WAKEUP_ON_FIFO_FULL is not set,
+     * the oldest location object is dropped. In this case the AP must not be
+     * woken up. The AP would then generally be responsible for using
+     * flushBatchedLocation to explicitly ask for the location as needed,
+     * to avoid it being dropped.
+     *
+     * @param options See struct Options definition.
+     *
+     * @return success Returns true on success.
+     */
+    start(Options options) generates (bool success);
+
+    /**
+     * Retrieve all batched locations currently stored.
+     *
+     * IGnssBatchingCallback is used to return the location.
+     *
+     * IGnssBatchingCallback must be called in response, even if there are
+     * no locations to flush (in which case the Location vector must be empty).
+     *
+     * Subsequent calls to flushBatchedLocation
+     * must not return any of the locations returned in this call.
+     */
+    flush();
+
+    /**
+     * Stop batching.
+     *
+     * @return success Returns true on success.
+     */
+    stop() generates (bool success);
+
+    /**
+     * Closes the interface. If any batch operations are in progress,
+     * they should be stopped.
+     *
+     * init() may be called again, after this, if the interface is to be restored
+     */
+    cleanup();
+
+};
diff --git a/gnss/1.0/IGnssBatchingCallback.hal b/gnss/1.0/IGnssBatchingCallback.hal
new file mode 100644
index 0000000..a8f4b88
--- /dev/null
+++ b/gnss/1.0/IGnssBatchingCallback.hal
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@1.0;
+
+/* The callback interface to report measurements from the HAL. */
+interface IGnssBatchingCallback {
+    /*
+     * Called when a batch of locations is output, by various means, including
+     * a flush request, as well as the buffer becoming full (if appropriate option
+     * is set.)
+     *
+     * All locations returned by this callback must be cleared from the hardware
+     * buffer, such the sequential calls of this callback do not return any
+     * redundant locations.  (Same lat/lon, at a new time, is acceptable.)
+     *
+     * @param locations GNSS Location information from HAL.
+     */
+    gnssLocationBatchCb(vec<GnssLocation> locations);
+};
diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal
index 97a28e2..eb66d78 100644
--- a/gnss/1.0/IGnssCallback.hal
+++ b/gnss/1.0/IGnssCallback.hal
@@ -29,21 +29,21 @@
          * If this is not set, then the framework will use 1000ms for
          * minInterval and will call start() and stop() to schedule the GNSS.
          */
-        SCHEDULING     = 1 << 0,
+        SCHEDULING                      = 1 << 0,
         /** GNSS supports MS-Based AGNSS mode */
-        MSB            = 1 << 1,
+        MSB                             = 1 << 1,
         /** GNSS supports MS-Assisted AGNSS mode */
-        MSA            = 1 << 2,
+        MSA                             = 1 << 2,
         /** GNSS supports single-shot fixes */
-        SINGLE_SHOT    = 1 << 3,
+        SINGLE_SHOT                     = 1 << 3,
         /** GNSS supports on demand time injection */
-        ON_DEMAND_TIME = 1 << 4,
+        ON_DEMAND_TIME                  = 1 << 4,
         /** GNSS supports Geofencing  */
-        GEOFENCING     = 1 << 5,
-        /** GNSS supports Measurements. */
-        MEASUREMENTS   = 1 << 6,
+        GEOFENCING                      = 1 << 5,
+        /** GNSS supports Measurements for at least GPS. */
+        MEASUREMENTS                    = 1 << 6,
         /** GNSS supports Navigation Messages */
-        NAV_MESSAGES   = 1 << 7,
+        NAV_MESSAGES                    = 1 << 7
     };
 
     /* GNSS status event values. */
@@ -64,10 +64,11 @@
      * Flags that indicate information about the satellite
      */
     enum GnssSvFlags : uint8_t {
-        NONE                = 0,
-        HAS_EPHEMERIS_DATA  = 1 << 0,
-        HAS_ALMANAC_DATA    = 1 << 1,
-        USED_IN_FIX         = 1 << 2
+        NONE                  = 0,
+        HAS_EPHEMERIS_DATA    = 1 << 0,
+        HAS_ALMANAC_DATA      = 1 << 1,
+        USED_IN_FIX           = 1 << 2,
+        HAS_CARRIER_FREQUENCY = 1 << 3
     };
 
     struct GnssSvInfo {
@@ -109,6 +110,17 @@
         float azimuthDegrees;
 
         /*
+         * Carrier frequency of the signal tracked, for example it can be the
+         * GPS L1 = 1.57542e9 Hz, or L2, L5, varying GLO channels, etc. If
+         * the field is not set, it is the primary common use frequency,
+         * e.g. L1 for GPS.
+         *
+         * If the data is available, gnssClockFlags must contain
+         * HAS_CARRIER_FREQUENCY.
+         */
+        float carrierFrequencyHz;
+
+        /*
          * Contains additional data about the given SV.
          */
         bitfield<GnssSvFlags> svFlag;
@@ -179,7 +191,7 @@
      * @param capabilities Capability parameter is a bit field of
      * the Capabilities enum.
      */
-    gnssSetCapabilitesCb(uint32_t capabilities);
+    gnssSetCapabilitesCb(bitfield<Capabilities> capabilities);
 
     /*
      * Callback utility for acquiring the GNSS wakelock. This can be used to prevent
diff --git a/gnss/1.0/IGnssConfiguration.hal b/gnss/1.0/IGnssConfiguration.hal
index f8856b0..2fb6e4e 100644
--- a/gnss/1.0/IGnssConfiguration.hal
+++ b/gnss/1.0/IGnssConfiguration.hal
@@ -106,7 +106,7 @@
       *
       * @return success True if operation was successful.
       */
-     setSuplMode(uint8_t mode) generates (bool success);
+     setSuplMode(bitfield<SuplMode> mode) generates (bool success);
 
      /*
       * This setting configures how GPS functionalities should be locked when
@@ -117,7 +117,7 @@
       *
       * @return success True if operation was successful.
       */
-     setGpsLock(uint8_t lock) generates (bool success);
+     setGpsLock(bitfield<GpsLock> lock) generates (bool success);
 
      /*
       * This method sets the LTE Positioning Profile configuration.
@@ -127,17 +127,17 @@
       *
       * @return success True if operation was successful.
       */
-     setLppProfile(uint8_t lppProfile) generates (bool success);
+     setLppProfile(bitfield<LppProfile> lppProfile) generates (bool success);
 
      /*
       * This method selects positioning protocol on A-Glonass system.
       *
       * @param protocol Bitmask that specifies the positioning protocol to be
-      * set as per GlonassPositioningProtocol enum.
+      * set as per GlonassPosProtocol enum.
       *
       * @return success True if operation was successful.
       */
-     setGlonassPositioningProtocol(uint8_t protocol) generates (bool success);
+     setGlonassPositioningProtocol(bitfield<GlonassPosProtocol> protocol) generates (bool success);
 
      /*
       * This method configures which PDN to use.
diff --git a/gnss/1.0/IGnssDebug.hal b/gnss/1.0/IGnssDebug.hal
index ff9ea9f..8784d1a 100644
--- a/gnss/1.0/IGnssDebug.hal
+++ b/gnss/1.0/IGnssDebug.hal
@@ -45,11 +45,28 @@
         double longitudeDegrees;
         /* Altitude above ellipsoid expressed in meters */
         float altitudeMeters;
+        /* Represents speed in meters per second. */
+        float speedMetersPerSec;
+        /* Represents heading in degrees. */
+        float bearingDegrees;
         /*
          * estimated horizontal accuracy of position expressed in meters, radial,
          * 68% confidence.
          */
-        double accuracyMeters;
+        double horizontalAccuracyMeters;
+        /*
+         * estimated vertical accuracy of position expressed in meters, with
+         * 68% confidence.
+         */
+        double verticalAccuracyMeters;
+        /*
+         * estimated speed accuracy in meters per second with 68% confidence.
+         */
+        double speedAccuracyMetersPerSecond;
+        /*
+         * estimated bearing accuracy degrees with 68% confidence.
+         */
+        double bearingAccuracyDegrees;
         /*
          * Time duration before this report that this position information was
          * valid.
@@ -103,7 +120,7 @@
         TimeDebug time;
         /*
          * Provides a list of the decoded satellite ephemeris.
-         * Should provide a complete list for all constellations device can track,
+         * Must provide a complete list for all constellations device can track,
          * including GnssConstellationType UNKNOWN.
          */
         vec<SatelliteData> satelliteDataArray;
diff --git a/gnss/1.0/IGnssGeofencing.hal b/gnss/1.0/IGnssGeofencing.hal
index 8417333..b8348b3 100644
--- a/gnss/1.0/IGnssGeofencing.hal
+++ b/gnss/1.0/IGnssGeofencing.hal
@@ -54,9 +54,10 @@
      * must be triggered. This parameter is defined in milliseconds.
      */
     addGeofence(int32_t geofenceId, double latitudeDegrees, double longitudeDegrees,
-        double radiusMeters, GeofenceTransition lastTransition,
-        int32_t monitorTransitions, uint32_t notificationResponsivenessMs,
-        uint32_t unknownTimerMs);
+            double radiusMeters, GeofenceTransition lastTransition,
+            bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions,
+            uint32_t notificationResponsivenessMs,
+            uint32_t unknownTimerMs);
 
     /*
      * Pause monitoring a particular geofence.
@@ -74,7 +75,8 @@
      * UNCERTAIN. This supersedes the value associated
      * provided in the addGeofenceArea call.
      */
-    resumeGeofence(int32_t geofenceId, int32_t monitorTransitions);
+    resumeGeofence(int32_t geofenceId,
+            bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions);
 
     /*
      * Remove a geofence area. After the function returns, no notifications
diff --git a/gnss/1.0/IGnssMeasurementCallback.hal b/gnss/1.0/IGnssMeasurementCallback.hal
index cc34c91..de640ae 100644
--- a/gnss/1.0/IGnssMeasurementCallback.hal
+++ b/gnss/1.0/IGnssMeasurementCallback.hal
@@ -51,7 +51,9 @@
         /** A valid 'carrier phase' is stored in the data structure. */
         HAS_CARRIER_PHASE              = 1 << 11,
         /** A valid 'carrier phase uncertainty' is stored in the data structure. */
-        HAS_CARRIER_PHASE_UNCERTAINTY  = 1 << 12
+        HAS_CARRIER_PHASE_UNCERTAINTY  = 1 << 12,
+        /** A valid automatic gain control is stored in the data structure. */
+        HAS_AUTOMATIC_GAIN_CONTROL     = 1 << 13
     };
 
     /*
@@ -95,7 +97,9 @@
         STATE_GAL_E1BC_CODE_LOCK     = 1 << 10,
         STATE_GAL_E1C_2ND_CODE_LOCK  = 1 << 11,
         STATE_GAL_E1B_PAGE_SYNC      = 1 << 12,
-        STATE_SBAS_SYNC              = 1 << 13
+        STATE_SBAS_SYNC              = 1 << 13,
+        STATE_TOW_KNOWN              = 1 << 14,
+        STATE_GLO_TOD_KNOWN          = 1 << 15,
     };
 
     /*
@@ -116,7 +120,7 @@
          * A set of flags indicating the validity of the fields in this data
          * structure.
          */
-        GnssClockFlags gnssClockFlags;
+        bitfield<GnssClockFlags> gnssClockFlags;
 
         /*
          * Leap second data.
@@ -272,7 +276,7 @@
          * A set of flags indicating the validity of the fields in this data
          * structure.
          */
-        GnssMeasurementFlags flags;
+        bitfield<GnssMeasurementFlags> flags;
 
         /*
          * Satellite vehicle ID number, as defined in GnssSvInfo::svid
@@ -306,7 +310,7 @@
          *
          * This is a mandatory value.
          */
-        GnssMeasurementState state;
+        bitfield<GnssMeasurementState> state;
 
         /*
          * The received GNSS Time-of-Week at the measurement time, in nanoseconds.
@@ -321,6 +325,11 @@
          * Bit sync        : [ 0 20ms  ] : STATE_BIT_SYNC set
          * Subframe sync   : [ 0  6s   ] : STATE_SUBFRAME_SYNC set
          * TOW decoded     : [ 0 1week ] : STATE_TOW_DECODED set
+         * TOW Known       : [ 0 1week ] : STATE_TOW_KNOWN set
+         *
+         * Note: TOW Known refers to the case where TOW is possibly not decoded
+         * over the air but has been determined from other sources. If TOW
+         * decoded is set then TOW Known must also be set.
          *
          * Note: If there is any ambiguity in integer millisecond,
          * GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS must be set accordingly, in the
@@ -333,33 +342,48 @@
          *
          * Given the highest sync state that can be achieved, per each satellite,
          * valid range for this field can be:
-         * Searching       : [ 0       ] : STATE_UNKNOWN set
-         * C/A code lock   : [ 0   1ms ] : STATE_CODE_LOCK set
-         * Symbol sync     : [ 0  10ms ] : STATE_SYMBOL_SYNC set
-         * Bit sync        : [ 0  20ms ] : STATE_BIT_SYNC set
-         * String sync     : [ 0    2s ] : STATE_GLO_STRING_SYNC set
-         * Time of day     : [ 0  1day ] : STATE_GLO_TOW_DECODED set
+         * Searching           : [ 0       ] : STATE_UNKNOWN set
+         * C/A code lock       : [ 0   1ms ] : STATE_CODE_LOCK set
+         * Symbol sync         : [ 0  10ms ] : STATE_SYMBOL_SYNC set
+         * Bit sync            : [ 0  20ms ] : STATE_BIT_SYNC set
+         * String sync         : [ 0    2s ] : STATE_GLO_STRING_SYNC set
+         * Time of day decoded : [ 0  1day ] : STATE_GLO_TOD_DECODED set
+         * Time of day known   : [ 0  1day ] : STATE_GLO_TOD_KNOWN set
+         *
+         * Note: Time of day known refers to the case where it is possibly not
+         * decoded over the air but has been determined from other sources. If
+         * Time of day decoded is set then Time of day known must also be set.
          *
          * For Beidou, this is the received Beidou time of week,
          * at the measurement time in nanoseconds.
          *
          * Given the highest sync state that can be achieved, per each satellite,
          * valid range for this field can be:
-         * Searching    : [ 0       ] : STATE_UNKNOWN set.
-         * C/A code lock: [ 0   1ms ] : STATE_CODE_LOCK set.
-         * Bit sync (D2): [ 0   2ms ] : STATE_BDS_D2_BIT_SYNC set.
-         * Bit sync (D1): [ 0  20ms ] : STATE_BIT_SYNC set.
-         * Subframe (D2): [ 0  0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC set.
-         * Subframe (D1): [ 0    6s ] : STATE_SUBFRAME_SYNC set.
-         * Time of week : [ 0 1week ] : STATE_TOW_DECODED set.
+         * Searching            : [ 0       ] : STATE_UNKNOWN set.
+         * C/A code lock        : [ 0   1ms ] : STATE_CODE_LOCK set.
+         * Bit sync (D2)        : [ 0   2ms ] : STATE_BDS_D2_BIT_SYNC set.
+         * Bit sync (D1)        : [ 0  20ms ] : STATE_BIT_SYNC set.
+         * Subframe (D2)        : [ 0  0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC set.
+         * Subframe (D1)        : [ 0    6s ] : STATE_SUBFRAME_SYNC set.
+         * Time of week decoded : [ 0 1week ] : STATE_TOW_DECODED set.
+         * Time of week known   : [ 0 1week ] : STATE_TOW_KNOWN set
+         *
+         * Note: TOW Known refers to the case where TOW is possibly not decoded
+         * over the air but has been determined from other sources. If TOW
+         * decoded is set then TOW Known must also be set.
          *
          * For Galileo, this is the received Galileo time of week,
          * at the measurement time in nanoseconds.
          *
-         * E1BC code lock   : [ 0  4ms ] : STATE_GAL_E1BC_CODE_LOCK set.
-         * E1C 2nd code lock: [ 0 100ms] : STATE_GAL_E1C_2ND_CODE_LOCK set.
-         * E1B page         : [ 0   2s ] : STATE_GAL_E1B_PAGE_SYNC set.
-         * Time of week     : [ 0 1week] : STATE_TOW_DECODED is set.
+         * E1BC code lock       : [ 0  4ms ] : STATE_GAL_E1BC_CODE_LOCK set.
+         * E1C 2nd code lock    : [ 0 100ms] : STATE_GAL_E1C_2ND_CODE_LOCK set.
+         * E1B page             : [ 0   2s ] : STATE_GAL_E1B_PAGE_SYNC set.
+         * Time of week decoded : [ 0 1week] : STATE_TOW_DECODED is set.
+         * Time of week known   : [ 0 1week] : STATE_TOW_KNOWN set
+         *
+         * Note: TOW Known refers to the case where TOW is possibly not decoded
+         * over the air but has been determined from other sources. If TOW
+         * decoded is set then TOW Known must also be set.
          *
          * For SBAS, this is received SBAS time, at the measurement time in
          * nanoseconds.
@@ -430,7 +454,7 @@
          *
          * This is a mandatory value.
          */
-        GnssAccumulatedDeltaRangeState accumulatedDeltaRangeState;
+        bitfield<GnssAccumulatedDeltaRangeState> accumulatedDeltaRangeState;
 
         /*
          * Accumulated delta range since the last channel reset in meters.
@@ -455,9 +479,10 @@
         double accumulatedDeltaRangeUncertaintyM;
 
         /*
-         * Carrier frequency at which codes and messages are modulated, it can
-         * be L1 or L2. If the field is not set, the carrier frequency is
-         * assumed to be L1.
+         * Carrier frequency of the signal tracked, for example it can be the
+         * GPS L1 = 1.57542e9 Hz, or L2, L5, varying GLO channels, etc. If the
+         * field is not set, it is the primary common use frequency,
+         * e.g. L1 for GPS.
          *
          * If the data is available, gnssClockFlags must contain
          * HAS_CARRIER_FREQUENCY.
@@ -524,6 +549,24 @@
          * observed noise floor" to "the noise RMS".
          */
         double snrDb;
+
+        /*
+         * Automatic gain control (AGC) level. AGC acts as a variable gain
+         * amplifier adjusting the power of the incoming signal to minimize the
+         * quantization losses. The AGC level may be used to indicate potential
+         * interference. When AGC is at a nominal level, this value
+         * must be set as 0. Higher gain (and/or lower input power) must be
+         * output as a positive number. Hence in cases of strong jamming, in the
+         * band of this signal, this value must go more negative.
+         *
+         * Note: Different hardware designs (e.g. antenna, pre-amplification, or
+         * other RF HW components) may also affect the typical output of of this
+         * value on any given hardware design in an open sky test - the
+         * important aspect of this output is that changes in this value are
+         * indicative of changes on input signal power in the frequency band for
+         * this measurement.
+         */
+        double agcLevelDb;
     };
 
     /*
diff --git a/gnss/1.0/IGnssNavigationMessageCallback.hal b/gnss/1.0/IGnssNavigationMessageCallback.hal
index 6988c9a..0cffa67 100644
--- a/gnss/1.0/IGnssNavigationMessageCallback.hal
+++ b/gnss/1.0/IGnssNavigationMessageCallback.hal
@@ -80,7 +80,7 @@
          * No need to send any navigation message that contains words with parity
          * error and cannot be corrected.
          */
-        NavigationMessageStatus status;
+        bitfield<NavigationMessageStatus> status;
 
         /*
          * Message identifier. It provides an index so the complete Navigation
diff --git a/gnss/1.0/IGnssNiCallback.hal b/gnss/1.0/IGnssNiCallback.hal
index f23b354..a7abad9 100644
--- a/gnss/1.0/IGnssNiCallback.hal
+++ b/gnss/1.0/IGnssNiCallback.hal
@@ -78,7 +78,7 @@
          * Notification/verification options, combinations of GnssNiNotifyFlags
          * constants.
          */
-        GnssNiNotifyFlags notifyFlags;
+        bitfield<GnssNiNotifyFlags> notifyFlags;
 
         /*
          * Timeout period to wait for user response.
diff --git a/gnss/1.0/default/AGnssRil.cpp b/gnss/1.0/default/AGnssRil.cpp
index 87abad7..480571d 100644
--- a/gnss/1.0/default/AGnssRil.cpp
+++ b/gnss/1.0/default/AGnssRil.cpp
@@ -50,7 +50,7 @@
         return;
     }
 
-    sAGnssRilCbIface->requestSetIdCb(static_cast<IAGnssRilCallback::ID>(flags));
+    sAGnssRilCbIface->requestSetIdCb(flags);
 }
 
 void AGnssRil::requestRefLoc(uint32_t /*flags*/) {
diff --git a/gnss/1.0/default/Android.mk b/gnss/1.0/default/Android.mk
index 6289491..a6f73f2 100644
--- a/gnss/1.0/default/Android.mk
+++ b/gnss/1.0/default/Android.mk
@@ -8,6 +8,7 @@
     AGnss.cpp \
     AGnssRil.cpp \
     Gnss.cpp \
+    GnssBatching.cpp \
     GnssDebug.cpp \
     GnssGeofencing.cpp \
     GnssMeasurement.cpp \
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 66be37e..19e22c2 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -121,7 +121,10 @@
             .cN0Dbhz = svInfo.c_n0_dbhz,
             .elevationDegrees = svInfo.elevation,
             .azimuthDegrees = svInfo.azimuth,
-            .svFlag = svInfo.flags
+            .svFlag = svInfo.flags,
+            // Older chipsets do not provide carrier frequency, hence HAS_CARRIER_FREQUENCY flag
+            // is not set and the carrierFrequencyHz field is set to zero
+            .carrierFrequencyHz = 0
         };
         svStatus.gnssSvList[i] = gnssSvInfo;
     }
@@ -385,7 +388,7 @@
                                           preferredTimeMs) == 0);
 }
 
-Return<void> Gnss::getExtensionAGnssRil(getExtensionAGnssRil_cb _hidl_cb)  {
+Return<sp<IAGnssRil>> Gnss::getExtensionAGnssRil()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -397,11 +400,10 @@
             mGnssRil = new AGnssRil(agpsRilIface);
         }
     }
-    _hidl_cb(mGnssRil);
-    return Void();
+    return mGnssRil;
 }
 
-Return<void> Gnss::getExtensionGnssConfiguration(getExtensionGnssConfiguration_cb _hidl_cb)  {
+Return<sp<IGnssConfiguration>> Gnss::getExtensionGnssConfiguration()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -415,10 +417,9 @@
             mGnssConfig = new GnssConfiguration(gnssConfigIface);
         }
     }
-    _hidl_cb(mGnssConfig);
-    return Void();
+    return mGnssConfig;
 }
-Return<void> Gnss::getExtensionGnssGeofencing(getExtensionGnssGeofencing_cb _hidl_cb)  {
+Return<sp<IGnssGeofencing>> Gnss::getExtensionGnssGeofencing()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -433,11 +434,10 @@
         }
     }
 
-    _hidl_cb(mGnssGeofencingIface);
-    return Void();
+    return mGnssGeofencingIface;
 }
 
-Return<void> Gnss::getExtensionAGnss(getExtensionAGnss_cb _hidl_cb)  {
+Return<sp<IAGnss>> Gnss::getExtensionAGnss()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -449,11 +449,10 @@
             mAGnssIface = new AGnss(agpsIface);
         }
     }
-    _hidl_cb(mAGnssIface);
-    return Void();
+    return mAGnssIface;
 }
 
-Return<void> Gnss::getExtensionGnssNi(getExtensionGnssNi_cb _hidl_cb)  {
+Return<sp<IGnssNi>> Gnss::getExtensionGnssNi()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -465,11 +464,10 @@
             mGnssNi = new GnssNi(gpsNiIface);
         }
     }
-    _hidl_cb(mGnssNi);
-    return Void();
+    return mGnssNi;
 }
 
-Return<void> Gnss::getExtensionGnssMeasurement(getExtensionGnssMeasurement_cb _hidl_cb) {
+Return<sp<IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -483,12 +481,10 @@
             mGnssMeasurement = new GnssMeasurement(gpsMeasurementIface);
         }
     }
-    _hidl_cb(mGnssMeasurement);
-    return Void();
+    return mGnssMeasurement;
 }
 
-Return<void> Gnss::getExtensionGnssNavigationMessage(
-        getExtensionGnssNavigationMessage_cb _hidl_cb) {
+Return<sp<IGnssNavigationMessage>> Gnss::getExtensionGnssNavigationMessage() {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -504,11 +500,10 @@
         }
     }
 
-    _hidl_cb(mGnssNavigationMessage);
-    return Void();
+    return mGnssNavigationMessage;
 }
 
-Return<void> Gnss::getExtensionXtra(getExtensionXtra_cb _hidl_cb)  {
+Return<sp<IGnssXtra>> Gnss::getExtensionXtra()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -522,11 +517,10 @@
         }
     }
 
-    _hidl_cb(mGnssXtraIface);
-    return Void();
+    return mGnssXtraIface;
 }
 
-Return<void> Gnss::getExtensionGnssDebug(getExtensionGnssDebug_cb _hidl_cb)  {
+Return<sp<IGnssDebug>> Gnss::getExtensionGnssDebug()  {
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
@@ -540,8 +534,24 @@
         }
     }
 
-    _hidl_cb(mGnssDebug);
-    return Void();
+    return mGnssDebug;
+}
+
+Return<sp<IGnssBatching>> Gnss::getExtensionGnssBatching()  {
+    if (mGnssIface == nullptr) {
+        ALOGE("%s: Gnss interface is unavailable", __func__);
+    } else {
+        // TODO(b/34133439): actually get an flpLocationIface
+        const FlpLocationInterface* flpLocationIface = nullptr;
+
+        if (flpLocationIface == nullptr) {
+            ALOGE("%s: GnssBatching interface is not implemented by HAL", __func__);
+        } else {
+            mGnssBatching = new GnssBatching(flpLocationIface);
+        }
+    }
+
+    return mGnssBatching;
 }
 
 IGnss* HIDL_FETCH_IGnss(const char* hal) {
diff --git a/gnss/1.0/default/Gnss.h b/gnss/1.0/default/Gnss.h
index a2c8676..36947c1 100644
--- a/gnss/1.0/default/Gnss.h
+++ b/gnss/1.0/default/Gnss.h
@@ -19,6 +19,7 @@
 
 #include <AGnss.h>
 #include <AGnssRil.h>
+#include <GnssBatching.h>
 #include <GnssConfiguration.h>
 #include <GnssDebug.h>
 #include <GnssGeofencing.h>
@@ -29,6 +30,7 @@
 
 #include <ThreadCreationWrapper.h>
 #include <android/hardware/gnss/1.0/IGnss.h>
+#include <hardware/fused_location.h>
 #include <hardware/gps.h>
 #include <hidl/Status.h>
 
@@ -51,6 +53,7 @@
  * IGnssCallback interface to be passed into the conventional implementation of the GNSS HAL.
  */
 struct Gnss : public IGnss {
+    // TODO: Add flp_device_t, either in ctor, or later attach?
     Gnss(gps_device_t* gnss_device);
     ~Gnss();
 
@@ -74,16 +77,16 @@
                                  uint32_t minIntervalMs,
                                  uint32_t preferredAccuracyMeters,
                                  uint32_t preferredTimeMs)  override;
-    Return<void> getExtensionAGnssRil(getExtensionAGnssRil_cb _hidl_cb) override;
-    Return<void> getExtensionGnssGeofencing(getExtensionGnssGeofencing_cb _hidl_cb)  override;
-    Return<void> getExtensionAGnss(getExtensionAGnss_cb _hidl_cb)  override;
-    Return<void> getExtensionGnssNi(getExtensionGnssNi_cb _hidl_cb)  override;
-    Return<void> getExtensionGnssMeasurement(getExtensionGnssMeasurement_cb _hidl_cb)  override;
-    Return<void> getExtensionGnssNavigationMessage(
-        getExtensionGnssNavigationMessage_cb _hidl_cb)  override;
-    Return<void> getExtensionXtra(getExtensionXtra_cb _hidl_cb)  override;
-    Return<void> getExtensionGnssDebug(getExtensionGnssDebug_cb _hidl_cb)  override;
-    Return<void> getExtensionGnssConfiguration(getExtensionGnssConfiguration_cb _hidl_cb) override;
+    Return<sp<IAGnssRil>> getExtensionAGnssRil() override;
+    Return<sp<IGnssGeofencing>> getExtensionGnssGeofencing() override;
+    Return<sp<IAGnss>> getExtensionAGnss() override;
+    Return<sp<IGnssNi>> getExtensionGnssNi() override;
+    Return<sp<IGnssMeasurement>> getExtensionGnssMeasurement() override;
+    Return<sp<IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override;
+    Return<sp<IGnssXtra>> getExtensionXtra() override;
+    Return<sp<IGnssConfiguration>> getExtensionGnssConfiguration() override;
+    Return<sp<IGnssDebug>> getExtensionGnssDebug() override;
+    Return<sp<IGnssBatching>> getExtensionGnssBatching() override;
 
     /*
      * Callback methods to be passed into the conventional GNSS HAL by the default
@@ -120,6 +123,7 @@
     sp<GnssNavigationMessage> mGnssNavigationMessage = nullptr;
     sp<GnssDebug> mGnssDebug = nullptr;
     sp<GnssConfiguration> mGnssConfig = nullptr;
+    sp<GnssBatching> mGnssBatching = nullptr;
     const GpsInterface* mGnssIface = nullptr;
     static sp<IGnssCallback> sGnssCbIface;
     static std::vector<std::unique_ptr<ThreadFuncArgs>> sThreadFuncArgsList;
diff --git a/gnss/1.0/default/GnssBatching.cpp b/gnss/1.0/default/GnssBatching.cpp
new file mode 100644
index 0000000..404b5da
--- /dev/null
+++ b/gnss/1.0/default/GnssBatching.cpp
@@ -0,0 +1,48 @@
+#include "GnssBatching.h"
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V1_0 {
+namespace implementation {
+
+GnssBatching::GnssBatching(const FlpLocationInterface* flpLocationIface) :
+    mFlpLocationIface(flpLocationIface) {}
+
+
+// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
+Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
+    // TODO(b/34133439) implement
+    return false;
+}
+
+Return<uint16_t> GnssBatching::getBatchSize() {
+    // TODO(b/34133439) implement
+    return 0;
+}
+
+Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
+    // TODO(b/34133439) implement
+    return false;
+}
+
+Return<void> GnssBatching::flush() {
+    // TODO(b/34133439) implement
+    return Void();
+}
+
+Return<bool> GnssBatching::stop() {
+    // TODO(b/34133439) implement
+    return false;
+}
+
+Return<void> GnssBatching::cleanup() {
+    // TODO(b/34133439) implement
+    return Void();
+}
+
+}  // namespace implementation
+}  // namespace V1_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
diff --git a/gnss/1.0/default/GnssBatching.h b/gnss/1.0/default/GnssBatching.h
new file mode 100644
index 0000000..ac3aa99
--- /dev/null
+++ b/gnss/1.0/default/GnssBatching.h
@@ -0,0 +1,50 @@
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
+
+#include <android/hardware/gnss/1.0/IGnssBatching.h>
+#include <hardware/fused_location.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::gnss::V1_0::IGnssBatching;
+using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
+using ::android::hidl::base::V1_0::IBase;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+struct GnssBatching : public IGnssBatching {
+    GnssBatching(const FlpLocationInterface* flpLocationIface);
+
+    // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
+    Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
+    Return<uint16_t> getBatchSize() override;
+    Return<bool> start(const IGnssBatching::Options& options ) override;
+    Return<void> flush() override;
+    Return<bool> stop() override;
+    Return<void> cleanup() override;
+
+ private:
+    const FlpLocationInterface* mFlpLocationIface = nullptr;
+};
+
+extern "C" IGnssBatching* HIDL_FETCH_IGnssBatching(const char* name);
+
+}  // namespace implementation
+}  // namespace V1_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
diff --git a/gnss/1.0/default/GnssConfiguration.cpp b/gnss/1.0/default/GnssConfiguration.cpp
index 0442c83..0c1aa86 100644
--- a/gnss/1.0/default/GnssConfiguration.cpp
+++ b/gnss/1.0/default/GnssConfiguration.cpp
@@ -15,7 +15,8 @@
  */
 
 #define LOG_TAG "GnssHAL_GnssConfigurationInterface"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "GnssConfiguration.h"
 
diff --git a/gnss/1.0/default/GnssDebug.cpp b/gnss/1.0/default/GnssDebug.cpp
index d61f91d..cfc38ca 100644
--- a/gnss/1.0/default/GnssDebug.cpp
+++ b/gnss/1.0/default/GnssDebug.cpp
@@ -15,7 +15,8 @@
  */
 
 #define LOG_TAG "GnssHAL_GnssDebugInterface"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "GnssDebug.h"
 
diff --git a/gnss/1.0/default/GnssMeasurement.cpp b/gnss/1.0/default/GnssMeasurement.cpp
index 9f8d7b5..67f6d8d 100644
--- a/gnss/1.0/default/GnssMeasurement.cpp
+++ b/gnss/1.0/default/GnssMeasurement.cpp
@@ -51,19 +51,25 @@
 
     for (size_t i = 0; i < gnssData.measurementCount; i++) {
         auto entry = legacyGnssData->measurements[i];
+        auto state = static_cast<GnssMeasurementState>(entry.state);
+        if (state & IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED) {
+          state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_KNOWN;
+        }
+        if (state & IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED) {
+          state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_KNOWN;
+        }
         gnssData.measurements[i] = {
-            .flags = static_cast<IGnssMeasurementCallback::GnssMeasurementFlags>(entry.flags),
+            .flags = entry.flags,
             .svid = entry.svid,
             .constellation = static_cast<GnssConstellationType>(entry.constellation),
             .timeOffsetNs = entry.time_offset_ns,
-            .state = static_cast<IGnssMeasurementCallback::GnssMeasurementState>(entry.state),
+            .state = state,
             .receivedSvTimeInNs = entry.received_sv_time_in_ns,
             .receivedSvTimeUncertaintyInNs = entry.received_sv_time_uncertainty_in_ns,
             .cN0DbHz = entry.c_n0_dbhz,
             .pseudorangeRateMps = entry.pseudorange_rate_mps,
             .pseudorangeRateUncertaintyMps = entry.pseudorange_rate_uncertainty_mps,
-            .accumulatedDeltaRangeState = static_cast<IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>(
-                    entry.accumulated_delta_range_state),
+            .accumulatedDeltaRangeState = entry.accumulated_delta_range_state,
             .accumulatedDeltaRangeM = entry.accumulated_delta_range_m,
             .accumulatedDeltaRangeUncertaintyM = entry.accumulated_delta_range_uncertainty_m,
             .carrierFrequencyHz = entry.carrier_frequency_hz,
@@ -78,7 +84,7 @@
 
     auto clockVal = legacyGnssData->clock;
     gnssData.clock = {
-        .gnssClockFlags = static_cast<IGnssMeasurementCallback::GnssClockFlags>(clockVal.flags),
+        .gnssClockFlags = clockVal.flags,
         .leapSecond = clockVal.leap_second,
         .timeNs = clockVal.time_ns,
         .timeUncertaintyNs = clockVal.time_uncertainty_ns,
@@ -117,9 +123,7 @@
 
     for (size_t i = 0; i < gnssData.measurementCount; i++) {
         auto entry = gpsData->measurements[i];
-        gnssData.measurements[i].flags =
-                static_cast<IGnssMeasurementCallback::GnssMeasurementFlags>(
-                        entry.flags);
+        gnssData.measurements[i].flags = entry.flags;
         gnssData.measurements[i].svid = static_cast<int32_t>(entry.prn);
         if (entry.prn >= 1 && entry.prn <= 32) {
             gnssData.measurements[i].constellation = GnssConstellationType::GPS;
@@ -129,9 +133,7 @@
         }
 
         gnssData.measurements[i].timeOffsetNs = entry.time_offset_ns;
-        gnssData.measurements[i].state =
-            static_cast<IGnssMeasurementCallback::GnssMeasurementState>(
-                entry.state);
+        gnssData.measurements[i].state = entry.state;
         gnssData.measurements[i].receivedSvTimeInNs = entry.received_gps_tow_ns;
         gnssData.measurements[i].receivedSvTimeUncertaintyInNs =
             entry.received_gps_tow_uncertainty_ns;
@@ -140,8 +142,7 @@
         gnssData.measurements[i].pseudorangeRateUncertaintyMps =
                 entry.pseudorange_rate_uncertainty_mps;
         gnssData.measurements[i].accumulatedDeltaRangeState =
-                static_cast<IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>(
-                entry.accumulated_delta_range_state);
+                entry.accumulated_delta_range_state;
         gnssData.measurements[i].accumulatedDeltaRangeM =
                 entry.accumulated_delta_range_m;
         gnssData.measurements[i].accumulatedDeltaRangeUncertaintyM =
@@ -220,8 +221,7 @@
     gnssData.clock.biasUncertaintyNs = clockVal.bias_uncertainty_ns;
     gnssData.clock.driftNsps = clockVal.drift_nsps;
     gnssData.clock.driftUncertaintyNsps = clockVal.drift_uncertainty_nsps;
-    gnssData.clock.gnssClockFlags =
-      static_cast<IGnssMeasurementCallback::GnssClockFlags>(clockVal.flags);
+    gnssData.clock.gnssClockFlags = clockVal.flags;
 
     sGnssMeasureCbIface->GnssMeasurementCb(gnssData);
 }
diff --git a/gnss/1.0/default/GnssNavigationMessage.cpp b/gnss/1.0/default/GnssNavigationMessage.cpp
index f2c69a7..c98abf6 100644
--- a/gnss/1.0/default/GnssNavigationMessage.cpp
+++ b/gnss/1.0/default/GnssNavigationMessage.cpp
@@ -15,7 +15,8 @@
  */
 
 #define LOG_TAG "GnssHAL_GnssNavigationMessageInterface"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "GnssNavigationMessage.h"
 
@@ -53,8 +54,7 @@
     navigationMsg.svid = message->svid;
     navigationMsg.type =
             static_cast<IGnssNavigationMessageCallback::GnssNavigationMessageType>(message->type);
-    navigationMsg.status =
-            static_cast<IGnssNavigationMessageCallback::NavigationMessageStatus>(message->status);
+    navigationMsg.status = message->status;
     navigationMsg.messageId = message->message_id;
     navigationMsg.submessageId = message->submessage_id;
     navigationMsg.data.setToExternal(message->data, message->data_length);
diff --git a/gnss/1.0/default/GnssNi.cpp b/gnss/1.0/default/GnssNi.cpp
index 10af1f4..ec57e8c 100644
--- a/gnss/1.0/default/GnssNi.cpp
+++ b/gnss/1.0/default/GnssNi.cpp
@@ -61,8 +61,7 @@
     IGnssNiCallback::GnssNiNotification notificationGnss = {
         .notificationId =  notification->notification_id,
         .niType = static_cast<IGnssNiCallback::GnssNiType>(notification->ni_type),
-        .notifyFlags =
-                static_cast<IGnssNiCallback::GnssNiNotifyFlags>(notification->notify_flags),
+        .notifyFlags = notification->notify_flags,
         .timeoutSec = static_cast<uint32_t>(notification->timeout),
         .defaultResponse =
                 static_cast<IGnssNiCallback::GnssUserResponseType>(notification->default_response),
diff --git a/gnss/1.0/default/GnssUtils.cpp b/gnss/1.0/default/GnssUtils.cpp
index 9f7e356..82a516b 100644
--- a/gnss/1.0/default/GnssUtils.cpp
+++ b/gnss/1.0/default/GnssUtils.cpp
@@ -28,13 +28,22 @@
     GnssLocation gnssLocation = {};
     if (location != nullptr) {
         gnssLocation = {
-            .gnssLocationFlags = location->flags,
+            // Bit operation AND with 1f below is needed to clear vertical accuracy,
+            // speed accuracy and bearing accuracy flags as some vendors are found
+            // to be setting these bits in pre-Android-O devices
+            .gnssLocationFlags = static_cast<uint16_t>(location->flags & 0x1f),
             .latitudeDegrees = location->latitude,
             .longitudeDegrees = location->longitude,
             .altitudeMeters = location->altitude,
             .speedMetersPerSec = location->speed,
             .bearingDegrees = location->bearing,
-            .accuracyMeters = location->accuracy,
+            .horizontalAccuracyMeters = location->accuracy,
+            // Older chipsets do not provide the following 3 fields, hence the flags
+            // HAS_VERTICAL_ACCURACY, HAS_SPEED_ACCURACY and HAS_BEARING_ACCURACY are
+            // not set and the field are set to zeros.
+            .verticalAccuracyMeters = 0,
+            .speedAccuracyMetersPerSecond = 0,
+            .bearingAccuracyDegrees = 0,
             .timestamp = location->timestamp
         };
     }
diff --git a/gnss/1.0/types.hal b/gnss/1.0/types.hal
index ee35ca4..2721d44 100644
--- a/gnss/1.0/types.hal
+++ b/gnss/1.0/types.hal
@@ -37,10 +37,30 @@
     GALILEO = 6,
 };
 
+/** Bit mask to indicate which values are valid in a GnssLocation object. */
+enum GnssLocationFlags : uint16_t {
+    /** GnssLocation has valid latitude and longitude. */
+    HAS_LAT_LONG              = 0x0001,
+    /** GnssLocation has valid altitude. */
+    HAS_ALTITUDE              = 0x0002,
+    /** GnssLocation has valid speed. */
+    HAS_SPEED                 = 0x0004,
+    /** GnssLocation has valid bearing. */
+    HAS_BEARING               = 0x0008,
+    /** GpsLocation has valid horizontal accuracy. */
+    HAS_HORIZONTAL_ACCURACY   = 0x0010,
+    /** GpsLocation has valid vertical accuracy. */
+    HAS_VERTICAL_ACCURACY     = 0x0020,
+    /** GpsLocation has valid speed accuracy. */
+    HAS_SPEED_ACCURACY        = 0x0040,
+    /** GpsLocation has valid bearing accuracy. */
+    HAS_BEARING_ACCURACY      = 0x0080
+};
+
 /* Represents a location. */
 struct GnssLocation {
     /* Contains GnssLocationFlags bits. */
-    uint16_t gnssLocationFlags;
+    bitfield<GnssLocationFlags> gnssLocationFlags;
 
     /* Represents latitude in degrees. */
     double latitudeDegrees;
@@ -59,10 +79,30 @@
     /* Represents heading in degrees. */
     float bearingDegrees;
 
-    /* Represents expected accuracy in meters. */
-    float accuracyMeters;
+    /*
+    * Represents expected horizontal position accuracy, radial, in meters
+    * (68% confidence).
+    */
+    float horizontalAccuracyMeters;
+
+    /*
+    * Represents expected vertical position accuracy in meters
+    * (68% confidence).
+    */
+    float verticalAccuracyMeters;
+
+    /*
+    * Represents expected speed accuracy in meter per seconds
+    * (68% confidence).
+    */
+    float speedAccuracyMetersPerSecond;
+
+    /*
+    * Represents expected bearing accuracy in degrees
+    * (68% confidence).
+    */
+    float bearingAccuracyDegrees;
 
     /* Timestamp for the location fix. */
     GnssUtcTime timestamp;
-
 };
diff --git a/graphics/Android.bp b/graphics/Android.bp
index 796ef41..6d55dd1 100644
--- a/graphics/Android.bp
+++ b/graphics/Android.bp
@@ -8,4 +8,5 @@
     "composer/2.1/default",
     "mapper/2.0",
     "mapper/2.0/default",
+    "mapper/2.0/vts/functional",
 ]
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index bc1ccc1..48db3e9 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/graphics/allocator/2.0/types.h",
         "android/hardware/graphics/allocator/2.0/IAllocator.h",
         "android/hardware/graphics/allocator/2.0/IHwAllocator.h",
-        "android/hardware/graphics/allocator/2.0/BnAllocator.h",
-        "android/hardware/graphics/allocator/2.0/BpAllocator.h",
+        "android/hardware/graphics/allocator/2.0/BnHwAllocator.h",
+        "android/hardware/graphics/allocator/2.0/BpHwAllocator.h",
         "android/hardware/graphics/allocator/2.0/BsAllocator.h",
         "android/hardware/graphics/allocator/2.0/IAllocatorClient.h",
         "android/hardware/graphics/allocator/2.0/IHwAllocatorClient.h",
-        "android/hardware/graphics/allocator/2.0/BnAllocatorClient.h",
-        "android/hardware/graphics/allocator/2.0/BpAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/BnHwAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/BpHwAllocatorClient.h",
         "android/hardware/graphics/allocator/2.0/BsAllocatorClient.h",
     ],
 }
@@ -64,3 +64,159 @@
         "android.hidl.base@1.0",
     ],
 }
+
+genrule {
+    name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "types.hal",
+        "IAllocator.hal",
+        "IAllocatorClient.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+        "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
+        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "types.hal",
+        "IAllocator.hal",
+        "IAllocatorClient.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/types.vts.h",
+        "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
+        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.graphics.allocator.vts.driver@2.0",
+    generated_sources: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++"],
+    generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "libvts_common",
+        "libvts_datatype",
+        "libvts_measurement",
+        "libvts_multidevice_proto",
+        "libcamera_metadata",
+        "libprotobuf-cpp-full",
+        "android.hardware.graphics.common@1.0",
+        "android.hidl.base@1.0",
+        "android.hardware.graphics.allocator@2.0",
+    ],
+    export_shared_lib_headers: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hardware.graphics.common@1.0",
+        "android.hidl.base@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "IAllocator.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
+        "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "IAllocator.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
+        "android/hardware/graphics/allocator/2.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler",
+    generated_sources: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.graphics.common@1.0",
+        "android.hidl.base@1.0",
+        "android.hardware.graphics.allocator@2.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "IAllocatorClient.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
+        "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+    srcs: [
+        "IAllocatorClient.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
+        "android/hardware/graphics/allocator/2.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler",
+    generated_sources: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.graphics.common@1.0",
+        "android.hidl.base@1.0",
+        "android.hardware.graphics.allocator@2.0",
+    ],
+}
diff --git a/audio/Android.mk b/graphics/allocator/2.0/Android.mk
similarity index 100%
rename from audio/Android.mk
rename to graphics/allocator/2.0/Android.mk
diff --git a/graphics/allocator/2.0/default/Android.bp b/graphics/allocator/2.0/default/Android.bp
index 994feb3..f0c736c 100644
--- a/graphics/allocator/2.0/default/Android.bp
+++ b/graphics/allocator/2.0/default/Android.bp
@@ -34,7 +34,7 @@
 
 cc_library_static {
     name: "libgralloc1-adapter",
-    srcs: ["gralloc1-adapter.c"],
+    srcs: ["gralloc1-adapter.cpp", "Gralloc1On0Adapter.cpp"],
     include_dirs: ["system/core/libsync/include"],
     cflags: ["-Wall", "-Wextra", "-Wno-unused-parameter"],
     export_include_dirs: ["."],
diff --git a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
new file mode 100644
index 0000000..4b9c9e1
--- /dev/null
+++ b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
@@ -0,0 +1,560 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#undef LOG_TAG
+#define LOG_TAG "Gralloc1On0Adapter"
+//#define LOG_NDEBUG 0
+
+#include "Gralloc1On0Adapter.h"
+#include "gralloc1-adapter.h"
+
+#include <hardware/gralloc.h>
+
+#include <utils/Log.h>
+#include <sync/sync.h>
+
+#include <inttypes.h>
+
+template <typename PFN, typename T>
+static gralloc1_function_pointer_t asFP(T function)
+{
+    static_assert(std::is_same<PFN, T>::value, "Incompatible function pointer");
+    return reinterpret_cast<gralloc1_function_pointer_t>(function);
+}
+
+namespace android {
+namespace hardware {
+
+Gralloc1On0Adapter::Gralloc1On0Adapter(const hw_module_t* module)
+  : gralloc1_device_t(),
+    mModule(reinterpret_cast<const gralloc_module_t*>(module)),
+    mDevice(nullptr)
+{
+    ALOGV("Constructing");
+
+    int minor = 0;
+    mModule->perform(mModule,
+            GRALLOC1_ADAPTER_PERFORM_GET_REAL_MODULE_API_VERSION_MINOR,
+            &minor);
+    mMinorVersion = minor;
+
+    common.tag = HARDWARE_DEVICE_TAG,
+    common.version = HARDWARE_DEVICE_API_VERSION(0, 0),
+    common.module = const_cast<struct hw_module_t*>(module),
+    common.close = closeHook,
+
+    getCapabilities = getCapabilitiesHook;
+    getFunction = getFunctionHook;
+    int error = ::gralloc_open(&(mModule->common), &mDevice);
+    if (error) {
+        ALOGE("Failed to open gralloc0 module: %d", error);
+    }
+    ALOGV("Opened gralloc0 device %p", mDevice);
+}
+
+Gralloc1On0Adapter::~Gralloc1On0Adapter()
+{
+    ALOGV("Destructing");
+    if (mDevice) {
+        ALOGV("Closing gralloc0 device %p", mDevice);
+        ::gralloc_close(mDevice);
+    }
+}
+
+void Gralloc1On0Adapter::doGetCapabilities(uint32_t* outCount,
+        int32_t* outCapabilities)
+{
+    *outCount = 0;
+}
+
+gralloc1_function_pointer_t Gralloc1On0Adapter::doGetFunction(
+        int32_t intDescriptor)
+{
+    constexpr auto lastDescriptor =
+            static_cast<int32_t>(GRALLOC1_LAST_FUNCTION);
+    if (intDescriptor < 0 || intDescriptor > lastDescriptor) {
+        ALOGE("Invalid function descriptor");
+        return nullptr;
+    }
+
+    auto descriptor =
+            static_cast<gralloc1_function_descriptor_t>(intDescriptor);
+    switch (descriptor) {
+        case GRALLOC1_FUNCTION_DUMP:
+            return asFP<GRALLOC1_PFN_DUMP>(dumpHook);
+        case GRALLOC1_FUNCTION_CREATE_DESCRIPTOR:
+            return asFP<GRALLOC1_PFN_CREATE_DESCRIPTOR>(createDescriptorHook);
+        case GRALLOC1_FUNCTION_DESTROY_DESCRIPTOR:
+            return asFP<GRALLOC1_PFN_DESTROY_DESCRIPTOR>(destroyDescriptorHook);
+        case GRALLOC1_FUNCTION_SET_CONSUMER_USAGE:
+            return asFP<GRALLOC1_PFN_SET_CONSUMER_USAGE>(setConsumerUsageHook);
+        case GRALLOC1_FUNCTION_SET_DIMENSIONS:
+            return asFP<GRALLOC1_PFN_SET_DIMENSIONS>(setDimensionsHook);
+        case GRALLOC1_FUNCTION_SET_FORMAT:
+            return asFP<GRALLOC1_PFN_SET_FORMAT>(setFormatHook);
+        case GRALLOC1_FUNCTION_SET_LAYER_COUNT:
+            return asFP<GRALLOC1_PFN_SET_LAYER_COUNT>(setLayerCountHook);
+        case GRALLOC1_FUNCTION_SET_PRODUCER_USAGE:
+            return asFP<GRALLOC1_PFN_SET_PRODUCER_USAGE>(setProducerUsageHook);
+        case GRALLOC1_FUNCTION_GET_BACKING_STORE:
+            return asFP<GRALLOC1_PFN_GET_BACKING_STORE>(
+                    bufferHook<decltype(&Buffer::getBackingStore),
+                    &Buffer::getBackingStore, gralloc1_backing_store_t*>);
+        case GRALLOC1_FUNCTION_GET_CONSUMER_USAGE:
+            return asFP<GRALLOC1_PFN_GET_CONSUMER_USAGE>(getConsumerUsageHook);
+        case GRALLOC1_FUNCTION_GET_DIMENSIONS:
+            return asFP<GRALLOC1_PFN_GET_DIMENSIONS>(
+                    bufferHook<decltype(&Buffer::getDimensions),
+                    &Buffer::getDimensions, uint32_t*, uint32_t*>);
+        case GRALLOC1_FUNCTION_GET_FORMAT:
+            return asFP<GRALLOC1_PFN_GET_FORMAT>(
+                    bufferHook<decltype(&Buffer::getFormat),
+                    &Buffer::getFormat, int32_t*>);
+        case GRALLOC1_FUNCTION_GET_LAYER_COUNT:
+            return asFP<GRALLOC1_PFN_GET_LAYER_COUNT>(
+                    bufferHook<decltype(&Buffer::getLayerCount),
+                    &Buffer::getLayerCount, uint32_t*>);
+        case GRALLOC1_FUNCTION_GET_PRODUCER_USAGE:
+            return asFP<GRALLOC1_PFN_GET_PRODUCER_USAGE>(getProducerUsageHook);
+        case GRALLOC1_FUNCTION_GET_STRIDE:
+            return asFP<GRALLOC1_PFN_GET_STRIDE>(
+                    bufferHook<decltype(&Buffer::getStride),
+                    &Buffer::getStride, uint32_t*>);
+        case GRALLOC1_FUNCTION_ALLOCATE:
+            if (mDevice != nullptr) {
+                return asFP<GRALLOC1_PFN_ALLOCATE>(allocateHook);
+            } else {
+                return nullptr;
+            }
+        case GRALLOC1_FUNCTION_RETAIN:
+            return asFP<GRALLOC1_PFN_RETAIN>(retainHook);
+        case GRALLOC1_FUNCTION_RELEASE:
+            return asFP<GRALLOC1_PFN_RELEASE>(releaseHook);
+        case GRALLOC1_FUNCTION_GET_NUM_FLEX_PLANES:
+            return asFP<GRALLOC1_PFN_GET_NUM_FLEX_PLANES>(
+                    bufferHook<decltype(&Buffer::getNumFlexPlanes),
+                    &Buffer::getNumFlexPlanes, uint32_t*>);
+        case GRALLOC1_FUNCTION_LOCK:
+            return asFP<GRALLOC1_PFN_LOCK>(
+                    lockHook<void*, &Gralloc1On0Adapter::lock>);
+        case GRALLOC1_FUNCTION_LOCK_FLEX:
+            return asFP<GRALLOC1_PFN_LOCK_FLEX>(
+                    lockHook<struct android_flex_layout,
+                    &Gralloc1On0Adapter::lockFlex>);
+        case GRALLOC1_FUNCTION_UNLOCK:
+            return asFP<GRALLOC1_PFN_UNLOCK>(unlockHook);
+        case GRALLOC1_FUNCTION_INVALID:
+            ALOGE("Invalid function descriptor");
+            return nullptr;
+    }
+
+    ALOGE("Unknown function descriptor: %d", intDescriptor);
+    return nullptr;
+}
+
+void Gralloc1On0Adapter::dump(uint32_t* outSize, char* outBuffer)
+{
+    ALOGV("dump(%u (%p), %p", outSize ? *outSize : 0, outSize, outBuffer);
+
+    if (!mDevice->dump) {
+        // dump is optional on gralloc0 implementations
+        *outSize = 0;
+        return;
+    }
+
+    if (!outBuffer) {
+        constexpr int32_t BUFFER_LENGTH = 4096;
+        char buffer[BUFFER_LENGTH] = {};
+        mDevice->dump(mDevice, buffer, BUFFER_LENGTH);
+        buffer[BUFFER_LENGTH - 1] = 0; // Ensure the buffer is null-terminated
+        size_t actualLength = std::strlen(buffer);
+        mCachedDump.resize(actualLength);
+        std::copy_n(buffer, actualLength, mCachedDump.begin());
+        *outSize = static_cast<uint32_t>(actualLength);
+    } else {
+        *outSize = std::min(*outSize,
+                static_cast<uint32_t>(mCachedDump.size()));
+        outBuffer = std::copy_n(mCachedDump.cbegin(), *outSize, outBuffer);
+    }
+}
+
+gralloc1_error_t Gralloc1On0Adapter::createDescriptor(
+        gralloc1_buffer_descriptor_t* outDescriptor)
+{
+    auto descriptorId = sNextBufferDescriptorId++;
+    std::lock_guard<std::mutex> lock(mDescriptorMutex);
+    mDescriptors.emplace(descriptorId, std::make_shared<Descriptor>());
+
+    ALOGV("Created descriptor %" PRIu64, descriptorId);
+
+    *outDescriptor = descriptorId;
+    return GRALLOC1_ERROR_NONE;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::destroyDescriptor(
+        gralloc1_buffer_descriptor_t descriptor)
+{
+    ALOGV("Destroying descriptor %" PRIu64, descriptor);
+
+    std::lock_guard<std::mutex> lock(mDescriptorMutex);
+    if (mDescriptors.count(descriptor) == 0) {
+        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
+    }
+
+    mDescriptors.erase(descriptor);
+    return GRALLOC1_ERROR_NONE;
+}
+
+Gralloc1On0Adapter::Buffer::Buffer(buffer_handle_t handle,
+        gralloc1_backing_store_t store, const Descriptor& descriptor,
+        uint32_t stride, uint32_t numFlexPlanes, bool wasAllocated)
+  : mHandle(handle),
+    mReferenceCount(1),
+    mStore(store),
+    mDescriptor(descriptor),
+    mStride(stride),
+    mNumFlexPlanes(numFlexPlanes),
+    mWasAllocated(wasAllocated) {}
+
+gralloc1_error_t Gralloc1On0Adapter::allocate(
+        gralloc1_buffer_descriptor_t id,
+        const std::shared_ptr<Descriptor>& descriptor,
+        buffer_handle_t* outBufferHandle)
+{
+    ALOGV("allocate(%" PRIu64 ")", id);
+
+    // If this function is being called, it's because we handed out its function
+    // pointer, which only occurs when mDevice has been loaded successfully and
+    // we are permitted to allocate
+
+    int usage = static_cast<int>(descriptor->producerUsage) |
+            static_cast<int>(descriptor->consumerUsage);
+    buffer_handle_t handle = nullptr;
+    int stride = 0;
+    ALOGV("Calling alloc(%p, %u, %u, %i, %u)", mDevice, descriptor->width,
+            descriptor->height, descriptor->format, usage);
+    auto error = mDevice->alloc(mDevice,
+            static_cast<int>(descriptor->width),
+            static_cast<int>(descriptor->height), descriptor->format,
+            usage, &handle, &stride);
+    if (error != 0) {
+        ALOGE("gralloc0 allocation failed: %d (%s)", error,
+                strerror(-error));
+        return GRALLOC1_ERROR_NO_RESOURCES;
+    }
+
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_SET_USAGES,
+            handle,
+            static_cast<int>(descriptor->producerUsage),
+            static_cast<int>(descriptor->consumerUsage));
+
+    uint64_t backingStore = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_BACKING_STORE,
+            handle, &backingStore);
+    int numFlexPlanes = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_NUM_FLEX_PLANES,
+            handle, &numFlexPlanes);
+
+    *outBufferHandle = handle;
+    auto buffer = std::make_shared<Buffer>(handle, backingStore,
+            *descriptor, stride, numFlexPlanes, true);
+
+    std::lock_guard<std::mutex> lock(mBufferMutex);
+    mBuffers.emplace(handle, std::move(buffer));
+
+    return GRALLOC1_ERROR_NONE;
+}
+
+int32_t Gralloc1On0Adapter::allocateHook(gralloc1_device* device,
+        uint32_t numDescriptors,
+        const gralloc1_buffer_descriptor_t* descriptors,
+        buffer_handle_t* outBuffers)
+{
+    if (!outBuffers) {
+        return GRALLOC1_ERROR_UNDEFINED;
+    }
+
+    auto adapter = getAdapter(device);
+
+    gralloc1_error_t error = GRALLOC1_ERROR_NONE;
+    uint32_t i;
+    for (i = 0; i < numDescriptors; i++) {
+        auto descriptor = adapter->getDescriptor(descriptors[i]);
+        if (!descriptor) {
+            error = GRALLOC1_ERROR_BAD_DESCRIPTOR;
+            break;
+        }
+
+        buffer_handle_t bufferHandle = nullptr;
+        error = adapter->allocate(descriptors[i], descriptor, &bufferHandle);
+        if (error != GRALLOC1_ERROR_NONE) {
+            break;
+        }
+
+        outBuffers[i] = bufferHandle;
+    }
+
+    if (error == GRALLOC1_ERROR_NONE) {
+        if (numDescriptors > 1) {
+            error = GRALLOC1_ERROR_NOT_SHARED;
+        }
+    } else {
+        for (uint32_t j = 0; j < i; j++) {
+            adapter->release(adapter->getBuffer(outBuffers[j]));
+            outBuffers[j] = nullptr;
+        }
+    }
+
+    return error;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::retain(
+        const std::shared_ptr<Buffer>& buffer)
+{
+    std::lock_guard<std::mutex> lock(mBufferMutex);
+    buffer->retain();
+    return GRALLOC1_ERROR_NONE;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::release(
+        const std::shared_ptr<Buffer>& buffer)
+{
+    std::lock_guard<std::mutex> lock(mBufferMutex);
+    if (!buffer->release()) {
+        return GRALLOC1_ERROR_NONE;
+    }
+
+    buffer_handle_t handle = buffer->getHandle();
+    if (buffer->wasAllocated()) {
+        ALOGV("Calling free(%p)", handle);
+        int result = mDevice->free(mDevice, handle);
+        if (result != 0) {
+            ALOGE("gralloc0 free failed: %d", result);
+        }
+    } else {
+        ALOGV("Calling unregisterBuffer(%p)", handle);
+        int result = mModule->unregisterBuffer(mModule, handle);
+        if (result != 0) {
+            ALOGE("gralloc0 unregister failed: %d", result);
+        }
+    }
+
+    mBuffers.erase(handle);
+    return GRALLOC1_ERROR_NONE;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::retain(buffer_handle_t bufferHandle)
+{
+    ALOGV("retain(%p)", bufferHandle);
+
+    std::lock_guard<std::mutex> lock(mBufferMutex);
+
+    if (mBuffers.count(bufferHandle) != 0) {
+        mBuffers[bufferHandle]->retain();
+        return GRALLOC1_ERROR_NONE;
+    }
+
+    ALOGV("Calling registerBuffer(%p)", bufferHandle);
+    int result = mModule->registerBuffer(mModule, bufferHandle);
+    if (result != 0) {
+        ALOGE("gralloc0 register failed: %d", result);
+        return GRALLOC1_ERROR_NO_RESOURCES;
+    }
+
+    uint64_t backingStore = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_BACKING_STORE,
+            bufferHandle, &backingStore);
+
+    int numFlexPlanes = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_NUM_FLEX_PLANES,
+            bufferHandle, &numFlexPlanes);
+
+    int stride = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_STRIDE,
+            bufferHandle, &stride);
+
+    int width = 0;
+    int height = 0;
+    int format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED;
+    int producerUsage = 0;
+    int consumerUsage = 0;
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_DIMENSIONS,
+            bufferHandle, &width, &height);
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_FORMAT,
+            bufferHandle, &format);
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_PRODUCER_USAGE,
+            bufferHandle, &producerUsage);
+    mModule->perform(mModule, GRALLOC1_ADAPTER_PERFORM_GET_CONSUMER_USAGE,
+            bufferHandle, &consumerUsage);
+
+    Descriptor descriptor;
+    descriptor.setDimensions(width, height);
+    descriptor.setFormat(format);
+    descriptor.setProducerUsage(
+            static_cast<gralloc1_producer_usage_t>(producerUsage));
+    descriptor.setConsumerUsage(
+            static_cast<gralloc1_consumer_usage_t>(consumerUsage));
+
+    auto buffer = std::make_shared<Buffer>(bufferHandle, backingStore,
+            descriptor, stride, numFlexPlanes, false);
+    mBuffers.emplace(bufferHandle, std::move(buffer));
+    return GRALLOC1_ERROR_NONE;
+}
+
+static void syncWaitForever(int fd, const char* logname)
+{
+    if (fd < 0) {
+        return;
+    }
+
+    const int warningTimeout = 3500;
+    const int error = sync_wait(fd, warningTimeout);
+    if (error < 0 && errno == ETIME) {
+        ALOGE("%s: fence %d didn't signal in %u ms", logname, fd,
+                warningTimeout);
+        sync_wait(fd, -1);
+    }
+}
+
+gralloc1_error_t Gralloc1On0Adapter::lock(
+        const std::shared_ptr<Buffer>& buffer,
+        gralloc1_producer_usage_t producerUsage,
+        gralloc1_consumer_usage_t consumerUsage,
+        const gralloc1_rect_t& accessRegion, void** outData,
+        int acquireFence)
+{
+    if (mMinorVersion >= 3) {
+        int result = mModule->lockAsync(mModule, buffer->getHandle(),
+                static_cast<int32_t>(producerUsage | consumerUsage),
+                accessRegion.left, accessRegion.top, accessRegion.width,
+                accessRegion.height, outData, acquireFence);
+        if (result != 0) {
+            return GRALLOC1_ERROR_UNSUPPORTED;
+        }
+    } else {
+        syncWaitForever(acquireFence, "Gralloc1On0Adapter::lock");
+
+        int result = mModule->lock(mModule, buffer->getHandle(),
+                static_cast<int32_t>(producerUsage | consumerUsage),
+                accessRegion.left, accessRegion.top, accessRegion.width,
+                accessRegion.height, outData);
+        ALOGV("gralloc0 lock returned %d", result);
+        if (result != 0) {
+            return GRALLOC1_ERROR_UNSUPPORTED;
+        } else if (acquireFence >= 0) {
+            close(acquireFence);
+        }
+    }
+    return GRALLOC1_ERROR_NONE;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::lockFlex(
+        const std::shared_ptr<Buffer>& buffer,
+        gralloc1_producer_usage_t producerUsage,
+        gralloc1_consumer_usage_t consumerUsage,
+        const gralloc1_rect_t& accessRegion,
+        struct android_flex_layout* outFlex,
+        int acquireFence)
+{
+    if (mMinorVersion >= 3) {
+        int result = mModule->perform(mModule,
+                GRALLOC1_ADAPTER_PERFORM_LOCK_FLEX,
+                buffer->getHandle(),
+                static_cast<int>(producerUsage),
+                static_cast<int>(consumerUsage),
+                accessRegion.left,
+                accessRegion.top,
+                accessRegion.width,
+                accessRegion.height,
+                outFlex, acquireFence);
+        if (result != 0) {
+            return GRALLOC1_ERROR_UNSUPPORTED;
+        }
+    } else {
+        syncWaitForever(acquireFence, "Gralloc1On0Adapter::lockFlex");
+
+        int result = mModule->perform(mModule,
+                GRALLOC1_ADAPTER_PERFORM_LOCK_FLEX,
+                buffer->getHandle(),
+                static_cast<int>(producerUsage),
+                static_cast<int>(consumerUsage),
+                accessRegion.left,
+                accessRegion.top,
+                accessRegion.width,
+                accessRegion.height,
+                outFlex, -1);
+        if (result != 0) {
+            return GRALLOC1_ERROR_UNSUPPORTED;
+        } else if (acquireFence >= 0) {
+            close(acquireFence);
+        }
+    }
+
+    return GRALLOC1_ERROR_NONE;
+}
+
+gralloc1_error_t Gralloc1On0Adapter::unlock(
+        const std::shared_ptr<Buffer>& buffer,
+        int* outReleaseFence)
+{
+    if (mMinorVersion >= 3) {
+        int fenceFd = -1;
+        int result = mModule->unlockAsync(mModule, buffer->getHandle(),
+                &fenceFd);
+        if (result != 0) {
+            close(fenceFd);
+            ALOGE("gralloc0 unlockAsync failed: %d", result);
+        } else {
+            *outReleaseFence = fenceFd;
+        }
+    } else {
+        int result = mModule->unlock(mModule, buffer->getHandle());
+        if (result != 0) {
+            ALOGE("gralloc0 unlock failed: %d", result);
+        } else {
+            *outReleaseFence = -1;
+        }
+    }
+    return GRALLOC1_ERROR_NONE;
+}
+
+std::shared_ptr<Gralloc1On0Adapter::Descriptor>
+Gralloc1On0Adapter::getDescriptor(gralloc1_buffer_descriptor_t descriptorId)
+{
+    std::lock_guard<std::mutex> lock(mDescriptorMutex);
+    if (mDescriptors.count(descriptorId) == 0) {
+        return nullptr;
+    }
+
+    return mDescriptors[descriptorId];
+}
+
+std::shared_ptr<Gralloc1On0Adapter::Buffer> Gralloc1On0Adapter::getBuffer(
+        buffer_handle_t bufferHandle)
+{
+    std::lock_guard<std::mutex> lock(mBufferMutex);
+    if (mBuffers.count(bufferHandle) == 0) {
+        return nullptr;
+    }
+
+    return mBuffers[bufferHandle];
+}
+
+std::atomic<gralloc1_buffer_descriptor_t>
+        Gralloc1On0Adapter::sNextBufferDescriptorId(1);
+
+} // namespace hardware
+} // namespace android
diff --git a/graphics/allocator/2.0/default/Gralloc1On0Adapter.h b/graphics/allocator/2.0/default/Gralloc1On0Adapter.h
new file mode 100644
index 0000000..180015d
--- /dev/null
+++ b/graphics/allocator/2.0/default/Gralloc1On0Adapter.h
@@ -0,0 +1,458 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_GRALLOC_1_ON_0_ADAPTER_H
+#define ANDROID_HARDWARE_GRALLOC_1_ON_0_ADAPTER_H
+
+#include <hardware/gralloc1.h>
+#include <log/log.h>
+
+#include <atomic>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+struct gralloc_module_t;
+struct alloc_device_t;
+
+namespace android {
+namespace hardware {
+
+class Gralloc1On0Adapter : public gralloc1_device_t
+{
+public:
+    Gralloc1On0Adapter(const hw_module_t* module);
+    ~Gralloc1On0Adapter();
+
+    gralloc1_device_t* getDevice() {
+        return static_cast<gralloc1_device_t*>(this);
+    }
+
+private:
+    static inline Gralloc1On0Adapter* getAdapter(gralloc1_device_t* device) {
+        return static_cast<Gralloc1On0Adapter*>(device);
+    }
+
+    static int closeHook(struct hw_device_t* device) {
+        delete getAdapter(reinterpret_cast<gralloc1_device_t*>(device));
+        return 0;
+    }
+
+    // getCapabilities
+
+    void doGetCapabilities(uint32_t* outCount,
+            int32_t* /*gralloc1_capability_t*/ outCapabilities);
+    static void getCapabilitiesHook(gralloc1_device_t* device,
+            uint32_t* outCount,
+            int32_t* /*gralloc1_capability_t*/ outCapabilities) {
+        getAdapter(device)->doGetCapabilities(outCount, outCapabilities);
+    }
+
+    // getFunction
+
+    gralloc1_function_pointer_t doGetFunction(
+            int32_t /*gralloc1_function_descriptor_t*/ descriptor);
+    static gralloc1_function_pointer_t getFunctionHook(
+            gralloc1_device_t* device,
+            int32_t /*gralloc1_function_descriptor_t*/ descriptor) {
+        return getAdapter(device)->doGetFunction(descriptor);
+    }
+
+    // dump
+
+    void dump(uint32_t* outSize, char* outBuffer);
+    static void dumpHook(gralloc1_device_t* device, uint32_t* outSize,
+            char* outBuffer) {
+        return getAdapter(device)->dump(outSize, outBuffer);
+    }
+    std::string mCachedDump;
+
+    // Buffer descriptor lifecycle functions
+
+    struct Descriptor;
+
+    gralloc1_error_t createDescriptor(
+            gralloc1_buffer_descriptor_t* outDescriptor);
+    static int32_t createDescriptorHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t* outDescriptor) {
+        auto error = getAdapter(device)->createDescriptor(outDescriptor);
+        return static_cast<int32_t>(error);
+    }
+
+    gralloc1_error_t destroyDescriptor(gralloc1_buffer_descriptor_t descriptor);
+    static int32_t destroyDescriptorHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptor) {
+        auto error = getAdapter(device)->destroyDescriptor(descriptor);
+        return static_cast<int32_t>(error);
+    }
+
+    // Buffer descriptor modification functions
+
+    struct Descriptor : public std::enable_shared_from_this<Descriptor> {
+        Descriptor()
+          : width(0),
+            height(0),
+            format(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED),
+            layerCount(1),
+            producerUsage(GRALLOC1_PRODUCER_USAGE_NONE),
+            consumerUsage(GRALLOC1_CONSUMER_USAGE_NONE) {}
+
+        gralloc1_error_t setDimensions(uint32_t w, uint32_t h) {
+            width = w;
+            height = h;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t setFormat(int32_t f) {
+            format = f;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t setLayerCount(uint32_t lc) {
+            layerCount = lc;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t setProducerUsage(gralloc1_producer_usage_t usage) {
+            producerUsage = usage;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t setConsumerUsage(gralloc1_consumer_usage_t usage) {
+            consumerUsage = usage;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        uint32_t width;
+        uint32_t height;
+        int32_t format;
+        uint32_t layerCount;
+        gralloc1_producer_usage_t producerUsage;
+        gralloc1_consumer_usage_t consumerUsage;
+    };
+
+    template <typename ...Args>
+    static int32_t callDescriptorFunction(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId,
+            gralloc1_error_t (Descriptor::*member)(Args...), Args... args) {
+        auto descriptor = getAdapter(device)->getDescriptor(descriptorId);
+        if (!descriptor) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_DESCRIPTOR);
+        }
+        auto error = ((*descriptor).*member)(std::forward<Args>(args)...);
+        return static_cast<int32_t>(error);
+    }
+
+    static int32_t setConsumerUsageHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId, uint64_t intUsage) {
+        auto usage = static_cast<gralloc1_consumer_usage_t>(intUsage);
+        return callDescriptorFunction(device, descriptorId,
+                &Descriptor::setConsumerUsage, usage);
+    }
+
+    static int32_t setDimensionsHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId, uint32_t width,
+            uint32_t height) {
+        return callDescriptorFunction(device, descriptorId,
+                &Descriptor::setDimensions, width, height);
+    }
+
+    static int32_t setFormatHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId, int32_t format) {
+        return callDescriptorFunction(device, descriptorId,
+                &Descriptor::setFormat, format);
+    }
+
+    static int32_t setLayerCountHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId, uint32_t layerCount) {
+        return callDescriptorFunction(device, descriptorId,
+                &Descriptor::setLayerCount, layerCount);
+    }
+
+    static int32_t setProducerUsageHook(gralloc1_device_t* device,
+            gralloc1_buffer_descriptor_t descriptorId, uint64_t intUsage) {
+        auto usage = static_cast<gralloc1_producer_usage_t>(intUsage);
+        return callDescriptorFunction(device, descriptorId,
+                &Descriptor::setProducerUsage, usage);
+    }
+
+    // Buffer handle query functions
+
+    class Buffer {
+    public:
+        Buffer(buffer_handle_t handle, gralloc1_backing_store_t store,
+                const Descriptor& descriptor, uint32_t stride,
+                uint32_t numFlexPlanes, bool wasAllocated);
+
+        buffer_handle_t getHandle() const { return mHandle; }
+
+        void retain() { ++mReferenceCount; }
+
+        // Returns true if the reference count has dropped to 0, indicating that
+        // the buffer needs to be released
+        bool release() { return --mReferenceCount == 0; }
+
+        bool wasAllocated() const { return mWasAllocated; }
+
+        gralloc1_error_t getBackingStore(
+                gralloc1_backing_store_t* outStore) const {
+            *outStore = mStore;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getConsumerUsage(
+                gralloc1_consumer_usage_t* outUsage) const {
+            *outUsage = mDescriptor.consumerUsage;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getDimensions(uint32_t* outWidth,
+                uint32_t* outHeight) const {
+            *outWidth = mDescriptor.width;
+            *outHeight = mDescriptor.height;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getFormat(int32_t* outFormat) const {
+            *outFormat = mDescriptor.format;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getLayerCount(uint32_t* outLayerCount) const {
+            *outLayerCount = mDescriptor.layerCount;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getNumFlexPlanes(uint32_t* outNumPlanes) const {
+            *outNumPlanes = mNumFlexPlanes;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getProducerUsage(
+                gralloc1_producer_usage_t* outUsage) const {
+            *outUsage = mDescriptor.producerUsage;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+        gralloc1_error_t getStride(uint32_t* outStride) const {
+            *outStride = mStride;
+            return GRALLOC1_ERROR_NONE;
+        }
+
+    private:
+
+        const buffer_handle_t mHandle;
+        size_t mReferenceCount;
+
+        const gralloc1_backing_store_t mStore;
+        const Descriptor mDescriptor;
+        const uint32_t mStride;
+        const uint32_t mNumFlexPlanes;
+
+        // Whether this buffer allocated in this process (as opposed to just
+        // being retained here), which determines whether to free or unregister
+        // the buffer when this Buffer is released
+        const bool mWasAllocated;
+    };
+
+    template <typename ...Args>
+    static int32_t callBufferFunction(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle,
+            gralloc1_error_t (Buffer::*member)(Args...) const, Args... args) {
+        auto buffer = getAdapter(device)->getBuffer(bufferHandle);
+        if (!buffer) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_HANDLE);
+        }
+        auto error = ((*buffer).*member)(std::forward<Args>(args)...);
+        return static_cast<int32_t>(error);
+    }
+
+    template <typename MF, MF memFunc, typename ...Args>
+    static int32_t bufferHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle, Args... args) {
+        return Gralloc1On0Adapter::callBufferFunction(device, bufferHandle,
+                memFunc, std::forward<Args>(args)...);
+    }
+
+    static int32_t getConsumerUsageHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle, uint64_t* outUsage) {
+        auto usage = GRALLOC1_CONSUMER_USAGE_NONE;
+        auto error = callBufferFunction(device, bufferHandle,
+                &Buffer::getConsumerUsage, &usage);
+        if (error == GRALLOC1_ERROR_NONE) {
+            *outUsage = static_cast<uint64_t>(usage);
+        }
+        return error;
+    }
+
+    static int32_t getProducerUsageHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle, uint64_t* outUsage) {
+        auto usage = GRALLOC1_PRODUCER_USAGE_NONE;
+        auto error = callBufferFunction(device, bufferHandle,
+                &Buffer::getProducerUsage, &usage);
+        if (error == GRALLOC1_ERROR_NONE) {
+            *outUsage = static_cast<uint64_t>(usage);
+        }
+        return error;
+    }
+
+    // Buffer management functions
+
+    gralloc1_error_t allocate(
+            gralloc1_buffer_descriptor_t id,
+            const std::shared_ptr<Descriptor>& descriptor,
+            buffer_handle_t* outBufferHandle);
+    static int32_t allocateHook(gralloc1_device* device,
+            uint32_t numDescriptors,
+            const gralloc1_buffer_descriptor_t* descriptors,
+            buffer_handle_t* outBuffers);
+
+    gralloc1_error_t retain(const std::shared_ptr<Buffer>& buffer);
+    gralloc1_error_t retain(buffer_handle_t bufferHandle);
+    static int32_t retainHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle)
+    {
+        auto adapter = getAdapter(device);
+        return adapter->retain(bufferHandle);
+    }
+
+    gralloc1_error_t release(const std::shared_ptr<Buffer>& buffer);
+    static int32_t releaseHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle) {
+        auto adapter = getAdapter(device);
+
+        auto buffer = adapter->getBuffer(bufferHandle);
+        if (!buffer) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_HANDLE);
+        }
+
+        auto error = adapter->release(buffer);
+        return static_cast<int32_t>(error);
+    }
+
+    // Buffer access functions
+
+    gralloc1_error_t lock(const std::shared_ptr<Buffer>& buffer,
+            gralloc1_producer_usage_t producerUsage,
+            gralloc1_consumer_usage_t consumerUsage,
+            const gralloc1_rect_t& accessRegion, void** outData,
+            int acquireFence);
+    gralloc1_error_t lockFlex(const std::shared_ptr<Buffer>& buffer,
+            gralloc1_producer_usage_t producerUsage,
+            gralloc1_consumer_usage_t consumerUsage,
+            const gralloc1_rect_t& accessRegion,
+            struct android_flex_layout* outFlex,
+            int acquireFence);
+
+    template <typename OUT, gralloc1_error_t (Gralloc1On0Adapter::*member)(
+            const std::shared_ptr<Buffer>&, gralloc1_producer_usage_t,
+            gralloc1_consumer_usage_t, const gralloc1_rect_t&, OUT*,
+            int)>
+    static int32_t lockHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle,
+            uint64_t /*gralloc1_producer_usage_t*/ uintProducerUsage,
+            uint64_t /*gralloc1_consumer_usage_t*/ uintConsumerUsage,
+            const gralloc1_rect_t* accessRegion, OUT* outData,
+            int32_t acquireFenceFd) {
+        auto adapter = getAdapter(device);
+
+        // Exactly one of producer and consumer usage must be *_USAGE_NONE,
+        // but we can't check this until the upper levels of the framework
+        // correctly distinguish between producer and consumer usage
+        /*
+        bool hasProducerUsage =
+                uintProducerUsage != GRALLOC1_PRODUCER_USAGE_NONE;
+        bool hasConsumerUsage =
+                uintConsumerUsage != GRALLOC1_CONSUMER_USAGE_NONE;
+        if (hasProducerUsage && hasConsumerUsage ||
+                !hasProducerUsage && !hasConsumerUsage) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
+        }
+        */
+
+        auto producerUsage =
+                static_cast<gralloc1_producer_usage_t>(uintProducerUsage);
+        auto consumerUsage =
+                static_cast<gralloc1_consumer_usage_t>(uintConsumerUsage);
+
+        if (!outData) {
+            const auto producerCpuUsage = GRALLOC1_PRODUCER_USAGE_CPU_READ |
+                    GRALLOC1_PRODUCER_USAGE_CPU_WRITE;
+            if ((producerUsage & producerCpuUsage) != 0) {
+                return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
+            }
+            if ((consumerUsage & GRALLOC1_CONSUMER_USAGE_CPU_READ) != 0) {
+                return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
+            }
+        }
+
+        auto buffer = adapter->getBuffer(bufferHandle);
+        if (!buffer) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_HANDLE);
+        }
+
+        if (!accessRegion) {
+            ALOGE("accessRegion is null");
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
+        }
+
+        auto error = ((*adapter).*member)(buffer, producerUsage, consumerUsage,
+                *accessRegion, outData, acquireFenceFd);
+        return static_cast<int32_t>(error);
+    }
+
+    gralloc1_error_t unlock(const std::shared_ptr<Buffer>& buffer,
+            int* outReleaseFence);
+    static int32_t unlockHook(gralloc1_device_t* device,
+            buffer_handle_t bufferHandle, int32_t* outReleaseFenceFd) {
+        auto adapter = getAdapter(device);
+
+        auto buffer = adapter->getBuffer(bufferHandle);
+        if (!buffer) {
+            return static_cast<int32_t>(GRALLOC1_ERROR_BAD_HANDLE);
+        }
+
+        int releaseFence = -1;
+        auto error = adapter->unlock(buffer, &releaseFence);
+        if (error == GRALLOC1_ERROR_NONE) {
+            *outReleaseFenceFd = releaseFence;
+        }
+        return static_cast<int32_t>(error);
+    }
+
+    // Adapter internals
+    const gralloc_module_t* mModule;
+    uint8_t mMinorVersion;
+    alloc_device_t* mDevice;
+
+    std::shared_ptr<Descriptor> getDescriptor(
+            gralloc1_buffer_descriptor_t descriptorId);
+    std::shared_ptr<Buffer> getBuffer(buffer_handle_t bufferHandle);
+
+    static std::atomic<gralloc1_buffer_descriptor_t> sNextBufferDescriptorId;
+    std::mutex mDescriptorMutex;
+    std::unordered_map<gralloc1_buffer_descriptor_t,
+            std::shared_ptr<Descriptor>> mDescriptors;
+    std::mutex mBufferMutex;
+    std::unordered_map<buffer_handle_t, std::shared_ptr<Buffer>> mBuffers;
+};
+
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_GRALLOC_1_ON_0_ADAPTER_H
diff --git a/graphics/allocator/2.0/default/gralloc1-adapter.c b/graphics/allocator/2.0/default/gralloc1-adapter.c
deleted file mode 100644
index 724cd47..0000000
--- a/graphics/allocator/2.0/default/gralloc1-adapter.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * Copyright 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Gralloc1Adapter"
-
-#include <stdatomic.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <pthread.h>
-
-#include <cutils/native_handle.h>
-#include <hardware/gralloc1.h>
-#include <sync/sync.h>
-#include <log/log.h>
-
-#include "gralloc1-adapter.h"
-
-struct gralloc1_adapter_module {
-    struct gralloc_module_t base;
-    struct gralloc1_adapter adapter;
-};
-
-struct gralloc1_adapter_device {
-    struct gralloc1_device base;
-
-    struct alloc_device_t* alloc_dev;
-
-    /* fixed size for thread safety */
-    char saved_dump[4096];
-    size_t saved_dump_size;
-};
-
-/* additional data associated with registered buffer_handle_t */
-struct gralloc1_adapter_buffer_data {
-    struct gralloc1_adapter_buffer_info info;
-
-    atomic_int refcount;
-    bool owned;
-};
-
-struct gralloc1_adapter_buffer_descriptor {
-    int width;
-    int height;
-    int format;
-    int producer_usage;
-    int consumer_usage;
-};
-
-static const struct gralloc1_adapter_module* gralloc1_adapter_module(
-        struct gralloc1_device* dev)
-{
-    return (const struct gralloc1_adapter_module*) dev->common.module;
-}
-
-static struct gralloc1_adapter_device* gralloc1_adapter_device(
-        struct gralloc1_device* dev)
-{
-    return (struct gralloc1_adapter_device*) dev;
-}
-
-static struct gralloc1_adapter_buffer_data* lookup_buffer_data(
-        struct gralloc1_device* dev, buffer_handle_t buffer)
-{
-    const struct gralloc1_adapter_module* mod = gralloc1_adapter_module(dev);
-    if (!mod->adapter.is_registered(&mod->base, buffer))
-        return NULL;
-
-    return mod->adapter.get_data(&mod->base, buffer);
-}
-
-static struct gralloc1_adapter_buffer_descriptor* lookup_buffer_descriptor(
-        struct gralloc1_device* dev, gralloc1_buffer_descriptor_t id)
-{
-    /* do we want to validate? */
-    return (struct gralloc1_adapter_buffer_descriptor*) ((uintptr_t) id);
-}
-
-static void device_dump(struct gralloc1_device* device,
-        uint32_t* outSize, char* outBuffer)
-{
-    struct gralloc1_adapter_device* dev = gralloc1_adapter_device(device);
-
-    if (outBuffer) {
-        uint32_t copy = (uint32_t) dev->saved_dump_size;
-        if (*outSize < copy) {
-            copy = *outSize;
-        } else {
-            *outSize = copy;
-        }
-
-        memcpy(outBuffer, dev->saved_dump, copy);
-    } else {
-        /* dump is optional and may not null-terminate */
-        if (dev->alloc_dev->dump) {
-            dev->alloc_dev->dump(dev->alloc_dev, dev->saved_dump,
-                    sizeof(dev->saved_dump) - 1);
-            dev->saved_dump_size = strlen(dev->saved_dump);
-        }
-
-        *outSize = (uint32_t) dev->saved_dump_size;
-    }
-}
-
-static int32_t device_create_descriptor(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t* outDescriptor)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc;
-
-    desc = calloc(1, sizeof(*desc));
-    if (!desc) {
-        return GRALLOC1_ERROR_NO_RESOURCES;
-    }
-
-    *outDescriptor = (gralloc1_buffer_descriptor_t) (uintptr_t) desc;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_destroy_descriptor(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t descriptor)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc =
-        lookup_buffer_descriptor(device, descriptor);
-    if (!desc) {
-        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
-    }
-
-    free(desc);
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_set_consumer_usage(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t descriptor, uint64_t usage)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc =
-        lookup_buffer_descriptor(device, descriptor);
-    if (!desc) {
-        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
-    }
-
-    desc->consumer_usage = (int) usage;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_set_dimensions(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t descriptor,
-        uint32_t width, uint32_t height)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc =
-        lookup_buffer_descriptor(device, descriptor);
-    if (!desc) {
-        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
-    }
-
-    desc->width = (int) width;
-    desc->height = (int) height;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_set_format(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t descriptor, int32_t format)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc =
-        lookup_buffer_descriptor(device, descriptor);
-    if (!desc) {
-        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
-    }
-
-    desc->format = format;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_set_producer_usage(struct gralloc1_device* device,
-        gralloc1_buffer_descriptor_t descriptor, uint64_t usage)
-{
-    struct gralloc1_adapter_buffer_descriptor* desc =
-        lookup_buffer_descriptor(device, descriptor);
-    if (!desc) {
-        return GRALLOC1_ERROR_BAD_DESCRIPTOR;
-    }
-
-    desc->producer_usage = (int) usage;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_backing_store(struct gralloc1_device* device,
-        buffer_handle_t buffer, gralloc1_backing_store_t* outStore)
-{
-    /* we never share backing store */
-    *outStore = (gralloc1_backing_store_t) (uintptr_t) buffer;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_consumer_usage(struct gralloc1_device* device,
-        buffer_handle_t buffer, uint64_t* outUsage)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outUsage = data->info.usage;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_dimensions(struct gralloc1_device* device,
-        buffer_handle_t buffer, uint32_t* outWidth, uint32_t* outHeight)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outWidth = data->info.width;
-    *outHeight = data->info.height;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_format(struct gralloc1_device* device,
-        buffer_handle_t buffer, int32_t* outFormat)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outFormat = data->info.format;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_producer_usage(struct gralloc1_device* device,
-        buffer_handle_t buffer, uint64_t* outUsage)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outUsage = data->info.usage;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_stride(struct gralloc1_device* device,
-        buffer_handle_t buffer, uint32_t* outStride)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outStride = data->info.stride;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_allocate(struct gralloc1_device* device,
-        uint32_t numDescriptors,
-        const gralloc1_buffer_descriptor_t* descriptors,
-        buffer_handle_t* outBuffers)
-{
-    const struct gralloc1_adapter_module* mod =
-        gralloc1_adapter_module(device);
-    struct gralloc1_adapter_device* dev = gralloc1_adapter_device(device);
-    gralloc1_error_t err = GRALLOC1_ERROR_NONE;
-    uint32_t i;
-
-    for (i = 0; i < numDescriptors; i++) {
-        const struct gralloc1_adapter_buffer_descriptor* desc =
-            lookup_buffer_descriptor(device, descriptors[i]);
-        struct gralloc1_adapter_buffer_data* data;
-        buffer_handle_t buffer;
-        int dummy_stride;
-        int ret;
-
-        if (!desc) {
-            err = GRALLOC1_ERROR_BAD_DESCRIPTOR;
-            break;
-        }
-
-        data = calloc(1, sizeof(*data));
-        if (!data) {
-            err = GRALLOC1_ERROR_NO_RESOURCES;
-            break;
-        }
-
-        ret = dev->alloc_dev->alloc(dev->alloc_dev, desc->width, desc->height,
-                desc->format, desc->producer_usage | desc->consumer_usage,
-                &buffer, &dummy_stride);
-        if (ret) {
-            free(data);
-            err = GRALLOC1_ERROR_NO_RESOURCES;
-            break;
-        }
-
-        mod->adapter.get_info(&mod->base, buffer, &data->info);
-        data->refcount = 1;
-        data->owned = true;
-
-        mod->adapter.set_data(&mod->base, buffer, data);
-
-        outBuffers[i] = buffer;
-    }
-
-    if (err != GRALLOC1_ERROR_NONE) {
-        uint32_t j;
-        for (j = 0; j < i; j++) {
-            free(mod->adapter.get_data(&mod->base, outBuffers[i]));
-            dev->alloc_dev->free(dev->alloc_dev, outBuffers[i]);
-        }
-
-        return err;
-    }
-
-    return (numDescriptors > 1) ?
-        GRALLOC1_ERROR_NOT_SHARED : GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_retain(struct gralloc1_device* device,
-        buffer_handle_t buffer)
-{
-    static pthread_mutex_t register_mutex = PTHREAD_MUTEX_INITIALIZER;
-    const struct gralloc1_adapter_module* mod =
-        gralloc1_adapter_module(device);
-    struct gralloc1_adapter_buffer_data* data;
-
-    pthread_mutex_lock(&register_mutex);
-
-    if (mod->adapter.is_registered(&mod->base, buffer)) {
-        data = mod->adapter.get_data(&mod->base, buffer);
-        data->refcount++;
-    } else {
-        int ret;
-
-        data = calloc(1, sizeof(*data));
-        if (!data) {
-            pthread_mutex_unlock(&register_mutex);
-            return GRALLOC1_ERROR_NO_RESOURCES;
-        }
-
-        ret = mod->base.registerBuffer(&mod->base, buffer);
-        if (ret) {
-            pthread_mutex_unlock(&register_mutex);
-            free(data);
-
-            return GRALLOC1_ERROR_NO_RESOURCES;
-        }
-
-        mod->adapter.get_info(&mod->base, buffer, &data->info);
-        data->refcount = 1;
-        data->owned = false;
-
-        mod->adapter.set_data(&mod->base, buffer, data);
-    }
-
-    pthread_mutex_unlock(&register_mutex);
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_release(struct gralloc1_device* device,
-        buffer_handle_t buffer)
-{
-    struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        ALOGE("unable to release unregistered buffer %p", buffer);
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    data->refcount--;
-    if (!data->refcount) {
-        if (data->owned) {
-            struct gralloc1_adapter_device* dev =
-                gralloc1_adapter_device(device);
-            dev->alloc_dev->free(dev->alloc_dev, buffer);
-        } else {
-            const struct gralloc1_adapter_module* mod =
-                gralloc1_adapter_module(device);
-            mod->base.unregisterBuffer(&mod->base, buffer);
-
-            native_handle_close(buffer);
-            native_handle_delete((native_handle_t*) buffer);
-        }
-
-        free(data);
-    }
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_get_num_flex_planes(struct gralloc1_device* device,
-        buffer_handle_t buffer, uint32_t* outNumPlanes)
-{
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    if (!data) {
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    *outNumPlanes = data->info.num_flex_planes;
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_lock(struct gralloc1_device* device,
-        buffer_handle_t buffer,
-        uint64_t producerUsage, uint64_t consumerUsage,
-        const gralloc1_rect_t* accessRegion, void** outData,
-        int32_t acquireFence)
-{
-    const struct gralloc1_adapter_module* mod =
-        gralloc1_adapter_module(device);
-    const int usage = (int) (producerUsage | consumerUsage);
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    int ret;
-
-    if (!data) {
-        ALOGE("unable to lock unregistered buffer %p", buffer);
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    if (mod->adapter.real_module_api_version >=
-            GRALLOC_MODULE_API_VERSION_0_3) {
-        ret = mod->base.lockAsync(&mod->base,
-                buffer, usage,
-                accessRegion->left,
-                accessRegion->top,
-                accessRegion->width,
-                accessRegion->height,
-                outData, acquireFence);
-    } else {
-        if (acquireFence >= 0) {
-            sync_wait(acquireFence, -1);
-        }
-
-        ret = mod->base.lock(&mod->base,
-                buffer, usage,
-                accessRegion->left,
-                accessRegion->top,
-                accessRegion->width,
-                accessRegion->height,
-                outData);
-
-        if (acquireFence >= 0 && !ret) {
-            close(acquireFence);
-        }
-    }
-
-    return (ret) ? GRALLOC1_ERROR_NO_RESOURCES : GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_lock_flex(struct gralloc1_device* device,
-        buffer_handle_t buffer,
-        uint64_t producerUsage, uint64_t consumerUsage,
-        const gralloc1_rect_t* accessRegion,
-        struct android_flex_layout* outFlexLayout,
-        int32_t acquireFence)
-{
-    const struct gralloc1_adapter_module* mod =
-        gralloc1_adapter_module(device);
-    const int usage = (int) (producerUsage | consumerUsage);
-    const struct gralloc1_adapter_buffer_data* data =
-        lookup_buffer_data(device, buffer);
-    struct android_ycbcr ycbcr;
-    int ret;
-
-    if (!data) {
-        ALOGE("unable to lockFlex unregistered buffer %p", buffer);
-        return GRALLOC1_ERROR_BAD_HANDLE;
-    }
-
-    if (outFlexLayout->num_planes < data->info.num_flex_planes) {
-        return GRALLOC1_ERROR_BAD_VALUE;
-    }
-
-    if (mod->adapter.real_module_api_version >=
-            GRALLOC_MODULE_API_VERSION_0_3 && mod->base.lockAsync_ycbcr) {
-        ret = mod->base.lockAsync_ycbcr(&mod->base,
-                buffer, usage,
-                accessRegion->left,
-                accessRegion->top,
-                accessRegion->width,
-                accessRegion->height,
-                &ycbcr, acquireFence);
-    } else if (mod->base.lock_ycbcr) {
-        if (acquireFence >= 0) {
-            sync_wait(acquireFence, -1);
-        }
-
-        ret = mod->base.lock_ycbcr(&mod->base,
-                buffer, usage,
-                accessRegion->left,
-                accessRegion->top,
-                accessRegion->width,
-                accessRegion->height,
-                &ycbcr);
-
-        if (acquireFence >= 0 && !ret) {
-            close(acquireFence);
-        }
-    } else {
-        return GRALLOC1_ERROR_UNSUPPORTED;
-    }
-
-    if (ret) {
-        return GRALLOC1_ERROR_NO_RESOURCES;
-    }
-
-    mod->adapter.get_flexible_layout(&mod->base, buffer,
-            &ycbcr, outFlexLayout);
-
-    return GRALLOC1_ERROR_NONE;
-}
-
-static int32_t device_unlock(struct gralloc1_device* device,
-        buffer_handle_t buffer, int32_t* outReleaseFence)
-{
-    const struct gralloc1_adapter_module* mod =
-        gralloc1_adapter_module(device);
-    int ret;
-
-    if (mod->adapter.real_module_api_version >=
-            GRALLOC_MODULE_API_VERSION_0_3) {
-        ret = mod->base.unlockAsync(&mod->base, buffer, outReleaseFence);
-    } else {
-        ret = mod->base.unlock(&mod->base, buffer);
-        if (!ret) {
-            *outReleaseFence = -1;
-        }
-    }
-
-    return (ret) ? GRALLOC1_ERROR_BAD_HANDLE : GRALLOC1_ERROR_NONE;
-}
-
-static gralloc1_function_pointer_t device_get_function(
-        struct gralloc1_device* device, int32_t descriptor)
-{
-    switch ((gralloc1_function_descriptor_t) descriptor) {
-#define CASE(id, ptr)              \
-    case GRALLOC1_FUNCTION_ ## id: \
-        return (gralloc1_function_pointer_t) device_ ## ptr
-    CASE(DUMP, dump);
-    CASE(CREATE_DESCRIPTOR, create_descriptor);
-    CASE(DESTROY_DESCRIPTOR, destroy_descriptor);
-    CASE(SET_CONSUMER_USAGE, set_consumer_usage);
-    CASE(SET_DIMENSIONS, set_dimensions);
-    CASE(SET_FORMAT, set_format);
-    CASE(SET_PRODUCER_USAGE, set_producer_usage);
-    CASE(GET_BACKING_STORE, get_backing_store);
-    CASE(GET_CONSUMER_USAGE, get_consumer_usage);
-    CASE(GET_DIMENSIONS, get_dimensions);
-    CASE(GET_FORMAT, get_format);
-    CASE(GET_PRODUCER_USAGE, get_producer_usage);
-    CASE(GET_STRIDE, get_stride);
-    CASE(ALLOCATE, allocate);
-    CASE(RETAIN, retain);
-    CASE(RELEASE, release);
-    CASE(GET_NUM_FLEX_PLANES, get_num_flex_planes);
-    CASE(LOCK, lock);
-    CASE(LOCK_FLEX, lock_flex);
-    CASE(UNLOCK, unlock);
-#undef CASE
-    default: return NULL;
-    }
-}
-
-static void device_get_capabilities(struct gralloc1_device* device,
-        uint32_t* outCount, int32_t* outCapabilities)
-{
-    *outCount = 0;
-}
-
-static int device_close(struct hw_device_t* device)
-{
-    struct gralloc1_adapter_device* dev =
-        (struct gralloc1_adapter_device*) device;
-    int ret;
-
-    ret = dev->alloc_dev->common.close(&dev->alloc_dev->common);
-    if (!ret) {
-        free(dev);
-    }
-
-    return ret;
-}
-
-int gralloc1_adapter_device_open(const struct hw_module_t* module,
-        const char* id, struct hw_device_t** device)
-{
-    const struct gralloc1_adapter_module* mod =
-        (const struct gralloc1_adapter_module*) module;
-    struct alloc_device_t* alloc_dev;
-    struct gralloc1_adapter_device* dev;
-    int ret;
-
-    if (strcmp(id, GRALLOC_HARDWARE_MODULE_ID) != 0) {
-        ALOGE("unknown gralloc1 device id: %s", id);
-        return -EINVAL;
-    }
-
-    ret = module->methods->open(module, GRALLOC_HARDWARE_GPU0,
-            (struct hw_device_t**) &alloc_dev);
-    if (ret) {
-        return ret;
-    }
-
-    dev = malloc(sizeof(*dev));
-    if (!dev) {
-        alloc_dev->common.close(&alloc_dev->common);
-        return -ENOMEM;
-    }
-
-    *dev = (struct gralloc1_adapter_device) {
-        .base = {
-            .common = {
-                .tag = HARDWARE_DEVICE_TAG,
-                .version = HARDWARE_DEVICE_API_VERSION(0, 0),
-                .module = (struct hw_module_t*) mod,
-                .close = device_close,
-            },
-            .getCapabilities = device_get_capabilities,
-            .getFunction = device_get_function,
-        },
-        .alloc_dev = alloc_dev,
-    };
-
-    *device = (struct hw_device_t*) dev;
-
-    return 0;
-}
diff --git a/graphics/allocator/2.0/default/gralloc1-adapter.cpp b/graphics/allocator/2.0/default/gralloc1-adapter.cpp
new file mode 100644
index 0000000..fcc59cd
--- /dev/null
+++ b/graphics/allocator/2.0/default/gralloc1-adapter.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Gralloc1On0Adapter.h"
+#include "gralloc1-adapter.h"
+
+int gralloc1_adapter_device_open(const struct hw_module_t* module,
+        const char* id, struct hw_device_t** device)
+{
+    if (strcmp(id, GRALLOC_HARDWARE_MODULE_ID) != 0) {
+        ALOGE("unknown gralloc1 device id: %s", id);
+        return -EINVAL;
+    }
+
+    auto adapter_device = new android::hardware::Gralloc1On0Adapter(module);
+    *device = &adapter_device->common;
+
+    return 0;
+}
diff --git a/graphics/allocator/2.0/default/gralloc1-adapter.h b/graphics/allocator/2.0/default/gralloc1-adapter.h
index f48cd9e..b912ef6 100644
--- a/graphics/allocator/2.0/default/gralloc1-adapter.h
+++ b/graphics/allocator/2.0/default/gralloc1-adapter.h
@@ -16,52 +16,69 @@
 #ifndef ANDROID_HARDWARE_GRALLOC1_ADAPTER_H
 #define ANDROID_HARDWARE_GRALLOC1_ADAPTER_H
 
-#include <stdbool.h>
-#include <hardware/gralloc.h>
+#include <hardware/hardware.h>
 
 __BEGIN_DECLS
 
-struct gralloc1_adapter_buffer_info {
-    int width;
-    int height;
-    int format;
-    int usage;
+#define GRALLOC1_ADAPTER_MODULE_API_VERSION_1_0 \
+    HARDWARE_MODULE_API_VERSION(1, 0)
 
-    int stride;
-    uint32_t num_flex_planes;
-};
+enum {
+    GRALLOC1_ADAPTER_PERFORM_FIRST = 10000,
 
-/* This struct must be embedded in the HAL's HAL_MODULE_INFO_SYM and must
- * follow gralloc_module_t immediately. */
-struct gralloc1_adapter {
-    uint16_t real_module_api_version;
+    // void getRealModuleApiVersionMinor(..., int* outMinorVersion);
+    GRALLOC1_ADAPTER_PERFORM_GET_REAL_MODULE_API_VERSION_MINOR =
+        GRALLOC1_ADAPTER_PERFORM_FIRST,
 
-    /* Return true if the buffer is registered.  A locally allocated buffer is
-     * always registered.
-     *
-     * This function is called frequently.  It must be thread safe just like
-     * other functions are.
-     */
-    bool (*is_registered)(const struct gralloc_module_t* mod,
-            buffer_handle_t buffer);
+    // void setUsages(..., buffer_handle_t buffer,
+    //                     int producerUsage,
+    //                     int consumerUsage);
+    GRALLOC1_ADAPTER_PERFORM_SET_USAGES =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 1,
 
-    /* Set the adapter data for a registered buffer. */
-    void (*set_data)(const struct gralloc_module_t* mod,
-            buffer_handle_t buffer, void* data);
+    // void getDimensions(..., buffer_handle_t buffer,
+    //                         int* outWidth,
+    //                         int* outHeight);
+    GRALLOC1_ADAPTER_PERFORM_GET_DIMENSIONS =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 2,
 
-    /* Get the adapter data for a registered buffer. */
-    void* (*get_data)(const struct gralloc_module_t* mod,
-            buffer_handle_t buffer);
+    // void getFormat(..., buffer_handle_t buffer, int* outFormat);
+    GRALLOC1_ADAPTER_PERFORM_GET_FORMAT =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 3,
 
-    /* Get the buffer info, such as width, height, etc. */
-    void (*get_info)(const struct gralloc_module_t* mod,
-            buffer_handle_t buffer,
-            struct gralloc1_adapter_buffer_info* info);
+    // void getProducerUsage(..., buffer_handle_t buffer, int* outUsage);
+    GRALLOC1_ADAPTER_PERFORM_GET_PRODUCER_USAGE =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 4,
 
-    /* Get the flexilble layout matching ycbcr. */
-    void (*get_flexible_layout)(const struct gralloc_module_t* mod,
-            buffer_handle_t buffer, const struct android_ycbcr* ycbcr,
-            struct android_flex_layout* layout);
+    // void getConsumerUsage(..., buffer_handle_t buffer, int* outUsage);
+    GRALLOC1_ADAPTER_PERFORM_GET_CONSUMER_USAGE =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 5,
+
+    // void getBackingStore(..., buffer_handle_t buffer,
+    //                           uint64_t* outBackingStore);
+    GRALLOC1_ADAPTER_PERFORM_GET_BACKING_STORE =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 6,
+
+    // void getNumFlexPlanes(..., buffer_handle_t buffer,
+    //                            int* outNumFlexPlanes);
+    GRALLOC1_ADAPTER_PERFORM_GET_NUM_FLEX_PLANES =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 7,
+
+    // void getStride(..., buffer_handle_t buffer, int* outStride);
+    GRALLOC1_ADAPTER_PERFORM_GET_STRIDE =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 8,
+
+    // void lockFlex(..., buffer_handle_t buffer,
+    //                    int producerUsage,
+    //                    int consumerUsage,
+    //                    int left,
+    //                    int top,
+    //                    int width,
+    //                    int height,
+    //                    android_flex_layout* outLayout,
+    //                    int acquireFence);
+    GRALLOC1_ADAPTER_PERFORM_LOCK_FLEX =
+        GRALLOC1_ADAPTER_PERFORM_FIRST + 9,
 };
 
 int gralloc1_adapter_device_open(const struct hw_module_t* module,
diff --git a/graphics/allocator/2.0/types.hal b/graphics/allocator/2.0/types.hal
index 6081db9..f9d1e1b 100644
--- a/graphics/allocator/2.0/types.hal
+++ b/graphics/allocator/2.0/types.hal
@@ -30,23 +30,23 @@
 enum ProducerUsage : uint64_t {
     /* bit 0 is reserved */
 
-    /* buffer will be read by CPU occasionally */
+    /* buffer is read by CPU occasionally */
     CPU_READ        = 1ULL << 1,
-    /* buffer will be read by CPU frequently */
+    /* buffer is read by CPU frequently */
     CPU_READ_OFTEN  = 1ULL << 2,
 
     /* bit 3 is reserved */
     /* bit 4 is reserved */
 
-    /* buffer will be written by CPU occasionally */
+    /* buffer is written by CPU occasionally */
     CPU_WRITE       = 1ULL << 5,
-    /* buffer will be written by CPU frequently */
+    /* buffer is written by CPU frequently */
     CPU_WRITE_OFTEN = 1ULL << 6,
 
     /* bit 7 is reserved */
     /* bit 8 is reserved */
 
-    /* buffer will be used as a GPU render target */
+    /* buffer is used as a GPU render target */
     GPU_RENDER_TARGET = 1ULL << 9,
 
     /* bit 10 is reserved */
@@ -64,7 +64,7 @@
     /* bit 15 is reserved */
     /* bit 16 is reserved */
 
-    /* buffer will be used as a camera HAL output */
+    /* buffer is used as a camera HAL output */
     CAMERA            = 1ULL << 17,
 
     /* bit 18 is reserved */
@@ -72,10 +72,13 @@
     /* bit 20 is reserved */
     /* bit 21 is reserved */
 
-    /* buffer will be used as a video decoder output */
+    /* buffer is used as a video decoder output */
     VIDEO_DECODER     = 1ULL << 22,
 
-    /* bits 23-27 are reserved for future versions */
+    /* buffer is used as a sensor direct report output */
+    SENSOR_DIRECT_DATA = 1ULL << 23,
+
+    /* bits 24-27 are reserved for future versions */
     /* bits 28-31 are reserved for vendor extensions */
 
     /* bits 32-47 are reserved for future versions */
@@ -85,9 +88,9 @@
 enum ConsumerUsage : uint64_t {
     /* bit 0 is reserved */
 
-    /* buffer will be read by CPU occasionally */
+    /* buffer is read by CPU occasionally */
     CPU_READ          = 1ULL << 1,
-    /* buffer will be read by CPU frequently */
+    /* buffer is read by CPU frequently */
     CPU_READ_OFTEN    = 1ULL << 2,
 
     /* bit 3 is reserved */
@@ -96,40 +99,44 @@
     /* bit 6 is reserved */
     /* bit 7 is reserved */
 
-    /* buffer will be used as a GPU texture */
+    /* buffer is used as a GPU texture */
     GPU_TEXTURE       = 1ULL << 8,
 
     /* bit 9 is reserved */
     /* bit 10 is reserved */
 
-    /* buffer will be used by hwcomposer HAL */
+    /* buffer is used by hwcomposer HAL */
     HWCOMPOSER        = 1ULL << 11,
-    /* buffer will be as a hwcomposer HAL client target */
+    /* buffer is a hwcomposer HAL client target */
     CLIENT_TARGET     = 1ULL << 12,
 
     /* bit 13 is reserved */
     /* bit 14 is reserved */
 
-    /* buffer will be used as a hwcomposer HAL cursor */
+    /* buffer is used as a hwcomposer HAL cursor */
     CURSOR            = 1ULL << 15,
 
-    /* buffer will be used as a video encoder input */
+    /* buffer is used as a video encoder input */
     VIDEO_ENCODER     = 1ULL << 16,
 
     /* bit 17 is reserved */
 
-    /* buffer will be used as a camera HAL input */
+    /* buffer is used as a camera HAL input */
     CAMERA            = 1ULL << 18,
 
     /* bit 19 is reserved */
 
-    /* buffer will be used as a renderscript allocation */
+    /* buffer is used as a renderscript allocation */
     RENDERSCRIPT      = 1ULL << 20,
 
     /* bit 21 is reserved */
     /* bit 22 is reserved */
 
-    /* bits 23-27 are reserved for future versions */
+    /* buffer is used as as an OpenGL shader storage or uniform
+       buffer object */
+    GPU_DATA_BUFFER    = 1ULL << 23,
+
+    /* bits 24-27 are reserved for future versions */
     /* bits 28-31 are reserved for vendor extensions */
 
     /* bits 32-47 are reserved for future versions */
diff --git a/graphics/allocator/2.0/vts/Allocator.vts b/graphics/allocator/2.0/vts/Allocator.vts
index 04d4314..e767cbd 100644
--- a/graphics/allocator/2.0/vts/Allocator.vts
+++ b/graphics/allocator/2.0/vts/Allocator.vts
@@ -4,6 +4,7 @@
 
 package: "android.hardware.graphics.allocator"
 
+import: "android.hardware.graphics.allocator@2.0::IAllocatorClient"
 import: "android.hardware.graphics.allocator@2.0::types"
 
 interface: {
@@ -21,36 +22,10 @@
             scalar_value: {
                 int32_t: 1
             }
-        }
-    }
-
-    attribute: {
-        name: "::android::hardware::graphics::allocator::V2_0::IAllocator::BufferDescriptorInfo"
-        type: TYPE_STRUCT
-        struct_value: {
-            name: "width"
-            type: TYPE_SCALAR
-            scalar_type: "uint32_t"
-        }
-        struct_value: {
-            name: "height"
-            type: TYPE_SCALAR
-            scalar_type: "uint32_t"
-        }
-        struct_value: {
-            name: "format"
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::PixelFormat"
-        }
-        struct_value: {
-            name: "producerUsageMask"
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        struct_value: {
-            name: "consumerUsageMask"
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
+            enumerator: "LAYERED_BUFFERS"
+            scalar_value: {
+                int32_t: 2
+            }
         }
     }
 
@@ -91,18 +66,15 @@
     }
 
     api: {
-        name: "createDescriptor"
+        name: "createClient"
         return_type_hidl: {
             type: TYPE_ENUM
             predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
         }
         return_type_hidl: {
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        arg: {
-            type: TYPE_STRUCT
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::IAllocator::BufferDescriptorInfo"
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IAllocatorClient"
+            is_callback: false
         }
         callflow: {
             entry: true
@@ -112,104 +84,4 @@
         }
     }
 
-    api: {
-        name: "destroyDescriptor"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        callflow: {
-            exit: true
-        }
-        callflow: {
-            next: "*"
-        }
-    }
-
-    api: {
-        name: "testAllocate"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
-        }
-        arg: {
-            type: TYPE_VECTOR
-            vector_value: {
-                type: TYPE_SCALAR
-                scalar_type: "uint64_t"
-            }
-        }
-        callflow: {
-            next: "allocate"
-        }
-    }
-
-    api: {
-        name: "allocate"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
-        }
-        return_type_hidl: {
-            type: TYPE_VECTOR
-            vector_value: {
-                type: TYPE_SCALAR
-                scalar_type: "uint64_t"
-            }
-        }
-        arg: {
-            type: TYPE_VECTOR
-            vector_value: {
-                type: TYPE_SCALAR
-                scalar_type: "uint64_t"
-            }
-        }
-        callflow: {
-            next: "exportHandle"
-        }
-    }
-
-    api: {
-        name: "free"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        callflow: {
-            exit: true
-        }
-        callflow: {
-            next: "*"
-        }
-    }
-
-    api: {
-        name: "exportHandle"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
-        }
-        return_type_hidl: {
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint64_t"
-        }
-        callflow: {
-            next: "free"
-        }
-    }
-
 }
diff --git a/graphics/allocator/2.0/vts/AllocatorClient.vts b/graphics/allocator/2.0/vts/AllocatorClient.vts
new file mode 100644
index 0000000..2ab19f7
--- /dev/null
+++ b/graphics/allocator/2.0/vts/AllocatorClient.vts
@@ -0,0 +1,635 @@
+component_class: HAL_HIDL
+component_type_version: 2.0
+component_name: "IAllocatorClient"
+
+package: "android.hardware.graphics.allocator"
+
+import: "android.hardware.graphics.allocator@2.0::types"
+import: "android.hardware.graphics.common@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::PixelFormat"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "RGBA_8888"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "RGBX_8888"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "RGB_888"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "RGB_565"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "BGRA_8888"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "RGBA_FP16"
+            scalar_value: {
+                int32_t: 22
+            }
+            enumerator: "YV12"
+            scalar_value: {
+                int32_t: 842094169
+            }
+            enumerator: "Y8"
+            scalar_value: {
+                int32_t: 538982489
+            }
+            enumerator: "Y16"
+            scalar_value: {
+                int32_t: 540422489
+            }
+            enumerator: "RAW16"
+            scalar_value: {
+                int32_t: 32
+            }
+            enumerator: "RAW10"
+            scalar_value: {
+                int32_t: 37
+            }
+            enumerator: "RAW12"
+            scalar_value: {
+                int32_t: 38
+            }
+            enumerator: "RAW_OPAQUE"
+            scalar_value: {
+                int32_t: 36
+            }
+            enumerator: "BLOB"
+            scalar_value: {
+                int32_t: 33
+            }
+            enumerator: "IMPLEMENTATION_DEFINED"
+            scalar_value: {
+                int32_t: 34
+            }
+            enumerator: "YCBCR_420_888"
+            scalar_value: {
+                int32_t: 35
+            }
+            enumerator: "YCBCR_422_888"
+            scalar_value: {
+                int32_t: 39
+            }
+            enumerator: "YCBCR_444_888"
+            scalar_value: {
+                int32_t: 40
+            }
+            enumerator: "FLEX_RGB_888"
+            scalar_value: {
+                int32_t: 41
+            }
+            enumerator: "FLEX_RGBA_8888"
+            scalar_value: {
+                int32_t: 42
+            }
+            enumerator: "YCBCR_422_SP"
+            scalar_value: {
+                int32_t: 16
+            }
+            enumerator: "YCRCB_420_SP"
+            scalar_value: {
+                int32_t: 17
+            }
+            enumerator: "YCBCR_422_I"
+            scalar_value: {
+                int32_t: 20
+            }
+            enumerator: "JPEG"
+            scalar_value: {
+                int32_t: 256
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::Transform"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "FLIP_H"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "FLIP_V"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ROT_90"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ROT_180"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ROT_270"
+            scalar_value: {
+                int32_t: 7
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::Dataspace"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "UNKNOWN"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ARBITRARY"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "STANDARD_SHIFT"
+            scalar_value: {
+                int32_t: 16
+            }
+            enumerator: "STANDARD_MASK"
+            scalar_value: {
+                int32_t: 4128768
+            }
+            enumerator: "STANDARD_UNSPECIFIED"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "STANDARD_BT709"
+            scalar_value: {
+                int32_t: 65536
+            }
+            enumerator: "STANDARD_BT601_625"
+            scalar_value: {
+                int32_t: 131072
+            }
+            enumerator: "STANDARD_BT601_625_UNADJUSTED"
+            scalar_value: {
+                int32_t: 196608
+            }
+            enumerator: "STANDARD_BT601_525"
+            scalar_value: {
+                int32_t: 262144
+            }
+            enumerator: "STANDARD_BT601_525_UNADJUSTED"
+            scalar_value: {
+                int32_t: 327680
+            }
+            enumerator: "STANDARD_BT2020"
+            scalar_value: {
+                int32_t: 393216
+            }
+            enumerator: "STANDARD_BT2020_CONSTANT_LUMINANCE"
+            scalar_value: {
+                int32_t: 458752
+            }
+            enumerator: "STANDARD_BT470M"
+            scalar_value: {
+                int32_t: 524288
+            }
+            enumerator: "STANDARD_FILM"
+            scalar_value: {
+                int32_t: 589824
+            }
+            enumerator: "STANDARD_DCI_P3"
+            scalar_value: {
+                int32_t: 655360
+            }
+            enumerator: "STANDARD_ADOBE_RGB"
+            scalar_value: {
+                int32_t: 720896
+            }
+            enumerator: "TRANSFER_SHIFT"
+            scalar_value: {
+                int32_t: 22
+            }
+            enumerator: "TRANSFER_MASK"
+            scalar_value: {
+                int32_t: 130023424
+            }
+            enumerator: "TRANSFER_UNSPECIFIED"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "TRANSFER_LINEAR"
+            scalar_value: {
+                int32_t: 4194304
+            }
+            enumerator: "TRANSFER_SRGB"
+            scalar_value: {
+                int32_t: 8388608
+            }
+            enumerator: "TRANSFER_SMPTE_170M"
+            scalar_value: {
+                int32_t: 12582912
+            }
+            enumerator: "TRANSFER_GAMMA2_2"
+            scalar_value: {
+                int32_t: 16777216
+            }
+            enumerator: "TRANSFER_GAMMA2_6"
+            scalar_value: {
+                int32_t: 20971520
+            }
+            enumerator: "TRANSFER_GAMMA2_8"
+            scalar_value: {
+                int32_t: 25165824
+            }
+            enumerator: "TRANSFER_ST2084"
+            scalar_value: {
+                int32_t: 29360128
+            }
+            enumerator: "TRANSFER_HLG"
+            scalar_value: {
+                int32_t: 33554432
+            }
+            enumerator: "RANGE_SHIFT"
+            scalar_value: {
+                int32_t: 27
+            }
+            enumerator: "RANGE_MASK"
+            scalar_value: {
+                int32_t: 939524096
+            }
+            enumerator: "RANGE_UNSPECIFIED"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "RANGE_FULL"
+            scalar_value: {
+                int32_t: 134217728
+            }
+            enumerator: "RANGE_LIMITED"
+            scalar_value: {
+                int32_t: 268435456
+            }
+            enumerator: "RANGE_EXTENDED"
+            scalar_value: {
+                int32_t: 402653184
+            }
+            enumerator: "SRGB_LINEAR"
+            scalar_value: {
+                int32_t: 512
+            }
+            enumerator: "V0_SRGB_LINEAR"
+            scalar_value: {
+                int32_t: 138477568
+            }
+            enumerator: "V0_SCRGB_LINEAR"
+            scalar_value: {
+                int32_t: 406913024
+            }
+            enumerator: "SRGB"
+            scalar_value: {
+                int32_t: 513
+            }
+            enumerator: "V0_SRGB"
+            scalar_value: {
+                int32_t: 142671872
+            }
+            enumerator: "V0_SCRGB"
+            scalar_value: {
+                int32_t: 411107328
+            }
+            enumerator: "JFIF"
+            scalar_value: {
+                int32_t: 257
+            }
+            enumerator: "V0_JFIF"
+            scalar_value: {
+                int32_t: 146931712
+            }
+            enumerator: "BT601_625"
+            scalar_value: {
+                int32_t: 258
+            }
+            enumerator: "V0_BT601_625"
+            scalar_value: {
+                int32_t: 281149440
+            }
+            enumerator: "BT601_525"
+            scalar_value: {
+                int32_t: 259
+            }
+            enumerator: "V0_BT601_525"
+            scalar_value: {
+                int32_t: 281280512
+            }
+            enumerator: "BT709"
+            scalar_value: {
+                int32_t: 260
+            }
+            enumerator: "V0_BT709"
+            scalar_value: {
+                int32_t: 281083904
+            }
+            enumerator: "DCI_P3_LINEAR"
+            scalar_value: {
+                int32_t: 139067392
+            }
+            enumerator: "DCI_P3"
+            scalar_value: {
+                int32_t: 155844608
+            }
+            enumerator: "DISPLAY_P3_LINEAR"
+            scalar_value: {
+                int32_t: 139067392
+            }
+            enumerator: "DISPLAY_P3"
+            scalar_value: {
+                int32_t: 143261696
+            }
+            enumerator: "ADOBE_RGB"
+            scalar_value: {
+                int32_t: 151715840
+            }
+            enumerator: "BT2020_LINEAR"
+            scalar_value: {
+                int32_t: 138805248
+            }
+            enumerator: "BT2020"
+            scalar_value: {
+                int32_t: 147193856
+            }
+            enumerator: "DEPTH"
+            scalar_value: {
+                int32_t: 4096
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::ColorMode"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "NATIVE"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "STANDARD_BT601_625"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "STANDARD_BT601_625_UNADJUSTED"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "STANDARD_BT601_525"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "STANDARD_BT601_525_UNADJUSTED"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "STANDARD_BT709"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "DCI_P3"
+            scalar_value: {
+                int32_t: 6
+            }
+            enumerator: "SRGB"
+            scalar_value: {
+                int32_t: 7
+            }
+            enumerator: "ADOBE_RGB"
+            scalar_value: {
+                int32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::ColorTransform"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "IDENTITY"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ARBITRARY_MATRIX"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "VALUE_INVERSE"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "GRAYSCALE"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "CORRECT_PROTANOPIA"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "CORRECT_DEUTERANOPIA"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "CORRECT_TRITANOPIA"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::common::V1_0::Hdr"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "DOLBY_VISION"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "HDR10"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "HLG"
+            scalar_value: {
+                int32_t: 3
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::graphics::allocator::V2_0::IAllocatorClient::BufferDescriptorInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "width"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "height"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "layerCount"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "format"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::common::V1_0::PixelFormat"
+        }
+        struct_value: {
+            name: "producerUsageMask"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        struct_value: {
+            name: "consumerUsageMask"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "createDescriptor"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::IAllocatorClient::BufferDescriptorInfo"
+        }
+        callflow: {
+            entry: true
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "destroyDescriptor"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            exit: true
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "testAllocate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint64_t"
+            }
+        }
+        callflow: {
+            next: "allocate"
+        }
+    }
+
+    api: {
+        name: "allocate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint64_t"
+            }
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint64_t"
+            }
+        }
+        callflow: {
+            next: "exportHandle"
+        }
+    }
+
+    api: {
+        name: "free"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            exit: true
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "exportHandle"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_HANDLE
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            next: "free"
+        }
+    }
+
+}
diff --git a/boot/Android.mk b/graphics/allocator/2.0/vts/Android.mk
similarity index 86%
copy from boot/Android.mk
copy to graphics/allocator/2.0/vts/Android.mk
index f9e3276..00fd344 100644
--- a/boot/Android.mk
+++ b/graphics/allocator/2.0/vts/Android.mk
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(LOCAL_PATH)/functional/vts/testcases/hal/graphics/allocator/hidl/target/Android.mk
diff --git a/graphics/allocator/2.0/vts/functional/Android.bp b/graphics/allocator/2.0/vts/functional/Android.bp
index e1966dc..194b228 100644
--- a/graphics/allocator/2.0/vts/functional/Android.bp
+++ b/graphics/allocator/2.0/vts/functional/Android.bp
@@ -31,7 +31,11 @@
     ],
     static_libs: ["libgtest"],
     cflags: [
+        "--coverage",
         "-O0",
         "-g",
     ],
+    ldflags: [
+        "--coverage",
+    ],
 }
diff --git a/graphics/allocator/2.0/vts/functional/graphics_allocator_hidl_hal_test.cpp b/graphics/allocator/2.0/vts/functional/graphics_allocator_hidl_hal_test.cpp
index 22131ee..a0443d6 100644
--- a/graphics/allocator/2.0/vts/functional/graphics_allocator_hidl_hal_test.cpp
+++ b/graphics/allocator/2.0/vts/functional/graphics_allocator_hidl_hal_test.cpp
@@ -129,7 +129,7 @@
     }
   });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 }
 
 TEST_F(GraphicsAllocatorHidlTest, DumpDebugInfo) {
@@ -137,7 +137,7 @@
     // nothing to do
   });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 }
 
 TEST_F(GraphicsAllocatorHidlTest, CreateDestroyDescriptor) {
@@ -150,11 +150,11 @@
         descriptor = tmpDescriptor;
       });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ASSERT_EQ(Error::NONE, error);
 
   auto err_ret = mClient->destroyDescriptor(descriptor);
-  ASSERT_TRUE(err_ret.getStatus().isOk());
+  ASSERT_TRUE(err_ret.isOk());
   ASSERT_EQ(Error::NONE, static_cast<Error>(err_ret));
 }
 
@@ -172,7 +172,7 @@
   descriptors[0] = descriptor;
 
   auto ret = mClient->testAllocate(descriptors);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 
   auto error = static_cast<Error>(ret);
   ASSERT_TRUE(error == Error::NONE || error == Error::NOT_SHARED);
@@ -193,7 +193,7 @@
   descriptors[1] = descriptor;
 
   auto ret = mClient->testAllocate(descriptors);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 
   auto error = static_cast<Error>(ret);
   ASSERT_TRUE(error == Error::NONE || error == Error::NOT_SHARED);
@@ -218,13 +218,13 @@
         buffers = tmpBuffers;
       });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ASSERT_TRUE(error == Error::NONE || error == Error::NOT_SHARED);
   EXPECT_EQ(1u, buffers.size());
 
   if (!buffers.empty()) {
     auto err_ret = mClient->free(buffers[0]);
-    EXPECT_TRUE(err_ret.getStatus().isOk());
+    EXPECT_TRUE(err_ret.isOk());
     EXPECT_EQ(Error::NONE, static_cast<Error>(err_ret));
   }
 }
@@ -253,13 +253,13 @@
         buffers = tmpBuffers;
       });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ASSERT_TRUE(error == Error::NONE || error == Error::NOT_SHARED);
   EXPECT_EQ(descriptors.size(), buffers.size());
 
   for (auto buf : buffers) {
     auto err_ret = mClient->free(buf);
-    EXPECT_TRUE(err_ret.getStatus().isOk());
+    EXPECT_TRUE(err_ret.isOk());
     EXPECT_EQ(Error::NONE, static_cast<Error>(err_ret));
   }
 }
@@ -280,18 +280,18 @@
         buffers = tmpBuffers;
       });
 
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ASSERT_TRUE(error == Error::NONE || error == Error::NOT_SHARED);
   ASSERT_EQ(1u, buffers.size());
 
   ret = mClient->exportHandle(
       descriptors[0], buffers[0],
       [&](const auto& tmpError, const auto&) { error = tmpError; });
-  EXPECT_TRUE(ret.getStatus().isOk());
+  EXPECT_TRUE(ret.isOk());
   EXPECT_EQ(Error::NONE, error);
 
   auto err_ret = mClient->free(buffers[0]);
-  EXPECT_TRUE(err_ret.getStatus().isOk());
+  EXPECT_TRUE(err_ret.isOk());
   EXPECT_EQ(Error::NONE, static_cast<Error>(err_ret));
 }
 
diff --git a/boot/Android.mk b/graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/Android.mk
index f9e3276..2c1617f 100644
--- a/boot/Android.mk
+++ b/graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalGraphicsAllocatorHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/graphics/allocator/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/AndroidTest.xml b/graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..4ef2e95
--- /dev/null
+++ b/graphics/allocator/2.0/vts/functional/vts/testcases/hal/graphics/allocator/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Graphics Allocator HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalGraphicsAllocatorHidlTargetTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/graphics_allocator_hidl_hal_test/graphics_allocator_hidl_hal_test,
+            _64bit::DATA/nativetest64/graphics_allocator_hidl_hal_test/graphics_allocator_hidl_hal_test,
+	    " />
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+    </test>
+</configuration>
diff --git a/graphics/allocator/2.0/vts/types.vts b/graphics/allocator/2.0/vts/types.vts
index ac1bf3f..2b7e47a 100644
--- a/graphics/allocator/2.0/vts/types.vts
+++ b/graphics/allocator/2.0/vts/types.vts
@@ -132,100 +132,3 @@
     }
 }
 
-attribute: {
-    name: "::android::hardware::graphics::allocator::V2_0::PixelFormat"
-    type: TYPE_ENUM
-    enum_value: {
-        scalar_type: "int32_t"
-
-        enumerator: "RGBA_8888"
-        scalar_value: {
-            int32_t: 1
-        }
-        enumerator: "RGBX_8888"
-        scalar_value: {
-            int32_t: 2
-        }
-        enumerator: "RGB_888"
-        scalar_value: {
-            int32_t: 3
-        }
-        enumerator: "RGB_565"
-        scalar_value: {
-            int32_t: 4
-        }
-        enumerator: "BGRA_8888"
-        scalar_value: {
-            int32_t: 5
-        }
-        enumerator: "YV12"
-        scalar_value: {
-            int32_t: 842094169
-        }
-        enumerator: "Y8"
-        scalar_value: {
-            int32_t: 538982489
-        }
-        enumerator: "Y16"
-        scalar_value: {
-            int32_t: 540422489
-        }
-        enumerator: "RAW16"
-        scalar_value: {
-            int32_t: 32
-        }
-        enumerator: "RAW10"
-        scalar_value: {
-            int32_t: 37
-        }
-        enumerator: "RAW12"
-        scalar_value: {
-            int32_t: 38
-        }
-        enumerator: "RAW_OPAQUE"
-        scalar_value: {
-            int32_t: 36
-        }
-        enumerator: "BLOB"
-        scalar_value: {
-            int32_t: 33
-        }
-        enumerator: "IMPLEMENTATION_DEFINED"
-        scalar_value: {
-            int32_t: 34
-        }
-        enumerator: "YCbCr_420_888"
-        scalar_value: {
-            int32_t: 35
-        }
-        enumerator: "YCbCr_422_888"
-        scalar_value: {
-            int32_t: 39
-        }
-        enumerator: "YCbCr_444_888"
-        scalar_value: {
-            int32_t: 40
-        }
-        enumerator: "FLEX_RGB_888"
-        scalar_value: {
-            int32_t: 41
-        }
-        enumerator: "FLEX_RGBA_8888"
-        scalar_value: {
-            int32_t: 42
-        }
-        enumerator: "YCbCr_422_SP"
-        scalar_value: {
-            int32_t: 16
-        }
-        enumerator: "YCrCb_420_SP"
-        scalar_value: {
-            int32_t: 17
-        }
-        enumerator: "YCbCr_422_I"
-        scalar_value: {
-            int32_t: 20
-        }
-    }
-}
-
diff --git a/vibrator/Android.mk b/graphics/allocator/Android.mk
similarity index 100%
rename from vibrator/Android.mk
rename to graphics/allocator/Android.mk
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index e20fedc..ebdba77 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -928,10 +928,6 @@
      * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
      * Values beyond the range [0.0 - 1.0] would correspond to other colors
      * spaces and/or HDR content.
-     *
-     * TODO (courtneygo): Will we actually use this? We intend to use FP16
-     * storage for data using scRGB so we can do all work in linear space
-     * and don't have to worry as much about limited precision.
      */
     V0_SCRGB = STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED,
 
@@ -1015,6 +1011,24 @@
 
 
     /*
+     * Display P3
+     *
+     * Display P3 uses same primaries and white-point as DCI-P3
+     * linear transfer function makes this the same as DCI_P3_LINEAR.
+     */
+    DISPLAY_P3_LINEAR = STANDARD_DCI_P3 | TRANSFER_LINEAR | RANGE_FULL,
+
+
+    /*
+     * Display P3
+     *
+     * Use same primaries and white-point as DCI-P3
+     * but sRGB transfer function.
+     */
+    DISPLAY_P3 = STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL,
+
+
+    /*
      * Adobe RGB
      *
      * Use full range, gamma 2.2 transfer and Adobe RGB primaries
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index 26c7739..7216c0f 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -32,18 +32,18 @@
         "android/hardware/graphics/composer/2.1/types.h",
         "android/hardware/graphics/composer/2.1/IComposer.h",
         "android/hardware/graphics/composer/2.1/IHwComposer.h",
-        "android/hardware/graphics/composer/2.1/BnComposer.h",
-        "android/hardware/graphics/composer/2.1/BpComposer.h",
+        "android/hardware/graphics/composer/2.1/BnHwComposer.h",
+        "android/hardware/graphics/composer/2.1/BpHwComposer.h",
         "android/hardware/graphics/composer/2.1/BsComposer.h",
         "android/hardware/graphics/composer/2.1/IComposerCallback.h",
         "android/hardware/graphics/composer/2.1/IHwComposerCallback.h",
-        "android/hardware/graphics/composer/2.1/BnComposerCallback.h",
-        "android/hardware/graphics/composer/2.1/BpComposerCallback.h",
+        "android/hardware/graphics/composer/2.1/BnHwComposerCallback.h",
+        "android/hardware/graphics/composer/2.1/BpHwComposerCallback.h",
         "android/hardware/graphics/composer/2.1/BsComposerCallback.h",
         "android/hardware/graphics/composer/2.1/IComposerClient.h",
         "android/hardware/graphics/composer/2.1/IHwComposerClient.h",
-        "android/hardware/graphics/composer/2.1/BnComposerClient.h",
-        "android/hardware/graphics/composer/2.1/BpComposerClient.h",
+        "android/hardware/graphics/composer/2.1/BnHwComposerClient.h",
+        "android/hardware/graphics/composer/2.1/BpHwComposerClient.h",
         "android/hardware/graphics/composer/2.1/BsComposerClient.h",
     ],
 }
diff --git a/graphics/composer/2.1/default/HwcClient.cpp b/graphics/composer/2.1/default/HwcClient.cpp
index 8c2dd6d..54dfd89 100644
--- a/graphics/composer/2.1/default/HwcClient.cpp
+++ b/graphics/composer/2.1/default/HwcClient.cpp
@@ -176,9 +176,9 @@
             mRelease(mDevice, handle);
         } else {
             mModule->unregisterBuffer(mModule, handle);
-            native_handle_close(handle);
-            native_handle_delete(const_cast<native_handle_t*>(handle));
         }
+        native_handle_close(handle);
+        native_handle_delete(const_cast<native_handle_t*>(handle));
     }
 
     // gralloc1
diff --git a/graphics/composer/2.1/default/IComposerCommandBuffer.h b/graphics/composer/2.1/default/IComposerCommandBuffer.h
index 7e14f19..65e7799 100644
--- a/graphics/composer/2.1/default/IComposerCommandBuffer.h
+++ b/graphics/composer/2.1/default/IComposerCommandBuffer.h
@@ -686,8 +686,7 @@
             uint16_t* outLength)
     {
         if (mCommandEnd) {
-            LOG_FATAL("endCommand was not called before command 0x%x",
-                    command);
+            LOG_FATAL("endCommand was not called for last command");
         }
 
         constexpr uint32_t opcode_mask =
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 9ac6d50..4adccb9 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/graphics/mapper/2.0/types.h",
         "android/hardware/graphics/mapper/2.0/IMapper.h",
         "android/hardware/graphics/mapper/2.0/IHwMapper.h",
-        "android/hardware/graphics/mapper/2.0/BnMapper.h",
-        "android/hardware/graphics/mapper/2.0/BpMapper.h",
+        "android/hardware/graphics/mapper/2.0/BnHwMapper.h",
+        "android/hardware/graphics/mapper/2.0/BpHwMapper.h",
         "android/hardware/graphics/mapper/2.0/BsMapper.h",
     ],
 }
diff --git a/audio/Android.mk b/graphics/mapper/2.0/Android.mk
similarity index 100%
copy from audio/Android.mk
copy to graphics/mapper/2.0/Android.mk
diff --git a/graphics/mapper/2.0/default/Android.bp b/graphics/mapper/2.0/default/Android.bp
index 02ed877..c3d2281 100644
--- a/graphics/mapper/2.0/default/Android.bp
+++ b/graphics/mapper/2.0/default/Android.bp
@@ -19,6 +19,7 @@
     srcs: ["GrallocMapper.cpp"],
     cppflags: ["-Wall", "-Wextra"],
     shared_libs: [
+        "android.hardware.graphics.allocator@2.0",
         "android.hardware.graphics.mapper@2.0",
         "libbase",
         "libcutils",
diff --git a/graphics/mapper/2.0/default/GrallocMapper.cpp b/graphics/mapper/2.0/default/GrallocMapper.cpp
index cd9db38..3b6460a 100644
--- a/graphics/mapper/2.0/default/GrallocMapper.cpp
+++ b/graphics/mapper/2.0/default/GrallocMapper.cpp
@@ -17,7 +17,9 @@
 
 #include "GrallocMapper.h"
 
+#include <mutex>
 #include <vector>
+#include <unordered_map>
 
 #include <string.h>
 
@@ -100,6 +102,9 @@
         GRALLOC1_PFN_LOCK_FLEX lockFlex;
         GRALLOC1_PFN_UNLOCK unlock;
     } mDispatch;
+
+    std::mutex mMutex;
+    std::unordered_map<buffer_handle_t, size_t> mBufferReferenceCounts;
 };
 
 GrallocMapperHal::GrallocMapperHal(const hw_module_t* module)
@@ -201,12 +206,34 @@
 Return<Error> GrallocMapperHal::retain(const hidl_handle& bufferHandle)
 {
     int32_t err = mDispatch.retain(mDevice, bufferHandle);
+    if (err == GRALLOC1_ERROR_NONE) {
+        auto nativeHandle = bufferHandle.getNativeHandle();
+        std::lock_guard<std::mutex> lock(mMutex);
+
+        ++mBufferReferenceCounts[nativeHandle];
+    }
     return static_cast<Error>(err);
 }
 
 Return<Error> GrallocMapperHal::release(const hidl_handle& bufferHandle)
 {
     int32_t err = mDispatch.release(mDevice, bufferHandle);
+    if (err == GRALLOC1_ERROR_NONE) {
+        auto nativeHandle = bufferHandle.getNativeHandle();
+        std::lock_guard<std::mutex> lock(mMutex);
+
+        auto iter = mBufferReferenceCounts.find(bufferHandle);
+        if (iter == mBufferReferenceCounts.end()) {
+            // this should never happen
+            err = GRALLOC1_ERROR_BAD_HANDLE;
+        } else if (--iter->second == 0) {
+            native_handle_close(nativeHandle);
+            native_handle_delete(const_cast<native_handle_t*>(nativeHandle));
+
+            mBufferReferenceCounts.erase(iter);
+        }
+    }
+
     return static_cast<Error>(err);
 }
 
diff --git a/boot/Android.mk b/graphics/mapper/2.0/vts/Android.mk
similarity index 87%
rename from boot/Android.mk
rename to graphics/mapper/2.0/vts/Android.mk
index f9e3276..6185ddc 100644
--- a/boot/Android.mk
+++ b/graphics/mapper/2.0/vts/Android.mk
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(LOCAL_PATH)/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
diff --git a/graphics/mapper/2.0/vts/Mapper.vts b/graphics/mapper/2.0/vts/Mapper.vts
new file mode 100644
index 0000000..26e049f
--- /dev/null
+++ b/graphics/mapper/2.0/vts/Mapper.vts
@@ -0,0 +1,280 @@
+component_class: HAL_HIDL
+component_type_version: 2.0
+component_name: "IMapper"
+
+package: "android.hardware.graphics.mapper"
+
+import: "android.hardware.graphics.allocator@2.0::types"
+import: "android.hardware.graphics.common@1.0::types"
+import: "android.hardware.graphics.mapper@2.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "left"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "top"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "width"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "height"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "retain"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            entry: true
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "release"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            exit: true
+        }
+    }
+
+    api: {
+        name: "getDimensions"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getFormat"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::common::V1_0::PixelFormat"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getLayerCount"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getProducerUsageMask"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getConsumerUsageMask"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getBackingStore"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getStride"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "lock"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_POINTER
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "unlock"
+        }
+    }
+
+    api: {
+        name: "lockFlex"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexLayout"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "unlock"
+        }
+    }
+
+    api: {
+        name: "unlock"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+        }
+        return_type_hidl: {
+            type: TYPE_HANDLE
+        }
+        arg: {
+            type: TYPE_HANDLE
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+}
diff --git a/graphics/mapper/2.0/vts/functional/Android.bp b/graphics/mapper/2.0/vts/functional/Android.bp
new file mode 100644
index 0000000..27ea350
--- /dev/null
+++ b/graphics/mapper/2.0/vts/functional/Android.bp
@@ -0,0 +1,44 @@
+//
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "graphics_mapper_hidl_hal_test",
+    gtest: true,
+    srcs: ["graphics_mapper_hidl_hal_test.cpp"],
+    shared_libs: [
+        "libbase",
+        "liblog",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libnativehelper",
+        "libsync",
+        "libutils",
+        "android.hardware.graphics.allocator@2.0",
+        "android.hardware.graphics.mapper@2.0",
+        "android.hardware.graphics.common@1.0",
+    ],
+    static_libs: ["libgtest"],
+    cflags: [
+        "--coverage",
+        "-O0",
+        "-g",
+    ],
+    ldflags: [
+        "--coverage",
+    ],
+}
diff --git a/graphics/mapper/2.0/vts/functional/graphics_mapper_hidl_hal_test.cpp b/graphics/mapper/2.0/vts/functional/graphics_mapper_hidl_hal_test.cpp
new file mode 100644
index 0000000..840da1a
--- /dev/null
+++ b/graphics/mapper/2.0/vts/functional/graphics_mapper_hidl_hal_test.cpp
@@ -0,0 +1,315 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "graphics_mapper_hidl_hal_test"
+
+#include <android-base/logging.h>
+#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/2.0/IMapper.h>
+#include <gtest/gtest.h>
+#include <sync/sync.h>
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace mapper {
+namespace V2_0 {
+namespace tests {
+namespace {
+
+using namespace android::hardware::graphics::allocator::V2_0;
+using namespace android::hardware::graphics::common::V1_0;
+
+class GraphicsMapperHidlTest : public ::testing::Test {
+ protected:
+  void SetUp() override {
+    mAllocator = IAllocator::getService("gralloc");
+    ASSERT_NE(mAllocator, nullptr);
+
+    mAllocator->createClient([this](const auto& error, const auto& client) {
+      if (error == Error::NONE) {
+        mAllocatorClient = client;
+      }
+    });
+    ASSERT_NE(mAllocatorClient, nullptr);
+
+    mMapper = IMapper::getService("gralloc-mapper");
+    ASSERT_NE(nullptr, mMapper.get());
+    ASSERT_FALSE(mMapper->isRemote());
+
+    mDummyDescriptorInfo.width = 64;
+    mDummyDescriptorInfo.height = 64;
+    mDummyDescriptorInfo.layerCount = 1;
+    mDummyDescriptorInfo.format = PixelFormat::RGBA_8888;
+    mDummyDescriptorInfo.producerUsageMask =
+        static_cast<uint64_t>(ProducerUsage::CPU_WRITE);
+    mDummyDescriptorInfo.consumerUsageMask =
+        static_cast<uint64_t>(ConsumerUsage::CPU_READ);
+  }
+
+  void TearDown() override {}
+
+  const native_handle_t* allocate(
+      const IAllocatorClient::BufferDescriptorInfo& info) {
+    // create descriptor
+    Error err = Error::NO_RESOURCES;
+    BufferDescriptor descriptor;
+    mAllocatorClient->createDescriptor(
+        info, [&](const auto& tmpError, const auto& tmpDescriptor) {
+          err = tmpError;
+          descriptor = tmpDescriptor;
+        });
+    if (err != Error::NONE) {
+      return nullptr;
+    }
+
+    // allocate buffer
+    hidl_vec<BufferDescriptor> descriptors;
+    hidl_vec<Buffer> buffers;
+    descriptors.setToExternal(&descriptor, 1);
+    err = Error::NO_RESOURCES;
+    mAllocatorClient->allocate(
+        descriptors, [&](const auto& tmpError, const auto& tmpBuffers) {
+          err = tmpError;
+          buffers = tmpBuffers;
+        });
+    if ((err != Error::NONE && err != Error::NOT_SHARED) ||
+        buffers.size() != 1) {
+      mAllocatorClient->destroyDescriptor(descriptors[0]);
+      return nullptr;
+    }
+
+    // export handle
+    err = Error::NO_RESOURCES;
+    const native_handle_t* handle = nullptr;
+    mAllocatorClient->exportHandle(
+        descriptors[0], buffers[0],
+        [&](const auto& tmpError, const auto& tmpHandle) {
+          err = tmpError;
+          if (err != Error::NONE) {
+            return;
+          }
+
+          handle = native_handle_clone(tmpHandle);
+          if (!handle) {
+            err = Error::NO_RESOURCES;
+            return;
+          }
+
+          err = mMapper->retain(handle);
+          if (err != Error::NONE) {
+            native_handle_close(handle);
+            native_handle_delete(const_cast<native_handle_t*>(handle));
+            handle = nullptr;
+          }
+        });
+
+    mAllocatorClient->destroyDescriptor(descriptors[0]);
+    mAllocatorClient->free(buffers[0]);
+
+    if (err != Error::NONE) {
+      return nullptr;
+    }
+
+    return handle;
+  }
+
+  sp<IMapper> mMapper;
+
+  IAllocatorClient::BufferDescriptorInfo mDummyDescriptorInfo{};
+
+ private:
+  sp<IAllocator> mAllocator;
+  sp<IAllocatorClient> mAllocatorClient;
+};
+
+/**
+ * Test IMapper::retain and IMapper::release.
+ */
+TEST_F(GraphicsMapperHidlTest, RetainRelease) {
+  const native_handle_t* buffer = allocate(mDummyDescriptorInfo);
+  ASSERT_NE(buffer, nullptr);
+
+  const int maxRefs = 10;
+  for (int i = 0; i < maxRefs; i++) {
+    auto err = mMapper->retain(buffer);
+    EXPECT_EQ(Error::NONE, err);
+  }
+  for (int i = 0; i < maxRefs; i++) {
+    auto err = mMapper->release(buffer);
+    EXPECT_EQ(Error::NONE, err);
+  }
+
+  auto err = mMapper->release(buffer);
+  EXPECT_EQ(Error::NONE, err);
+}
+
+/**
+ * Test IMapper::get* getters.
+ */
+TEST_F(GraphicsMapperHidlTest, Getters) {
+  const native_handle_t* buffer = allocate(mDummyDescriptorInfo);
+  ASSERT_NE(buffer, nullptr);
+
+  Error err = Error::NO_RESOURCES;
+  IAllocatorClient::BufferDescriptorInfo info{};
+  mMapper->getDimensions(buffer, [&](const auto& tmpError, const auto& tmpWidth,
+                                     const auto& tmpHeight) {
+    err = tmpError;
+    info.width = tmpWidth;
+    info.height = tmpHeight;
+  });
+  EXPECT_EQ(Error::NONE, err);
+  mMapper->getFormat(buffer, [&](const auto& tmpError, const auto& tmpFormat) {
+    err = tmpError;
+    info.format = tmpFormat;
+  });
+  EXPECT_EQ(Error::NONE, err);
+  mMapper->getProducerUsageMask(
+      buffer, [&](const auto& tmpError, const auto& tmpUsage) {
+        err = tmpError;
+        info.producerUsageMask = tmpUsage;
+      });
+  EXPECT_EQ(Error::NONE, err);
+  mMapper->getConsumerUsageMask(
+      buffer, [&](const auto& tmpError, const auto& tmpUsage) {
+        err = tmpError;
+        info.consumerUsageMask = tmpUsage;
+      });
+  EXPECT_EQ(Error::NONE, err);
+
+  EXPECT_EQ(mDummyDescriptorInfo.width, info.width);
+  EXPECT_EQ(mDummyDescriptorInfo.height, info.height);
+  EXPECT_EQ(mDummyDescriptorInfo.format, info.format);
+  EXPECT_EQ(mDummyDescriptorInfo.producerUsageMask, info.producerUsageMask);
+  EXPECT_EQ(mDummyDescriptorInfo.consumerUsageMask, info.consumerUsageMask);
+
+  BackingStore store = 0;
+  mMapper->getBackingStore(buffer,
+                           [&](const auto& tmpError, const auto& tmpStore) {
+                             err = tmpError;
+                             store = tmpStore;
+                           });
+  EXPECT_EQ(Error::NONE, err);
+
+  uint32_t stride = 0;
+  mMapper->getStride(buffer, [&](const auto& tmpError, const auto& tmpStride) {
+    err = tmpError;
+    stride = tmpStride;
+  });
+  EXPECT_EQ(Error::NONE, err);
+  EXPECT_LE(info.width, stride);
+
+  err = mMapper->release(buffer);
+  EXPECT_EQ(Error::NONE, err);
+}
+
+/**
+ * Test IMapper::lock and IMapper::unlock.
+ */
+TEST_F(GraphicsMapperHidlTest, LockBasic) {
+  const auto& info = mDummyDescriptorInfo;
+  const native_handle_t* buffer = allocate(info);
+  ASSERT_NE(buffer, nullptr);
+
+  Error err = Error::NO_RESOURCES;
+  uint32_t stride = 0;
+  mMapper->getStride(buffer, [&](const auto& tmpError, const auto& tmpStride) {
+    err = tmpError;
+    stride = tmpStride;
+  });
+  EXPECT_EQ(Error::NONE, err);
+
+  // lock buffer for writing
+  const IMapper::Rect region{0, 0, static_cast<int32_t>(info.width),
+                             static_cast<int32_t>(info.height)};
+  hidl_handle acquireFence(nullptr);
+  uint32_t* data;
+  err = Error::NO_RESOURCES;
+  mMapper->lock(buffer, info.producerUsageMask, 0, region, acquireFence,
+          [&](const auto& tmpError, const auto& tmpData) {
+            err = tmpError;
+            data = static_cast<uint32_t*>(tmpData);
+          });
+
+  if (err == Error::NONE) {
+    for (uint32_t y = 0; y < info.height; y++) {
+      for (uint32_t x = 0; x < info.width; x++) {
+        data[stride * y + x] = info.height * y + x;
+      }
+    }
+  } else {
+    EXPECT_EQ(Error::NONE, err);
+  }
+
+  err = Error::NO_RESOURCES;
+  mMapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) {
+            err = tmpError;
+            auto handle = tmpReleaseFence.getNativeHandle();
+            if (handle && handle->numFds == 1) {
+                sync_wait(handle->data[0], -1);
+                close(handle->data[0]);
+            }
+          });
+  EXPECT_EQ(Error::NONE, err);
+
+  // lock buffer for reading
+  mMapper->lock(buffer, 0, info.consumerUsageMask, region, acquireFence,
+          [&](const auto& tmpError, const auto& tmpData) {
+            err = tmpError;
+            data = static_cast<uint32_t*>(tmpData);
+          });
+  if (err == Error::NONE) {
+    for (uint32_t y = 0; y < info.height; y++) {
+      for (uint32_t x = 0; x < info.width; x++) {
+        EXPECT_EQ(info.height * y + x, data[stride * y + x]);
+      }
+    }
+  } else {
+    EXPECT_EQ(Error::NONE, err);
+  }
+
+  err = Error::NO_RESOURCES;
+  mMapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) {
+            err = tmpError;
+            auto handle = tmpReleaseFence.getNativeHandle();
+            if (handle && handle->numFds == 1) {
+                sync_wait(handle->data[0], -1);
+                close(handle->data[0]);
+            }
+          });
+  EXPECT_EQ(Error::NONE, err);
+
+  err = mMapper->release(buffer);
+  EXPECT_EQ(Error::NONE, err);
+}
+
+}  // namespace anonymous
+}  // namespace tests
+}  // namespace V2_0
+}  // namespace mapper
+}  // namespace graphics
+}  // namespace hardware
+}  // namespace android
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+
+  int status = RUN_ALL_TESTS();
+  LOG(INFO) << "Test result = " << status;
+
+  return status;
+}
diff --git a/boot/Android.mk b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
index f9e3276..5f7fae8 100644
--- a/boot/Android.mk
+++ b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalGraphicsMapperHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/graphics/mapper/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..b602ec4
--- /dev/null
+++ b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Graphics Mapper HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalGraphicsMapperHidlTargetTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/graphics_mapper_hidl_hal_test/graphics_mapper_hidl_hal_test,
+            _64bit::DATA/nativetest64/graphics_mapper_hidl_hal_test/graphics_mapper_hidl_hal_test,
+	    " />
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+    </test>
+</configuration>
diff --git a/graphics/mapper/2.0/vts/types.vts b/graphics/mapper/2.0/vts/types.vts
new file mode 100644
index 0000000..fee8535
--- /dev/null
+++ b/graphics/mapper/2.0/vts/types.vts
@@ -0,0 +1,139 @@
+component_class: HAL_HIDL
+component_type_version: 2.0
+component_name: "types"
+
+package: "android.hardware.graphics.mapper"
+
+
+attribute: {
+    name: "::android::hardware::graphics::mapper::V2_0::FlexComponent"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "Y"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CB"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CR"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "R"
+        scalar_value: {
+            int32_t: 1024
+        }
+        enumerator: "G"
+        scalar_value: {
+            int32_t: 2048
+        }
+        enumerator: "B"
+        scalar_value: {
+            int32_t: 4096
+        }
+        enumerator: "A"
+        scalar_value: {
+            int32_t: 1073741824
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::graphics::mapper::V2_0::FlexFormat"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "INVALID"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "Y"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "YCBCR"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "YCBCRA"
+        scalar_value: {
+            int32_t: 1073741831
+        }
+        enumerator: "RGB"
+        scalar_value: {
+            int32_t: 7168
+        }
+        enumerator: "RGBA"
+        scalar_value: {
+            int32_t: 1073748992
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::graphics::mapper::V2_0::FlexPlane"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "topLeft"
+        type: TYPE_POINTER
+    }
+    struct_value: {
+        name: "component"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexComponent"
+    }
+    struct_value: {
+        name: "bitsPerComponent"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "bitsUsed"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "hIncrement"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "vIncrement"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "hSubsampling"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "vSubsampling"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::graphics::mapper::V2_0::FlexLayout"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "format"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexFormat"
+    }
+    struct_value: {
+        name: "planes"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexPlane"
+        }
+    }
+}
+
diff --git a/power/Android.mk b/graphics/mapper/Android.mk
similarity index 100%
rename from power/Android.mk
rename to graphics/mapper/Android.mk
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index f1738bd..b0b9549 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/health/1.0/types.h",
         "android/hardware/health/1.0/IHealth.h",
         "android/hardware/health/1.0/IHwHealth.h",
-        "android/hardware/health/1.0/BnHealth.h",
-        "android/hardware/health/1.0/BpHealth.h",
+        "android/hardware/health/1.0/BnHwHealth.h",
+        "android/hardware/health/1.0/BpHwHealth.h",
         "android/hardware/health/1.0/BsHealth.h",
     ],
 }
diff --git a/health/Android.mk b/health/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/health/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index 9badd6f..3a8fceb 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/ir/1.0/types.h",
         "android/hardware/ir/1.0/IConsumerIr.h",
         "android/hardware/ir/1.0/IHwConsumerIr.h",
-        "android/hardware/ir/1.0/BnConsumerIr.h",
-        "android/hardware/ir/1.0/BpConsumerIr.h",
+        "android/hardware/ir/1.0/BnHwConsumerIr.h",
+        "android/hardware/ir/1.0/BpHwConsumerIr.h",
         "android/hardware/ir/1.0/BsConsumerIr.h",
     ],
 }
diff --git a/ir/1.0/default/ConsumerIr.cpp b/ir/1.0/default/ConsumerIr.cpp
index 8cfb2e8..69a25cf 100644
--- a/ir/1.0/default/ConsumerIr.cpp
+++ b/ir/1.0/default/ConsumerIr.cpp
@@ -15,10 +15,12 @@
  */
 
 #define LOG_TAG "ConsumerIrService"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include <hardware/hardware.h>
 #include <hardware/consumerir.h>
+
 #include "ConsumerIr.h"
 
 namespace android {
@@ -61,13 +63,13 @@
 }
 
 
-IConsumerIr* HIDL_FETCH_IConsumerIr(const char *name) {
+IConsumerIr* HIDL_FETCH_IConsumerIr(const char * /*name*/) {
     consumerir_device_t *dev;
     const hw_module_t *hw_module = NULL;
 
-    int ret = hw_get_module(name, &hw_module);
+    int ret = hw_get_module(CONSUMERIR_HARDWARE_MODULE_ID, &hw_module);
     if (ret != 0) {
-        ALOGE("hw_get_module %s failed: %d", name, ret);
+        ALOGE("hw_get_module %s failed: %d", CONSUMERIR_HARDWARE_MODULE_ID, ret);
         return nullptr;
     }
     ret = hw_module->methods->open(hw_module, CONSUMERIR_TRANSMITTER, (hw_device_t **) &dev);
diff --git a/ir/1.0/default/service.cpp b/ir/1.0/default/service.cpp
index 237b2c9..10f6b7d 100644
--- a/ir/1.0/default/service.cpp
+++ b/ir/1.0/default/service.cpp
@@ -23,5 +23,5 @@
 using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-    return defaultPassthroughServiceImplementation<IConsumerIr>("consumerir");
+    return defaultPassthroughServiceImplementation<IConsumerIr>();
 }
diff --git a/keymaster/3.0/Android.bp b/keymaster/3.0/Android.bp
index 3c2034b..a8247e1 100644
--- a/keymaster/3.0/Android.bp
+++ b/keymaster/3.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/keymaster/3.0/types.h",
         "android/hardware/keymaster/3.0/IKeymasterDevice.h",
         "android/hardware/keymaster/3.0/IHwKeymasterDevice.h",
-        "android/hardware/keymaster/3.0/BnKeymasterDevice.h",
-        "android/hardware/keymaster/3.0/BpKeymasterDevice.h",
+        "android/hardware/keymaster/3.0/BnHwKeymasterDevice.h",
+        "android/hardware/keymaster/3.0/BpHwKeymasterDevice.h",
         "android/hardware/keymaster/3.0/BsKeymasterDevice.h",
     ],
 }
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index 0ad131c..118be88 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/light/2.0/types.h",
         "android/hardware/light/2.0/ILight.h",
         "android/hardware/light/2.0/IHwLight.h",
-        "android/hardware/light/2.0/BnLight.h",
-        "android/hardware/light/2.0/BpLight.h",
+        "android/hardware/light/2.0/BnHwLight.h",
+        "android/hardware/light/2.0/BpHwLight.h",
         "android/hardware/light/2.0/BsLight.h",
     ],
 }
diff --git a/light/2.0/default/Light.cpp b/light/2.0/default/Light.cpp
index f52c6af..cde1536 100644
--- a/light/2.0/default/Light.cpp
+++ b/light/2.0/default/Light.cpp
@@ -15,7 +15,8 @@
  */
 
 #define LOG_TAG "light"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "Light.h"
 
diff --git a/light/2.0/vts/functional/light_hidl_hal_test.cpp b/light/2.0/vts/functional/light_hidl_hal_test.cpp
index 9912079..9b9f543 100644
--- a/light/2.0/vts/functional/light_hidl_hal_test.cpp
+++ b/light/2.0/vts/functional/light_hidl_hal_test.cpp
@@ -36,8 +36,8 @@
 
 #define LIGHT_SERVICE_NAME "light"
 
-#define ASSERT_OK(ret) ASSERT_TRUE(ret.getStatus().isOk())
-#define EXPECT_OK(ret) EXPECT_TRUE(ret.getStatus().isOk())
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
 
 class LightHidlTest : public ::testing::Test {
 public:
diff --git a/boot/Android.mk b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk
similarity index 78%
copy from boot/Android.mk
copy to light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk
index f9e3276..939929d 100644
--- a/boot/Android.mk
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := LightHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/light/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..455802d
--- /dev/null
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Light HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="LightHidlTargetProfilingTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/light_hidl_hal_test/light_hidl_hal_test,
+            _64bit::DATA/nativetest64/light_hidl_hal_test/light_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
+
diff --git a/light/Android.mk b/light/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/light/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index 56fc8a7..657c23b 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -38,28 +38,28 @@
         "android/hardware/media/omx/1.0/types.h",
         "android/hardware/media/omx/1.0/IGraphicBufferSource.h",
         "android/hardware/media/omx/1.0/IHwGraphicBufferSource.h",
-        "android/hardware/media/omx/1.0/BnGraphicBufferSource.h",
-        "android/hardware/media/omx/1.0/BpGraphicBufferSource.h",
+        "android/hardware/media/omx/1.0/BnHwGraphicBufferSource.h",
+        "android/hardware/media/omx/1.0/BpHwGraphicBufferSource.h",
         "android/hardware/media/omx/1.0/BsGraphicBufferSource.h",
         "android/hardware/media/omx/1.0/IOmx.h",
         "android/hardware/media/omx/1.0/IHwOmx.h",
-        "android/hardware/media/omx/1.0/BnOmx.h",
-        "android/hardware/media/omx/1.0/BpOmx.h",
+        "android/hardware/media/omx/1.0/BnHwOmx.h",
+        "android/hardware/media/omx/1.0/BpHwOmx.h",
         "android/hardware/media/omx/1.0/BsOmx.h",
         "android/hardware/media/omx/1.0/IOmxBufferSource.h",
         "android/hardware/media/omx/1.0/IHwOmxBufferSource.h",
-        "android/hardware/media/omx/1.0/BnOmxBufferSource.h",
-        "android/hardware/media/omx/1.0/BpOmxBufferSource.h",
+        "android/hardware/media/omx/1.0/BnHwOmxBufferSource.h",
+        "android/hardware/media/omx/1.0/BpHwOmxBufferSource.h",
         "android/hardware/media/omx/1.0/BsOmxBufferSource.h",
         "android/hardware/media/omx/1.0/IOmxNode.h",
         "android/hardware/media/omx/1.0/IHwOmxNode.h",
-        "android/hardware/media/omx/1.0/BnOmxNode.h",
-        "android/hardware/media/omx/1.0/BpOmxNode.h",
+        "android/hardware/media/omx/1.0/BnHwOmxNode.h",
+        "android/hardware/media/omx/1.0/BpHwOmxNode.h",
         "android/hardware/media/omx/1.0/BsOmxNode.h",
         "android/hardware/media/omx/1.0/IOmxObserver.h",
         "android/hardware/media/omx/1.0/IHwOmxObserver.h",
-        "android/hardware/media/omx/1.0/BnOmxObserver.h",
-        "android/hardware/media/omx/1.0/BpOmxObserver.h",
+        "android/hardware/media/omx/1.0/BnHwOmxObserver.h",
+        "android/hardware/media/omx/1.0/BpHwOmxObserver.h",
         "android/hardware/media/omx/1.0/BsOmxObserver.h",
     ],
 }
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 87342ef..36e7594 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/memtrack/1.0/types.h",
         "android/hardware/memtrack/1.0/IMemtrack.h",
         "android/hardware/memtrack/1.0/IHwMemtrack.h",
-        "android/hardware/memtrack/1.0/BnMemtrack.h",
-        "android/hardware/memtrack/1.0/BpMemtrack.h",
+        "android/hardware/memtrack/1.0/BnHwMemtrack.h",
+        "android/hardware/memtrack/1.0/BpHwMemtrack.h",
         "android/hardware/memtrack/1.0/BsMemtrack.h",
     ],
 }
diff --git a/memtrack/1.0/default/Memtrack.cpp b/memtrack/1.0/default/Memtrack.cpp
index b93227f..5c1a5c4 100644
--- a/memtrack/1.0/default/Memtrack.cpp
+++ b/memtrack/1.0/default/Memtrack.cpp
@@ -15,11 +15,14 @@
  */
 
 #define LOG_TAG "android.hardware.memtrack@1.0-impl"
+
+#include <log/log.h>
+
 #include <hardware/hardware.h>
 #include <hardware/memtrack.h>
-#include <android/log.h>
 
 #include "Memtrack.h"
+
 namespace android {
 namespace hardware {
 namespace memtrack {
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
index 7fb286b..9b00b4c 100644
--- a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
             _32bit::DATA/nativetest/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
             _64bit::DATA/nativetest64/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
             "/>
-        <option name="test-config-path" value="vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config" />
         <option name="binary-test-type" value="gtest" />
         <option name="test-timeout" value="5m" />
     </test>
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config
deleted file mode 100644
index d2597a2..0000000
--- a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "use_gae_db": true,
-    "coverage": true,
-    "modules": [
-        {
-            "module_name": "system/lib64/hw/memtrack.msm8992",
-            "git_project": {
-                "name": "platform/hardware/qcom/display",
-                "path": "hardware/qcom/display"
-            }
-        },
-        {
-            "module_name": "system/lib64/hw/android.hardware.memtrack@1.0-impl",
-            "git_project": {
-                "name": "platform/hardware/interfaces",
-                "path": "hardware/interfaces"
-            }
-        }
-    ]
-}
diff --git a/boot/Android.mk b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk
index f9e3276..d397621 100644
--- a/boot/Android.mk
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalMemtrackHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/memtrack/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..d813be1
--- /dev/null
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Memtrack HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalMemtrackHidlTargetProfilingTest"/>
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
+            _64bit::DATA/nativetest64/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="5m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/memtrack/Android.mk b/memtrack/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/memtrack/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index af571f3..0fda103 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/nfc/1.0/types.h",
         "android/hardware/nfc/1.0/INfc.h",
         "android/hardware/nfc/1.0/IHwNfc.h",
-        "android/hardware/nfc/1.0/BnNfc.h",
-        "android/hardware/nfc/1.0/BpNfc.h",
+        "android/hardware/nfc/1.0/BnHwNfc.h",
+        "android/hardware/nfc/1.0/BpHwNfc.h",
         "android/hardware/nfc/1.0/BsNfc.h",
         "android/hardware/nfc/1.0/INfcClientCallback.h",
         "android/hardware/nfc/1.0/IHwNfcClientCallback.h",
-        "android/hardware/nfc/1.0/BnNfcClientCallback.h",
-        "android/hardware/nfc/1.0/BpNfcClientCallback.h",
+        "android/hardware/nfc/1.0/BnHwNfcClientCallback.h",
+        "android/hardware/nfc/1.0/BpHwNfcClientCallback.h",
         "android/hardware/nfc/1.0/BsNfcClientCallback.h",
     ],
 }
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index 44c8e42..3bd5e41 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -1,5 +1,6 @@
 #define LOG_TAG "android.hardware.nfc@1.0-impl"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include <hardware/hardware.h>
 #include <hardware/nfc.h>
@@ -50,21 +51,21 @@
 }
 
 
-INfc* HIDL_FETCH_INfc(const char *hal) {
+INfc* HIDL_FETCH_INfc(const char * /*name*/) {
     nfc_nci_device_t* nfc_device;
     int ret = 0;
     const hw_module_t* hw_module = NULL;
 
-    ret = hw_get_module (hal, &hw_module);
+    ret = hw_get_module (NFC_NCI_HARDWARE_MODULE_ID, &hw_module);
     if (ret == 0)
     {
         ret = nfc_nci_open (hw_module, &nfc_device);
         if (ret != 0) {
-            ALOGE ("nfc_nci_open %s failed: %d", hal, ret);
+            ALOGE ("nfc_nci_open failed: %d", ret);
         }
     }
     else
-        ALOGE ("hw_get_module %s failed: %d", hal, ret);
+        ALOGE ("hw_get_module %s failed: %d", NFC_NCI_HARDWARE_MODULE_ID, ret);
 
     if (ret == 0) {
         return new Nfc(nfc_device);
diff --git a/nfc/1.0/default/service.cpp b/nfc/1.0/default/service.cpp
index 32f9c28..731acd5 100644
--- a/nfc/1.0/default/service.cpp
+++ b/nfc/1.0/default/service.cpp
@@ -9,5 +9,5 @@
 using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-    return defaultPassthroughServiceImplementation<INfc>("nfc_nci");
+    return defaultPassthroughServiceImplementation<INfc>();
 }
diff --git a/nfc/1.0/vts/Nfc.vts b/nfc/1.0/vts/Nfc.vts
index 5882bf5..9261a60 100644
--- a/nfc/1.0/vts/Nfc.vts
+++ b/nfc/1.0/vts/Nfc.vts
@@ -87,6 +87,13 @@
             next: "powerCycle"
             next: "controlGranted"
         }
+        callflow: {
+            next: "write"
+            next: "close"
+            next: "coreInitialized"
+            next: "powerCycle"
+            next: "controlGranted"
+        }
     }
 
     api: {
@@ -98,6 +105,9 @@
         callflow: {
             exit: true
         }
+        callflow: {
+            exit: true
+        }
     }
 
     api: {
@@ -113,6 +123,13 @@
             next: "coreInitialized"
             next: "powerCycle"
         }
+        callflow: {
+            next: "write"
+            next: "close"
+            next: "prediscover"
+            next: "coreInitialized"
+            next: "powerCycle"
+        }
     }
 
     api: {
@@ -128,6 +145,13 @@
             next: "controlGranted"
             next: "close"
         }
+        callflow: {
+            next: "write"
+            next: "coreInitialized"
+            next: "prediscover"
+            next: "controlGranted"
+            next: "close"
+        }
     }
 
 }
diff --git a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
index f5ed4d7..a50d88f 100644
--- a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
+++ b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
@@ -37,8 +37,6 @@
 using ::android::hardware::hidl_vec;
 using ::android::sp;
 
-#define NFC_NCI_SERVICE_NAME "nfc_nci"
-
 /* NCI Commands */
 #define CORE_RESET_CMD \
   { 0x20, 0x00, 0x01, 0x00 }
@@ -55,13 +53,11 @@
 #define VERSION 0x11
 #define TIMEOUT_PERIOD 5
 
-static bool passthrough = true;
-
 // The main test class for NFC HIDL HAL.
 class NfcHidlTest : public ::testing::Test {
  public:
   virtual void SetUp() override {
-    nfc_ = INfc::getService(NFC_NCI_SERVICE_NAME, passthrough);
+    nfc_ = INfc::getService();
     ASSERT_NE(nfc_, nullptr);
 
     nfc_cb_ = new NfcClientCallback(*this);
@@ -338,12 +334,6 @@
   ::testing::AddGlobalTestEnvironment(new NfcHidlEnvironment);
   ::testing::InitGoogleTest(&argc, argv);
 
-  for (int i = 0; i < argc; i++) {
-    if (strstr(argv[i], "passthrough=false") != nullptr) {
-      passthrough = false;
-      break;
-    }
-  }
   std::system("svc nfc disable"); /* Turn off NFC */
   sleep(5);
 
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
index 136704a..cb40931 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
@@ -22,6 +22,7 @@
 from vts.runners.host import base_test_with_webdb
 from vts.runners.host import test_runner
 from vts.utils.python.controllers import android_device
+from vts.utils.python.coverage import coverage_utils
 
 PASSTHROUGH_MODE_KEY = "passthrough_mode"
 
@@ -47,13 +48,13 @@
             self.dut.shell.one.Execute(
                 "setprop vts.hal.vts.hidl.get_stub false")
 
-        self.dut.hal.InitHidlHal(target_type="nfc",
-                                 target_basepaths=["/system/lib64"],
-                                 target_version=1.0,
-                                 target_package="android.hardware.nfc",
-                                 target_component_name="INfc",
-                                 hw_binder_service_name="nfc_nci",
-                                 bits=64)
+        self.dut.hal.InitHidlHal(
+            target_type="nfc",
+            target_basepaths=self.dut.libPaths,
+            target_version=1.0,
+            target_package="android.hardware.nfc",
+            target_component_name="INfc",
+            bits=64 if self.dut.is64Bit else 32)
 
     def tearDownClass(self):
         """Turns off the framework-layer NFC service."""
@@ -103,7 +104,7 @@
         result = self.dut.hal.nfc.close()
         logging.info("close result: %s", result)
 
-        self.SetCoverageData(self.dut.hal.nfc.GetRawCodeCoverage())
+        self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))
 
 if __name__ == "__main__":
     test_runner.main()
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
index c2429e0..9173e19 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
@@ -1,11 +1,3 @@
 {
-    "passthrough_mode": true,
-    "coverage": true,
-    "modules": [{
-                    "module_name": "system/lib64/hw/nfc_nci.bullhead",
-                    "git_project": {
-                        "name": "platform/system/nfc",
-                        "path": "system/nfc"
-                    }
-                }]
+    "passthrough_mode": true
 }
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
index ee02488..9576183 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
             _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
             _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
             "/>
-        <option name="test-config-path" value="vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config" />
         <option name="binary-test-type" value="gtest" />
         <option name="test-timeout" value="10m" />
     </test>
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
deleted file mode 100644
index e6b5a2c..0000000
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "coverage": true,
-    "modules": [{
-                    "module_name": "system/lib64/hw/nfc_nci.bullhead",
-                    "git_project": {
-                        "name": "platform/system/nfc",
-                        "path": "system/nfc"
-                    }
-                }]
-}
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
index da6cf22..42c7e22 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
@@ -25,7 +25,7 @@
             _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
             "/>
         <option name="binary-test-type" value="gtest" />
-        <option name="test-timeout" value="10m" />
+        <option name="test-timeout" value="20m" />
     <option name="enable-profiling" value="true" />
     </test>
 </configuration>
diff --git a/nfc/Android.mk b/nfc/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/nfc/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index 8643139..db8c721 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/power/1.0/types.h",
         "android/hardware/power/1.0/IPower.h",
         "android/hardware/power/1.0/IHwPower.h",
-        "android/hardware/power/1.0/BnPower.h",
-        "android/hardware/power/1.0/BpPower.h",
+        "android/hardware/power/1.0/BnHwPower.h",
+        "android/hardware/power/1.0/BpHwPower.h",
         "android/hardware/power/1.0/BsPower.h",
     ],
 }
diff --git a/power/1.0/default/Power.cpp b/power/1.0/default/Power.cpp
index 6453f33..656a2ae 100644
--- a/power/1.0/default/Power.cpp
+++ b/power/1.0/default/Power.cpp
@@ -15,9 +15,12 @@
  */
 
 #define LOG_TAG "android.hardware.power@1.0-impl"
+
+#include <log/log.h>
+
 #include <hardware/hardware.h>
 #include <hardware/power.h>
-#include <android/log.h>
+
 #include "Power.h"
 
 namespace android {
@@ -44,8 +47,12 @@
 
 Return<void> Power::powerHint(PowerHint hint, int32_t data)  {
     int32_t param = data;
-    if (mModule->powerHint > 0)
-        mModule->powerHint(mModule, static_cast<power_hint_t>(hint), &param);
+    if (mModule->powerHint > 0) {
+        if (data)
+            mModule->powerHint(mModule, static_cast<power_hint_t>(hint), &param);
+        else
+            mModule->powerHint(mModule, static_cast<power_hint_t>(hint), NULL);
+    }
     return Void();
 }
 
@@ -74,7 +81,9 @@
     number_platform_modes = mModule->get_number_of_platform_modes(mModule);
     if (number_platform_modes > 0)
     {
-       voters = new size_t [number_platform_modes];
+       if (SIZE_MAX / sizeof(size_t) <= number_platform_modes)  // overflow
+           goto done;
+       voters = new (std::nothrow) size_t [number_platform_modes];
        if (voters == nullptr)
            goto done;
 
@@ -82,7 +91,11 @@
        if (ret != 0)
            goto done;
 
-       legacy_states = new power_state_platform_sleep_state_t [number_platform_modes];
+       if (SIZE_MAX / sizeof(power_state_platform_sleep_state_t)
+           <= number_platform_modes)  // overflow
+           goto done;
+       legacy_states = new (std::nothrow)
+           power_state_platform_sleep_state_t [number_platform_modes];
        if (legacy_states == nullptr)
            goto done;
 
diff --git a/power/1.0/vts/functional/power_hidl_hal_test.cpp b/power/1.0/vts/functional/power_hidl_hal_test.cpp
index 045a34b..36bdb0a 100644
--- a/power/1.0/vts/functional/power_hidl_hal_test.cpp
+++ b/power/1.0/vts/functional/power_hidl_hal_test.cpp
@@ -49,10 +49,10 @@
   Return<void> ret;
 
   ret = power->setInteractive(true);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 
   ret = power->setInteractive(false);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 }
 
 // Sanity check Power::powerHint on good and bad inputs.
@@ -66,10 +66,10 @@
   Return<void> ret;
   for (auto hint : hints) {
     ret = power->powerHint(hint, 1);
-    ASSERT_TRUE(ret.getStatus().isOk());
+    ASSERT_TRUE(ret.isOk());
 
     ret = power->powerHint(hint, 0);
-    ASSERT_TRUE(ret.getStatus().isOk());
+    ASSERT_TRUE(ret.isOk());
   }
 }
 
@@ -77,15 +77,15 @@
 TEST_F(PowerHidlTest, SetFeature) {
   Return<void> ret;
   ret = power->setFeature(Feature::POWER_FEATURE_DOUBLE_TAP_TO_WAKE, true);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ret = power->setFeature(Feature::POWER_FEATURE_DOUBLE_TAP_TO_WAKE, false);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 
   Feature badFeature = static_cast<Feature>(0x2);
   ret = power->setFeature(badFeature, true);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ret = power->setFeature(badFeature, false);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
 }
 
 // Sanity check Power::getPlatformLowPowerStats().
@@ -98,7 +98,7 @@
     s = status;
   };
   Return<void> ret = power->getPlatformLowPowerStats(cb);
-  ASSERT_TRUE(ret.getStatus().isOk());
+  ASSERT_TRUE(ret.isOk());
   ASSERT_TRUE(s == Status::SUCCESS || s == Status::FILESYSTEM_ERROR);
 }
 
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
index 0eb2142..bb80de2 100644
--- a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
             _32bit::DATA/nativetest/power_hidl_hal_test/power_hidl_hal_test,
             _64bit::DATA/nativetest64/power_hidl_hal_test/power_hidl_hal_test,
             "/>
-        <option name="test-config-path" value="vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config" />
         <option name="binary-test-type" value="gtest" />
         <option name="test-timeout" value="1m" />
     </test>
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config
deleted file mode 100644
index 54c0175..0000000
--- a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config
+++ /dev/null
@@ -1,34 +0,0 @@
-{
-    "use_gae_db": true,
-    "coverage": true,
-    "modules": [
-        {
-            "module_name": "system/lib64/hw/power.bullhead",
-            "git_project": {
-                "name": "device/lge/bullhead",
-                "path": "device/lge/bullhead"
-            }
-        },
-        {
-            "module_name": "system/lib64/hw/power.marlin",
-            "git_project": {
-                "name": "device/google/marlin",
-                "path": "device/google/marlin"
-            }
-        },
-        {
-            "module_name": "system/lib64/hw/power.sailfish",
-            "git_project": {
-                "name": "device/google/marlin",
-                "path": "device/google/marlin"
-            }
-        },
-        {
-            "module_name": "system/lib64/hw/android.hardware.power@1.0-impl",
-            "git_project": {
-                "name": "platform/hardware/interfaces",
-                "path": "hardware/interfaces"
-            }
-        }
-    ]
-}
diff --git a/boot/Android.mk b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk
index f9e3276..6f9e399 100644
--- a/boot/Android.mk
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk
@@ -17,3 +17,10 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalPowerHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/power/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
+
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..263086c
--- /dev/null
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS Power HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalPowerHidlTargetProfilingTest"/>
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/power_hidl_hal_test/power_hidl_hal_test,
+            _64bit::DATA/nativetest64/power_hidl_hal_test/power_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 7f58452..e17d949 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -38,28 +38,28 @@
         "android/hardware/radio/1.0/types.h",
         "android/hardware/radio/1.0/IRadio.h",
         "android/hardware/radio/1.0/IHwRadio.h",
-        "android/hardware/radio/1.0/BnRadio.h",
-        "android/hardware/radio/1.0/BpRadio.h",
+        "android/hardware/radio/1.0/BnHwRadio.h",
+        "android/hardware/radio/1.0/BpHwRadio.h",
         "android/hardware/radio/1.0/BsRadio.h",
         "android/hardware/radio/1.0/IRadioIndication.h",
         "android/hardware/radio/1.0/IHwRadioIndication.h",
-        "android/hardware/radio/1.0/BnRadioIndication.h",
-        "android/hardware/radio/1.0/BpRadioIndication.h",
+        "android/hardware/radio/1.0/BnHwRadioIndication.h",
+        "android/hardware/radio/1.0/BpHwRadioIndication.h",
         "android/hardware/radio/1.0/BsRadioIndication.h",
         "android/hardware/radio/1.0/IRadioResponse.h",
         "android/hardware/radio/1.0/IHwRadioResponse.h",
-        "android/hardware/radio/1.0/BnRadioResponse.h",
-        "android/hardware/radio/1.0/BpRadioResponse.h",
+        "android/hardware/radio/1.0/BnHwRadioResponse.h",
+        "android/hardware/radio/1.0/BpHwRadioResponse.h",
         "android/hardware/radio/1.0/BsRadioResponse.h",
         "android/hardware/radio/1.0/ISap.h",
         "android/hardware/radio/1.0/IHwSap.h",
-        "android/hardware/radio/1.0/BnSap.h",
-        "android/hardware/radio/1.0/BpSap.h",
+        "android/hardware/radio/1.0/BnHwSap.h",
+        "android/hardware/radio/1.0/BpHwSap.h",
         "android/hardware/radio/1.0/BsSap.h",
         "android/hardware/radio/1.0/ISapCallback.h",
         "android/hardware/radio/1.0/IHwSapCallback.h",
-        "android/hardware/radio/1.0/BnSapCallback.h",
-        "android/hardware/radio/1.0/BpSapCallback.h",
+        "android/hardware/radio/1.0/BnHwSapCallback.h",
+        "android/hardware/radio/1.0/BpHwSapCallback.h",
         "android/hardware/radio/1.0/BsSapCallback.h",
     ],
 }
@@ -86,3 +86,302 @@
         "android.hidl.base@1.0",
     ],
 }
+
+genrule {
+    name: "android.hardware.radio.vts.driver@1.0_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "types.hal",
+        "IRadio.hal",
+        "IRadioIndication.hal",
+        "IRadioResponse.hal",
+        "ISap.hal",
+        "ISapCallback.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/types.vts.cpp",
+        "android/hardware/radio/1.0/Radio.vts.cpp",
+        "android/hardware/radio/1.0/RadioIndication.vts.cpp",
+        "android/hardware/radio/1.0/RadioResponse.vts.cpp",
+        "android/hardware/radio/1.0/Sap.vts.cpp",
+        "android/hardware/radio/1.0/SapCallback.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio.vts.driver@1.0_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "types.hal",
+        "IRadio.hal",
+        "IRadioIndication.hal",
+        "IRadioResponse.hal",
+        "ISap.hal",
+        "ISapCallback.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/types.vts.h",
+        "android/hardware/radio/1.0/Radio.vts.h",
+        "android/hardware/radio/1.0/RadioIndication.vts.h",
+        "android/hardware/radio/1.0/RadioResponse.vts.h",
+        "android/hardware/radio/1.0/Sap.vts.h",
+        "android/hardware/radio/1.0/SapCallback.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio.vts.driver@1.0",
+    generated_sources: ["android.hardware.radio.vts.driver@1.0_genc++"],
+    generated_headers: ["android.hardware.radio.vts.driver@1.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio.vts.driver@1.0_genc++_headers"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "libvts_common",
+        "libvts_datatype",
+        "libvts_measurement",
+        "libvts_multidevice_proto",
+        "libcamera_metadata",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+    export_shared_lib_headers: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hidl.base@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadio-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadio.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/Radio.vts.cpp",
+        "android/hardware/radio/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadio-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadio.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/Radio.vts.h",
+        "android/hardware/radio/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0-IRadio-vts.profiler",
+    generated_sources: ["android.hardware.radio@1.0-IRadio-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.radio@1.0-IRadio-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0-IRadio-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadioIndication-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadioIndication.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/RadioIndication.vts.cpp",
+        "android/hardware/radio/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadioIndication-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadioIndication.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/RadioIndication.vts.h",
+        "android/hardware/radio/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0-IRadioIndication-vts.profiler",
+    generated_sources: ["android.hardware.radio@1.0-IRadioIndication-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.radio@1.0-IRadioIndication-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0-IRadioIndication-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadioResponse-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadioResponse.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/RadioResponse.vts.cpp",
+        "android/hardware/radio/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-IRadioResponse-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "IRadioResponse.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/RadioResponse.vts.h",
+        "android/hardware/radio/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0-IRadioResponse-vts.profiler",
+    generated_sources: ["android.hardware.radio@1.0-IRadioResponse-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.radio@1.0-IRadioResponse-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0-IRadioResponse-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-ISap-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "ISap.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/Sap.vts.cpp",
+        "android/hardware/radio/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-ISap-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "ISap.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/Sap.vts.h",
+        "android/hardware/radio/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0-ISap-vts.profiler",
+    generated_sources: ["android.hardware.radio@1.0-ISap-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.radio@1.0-ISap-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0-ISap-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-ISapCallback-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "ISapCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/SapCallback.vts.cpp",
+        "android/hardware/radio/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0-ISapCallback-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
+    srcs: [
+        "ISapCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/SapCallback.vts.h",
+        "android/hardware/radio/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0-ISapCallback-vts.profiler",
+    generated_sources: ["android.hardware.radio@1.0-ISapCallback-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.radio@1.0-ISapCallback-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0-ISapCallback-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.radio@1.0",
+    ],
+}
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index 6475b4f..941a59e 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -821,11 +821,11 @@
 };
 
 enum CellInfoType : int32_t {
-    GSM,
-    CDMA,
-    LTE,
-    WCDMA,
-    TD_SCDMA
+    GSM = 1,
+    CDMA = 2,
+    LTE = 3,
+    WCDMA = 4,
+    TD_SCDMA = 5
 };
 
 enum TimeStampType : int32_t {
@@ -1089,8 +1089,7 @@
     int32_t gsmUmtsSubscriptionAppIndex;  // value < RadioConst:CARD_MAX_APPS, -1 if none
     int32_t cdmaSubscriptionAppIndex;     // value < RadioConst:CARD_MAX_APPS, -1 if none
     int32_t imsSubscriptionAppIndex;      // value < RadioConst:CARD_MAX_APPS, -1 if none
-    int32_t numApplications;              // value <= RadioConst:CARD_MAX_APPS
-    AppStatus[RadioConst:CARD_MAX_APPS] applications;
+    vec<AppStatus> applications;          // size <= RadioConst:CARD_MAX_APPS
 };
 
 /*
diff --git a/boot/Android.mk b/radio/1.0/vts/Android.mk
similarity index 82%
copy from boot/Android.mk
copy to radio/1.0/vts/Android.mk
index f9e3276..4e1fb84 100644
--- a/boot/Android.mk
+++ b/radio/1.0/vts/Android.mk
@@ -5,7 +5,7 @@
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
-#      http://www.apache.org/licenses/LICENSE-2.0
+#       http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(LOCAL_PATH)/functional/vts/testcases/hal/radio/hidl/Android.mk
\ No newline at end of file
diff --git a/radio/1.0/vts/Radio.vts b/radio/1.0/vts/Radio.vts
new file mode 100644
index 0000000..c3d998a
--- /dev/null
+++ b/radio/1.0/vts/Radio.vts
@@ -0,0 +1,1497 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IRadio"
+
+package: "android.hardware.radio"
+
+import: "android.hardware.radio@1.0::IRadioIndication"
+import: "android.hardware.radio@1.0::IRadioResponse"
+import: "android.hardware.radio@1.0::types"
+
+interface: {
+    api: {
+        name: "setResponseFunctions"
+        arg: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IRadioResponse"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IRadioIndication"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getIccCardStatus"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "supplyIccPinForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "supplyIccPukForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "supplyIccPin2ForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "supplyIccPuk2ForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "changeIccPinForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "changeIccPin2ForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "supplyNetworkDepersonalization"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getCurrentCalls"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "dial"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::Dial"
+        }
+    }
+
+    api: {
+        name: "getImsiForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "hangup"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "hangupWaitingOrBackground"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "hangupForegroundResumeBackground"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "switchWaitingOrHoldingAndActive"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "conference"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "rejectCall"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getLastCallFailCause"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getSignalStrength"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getVoiceRegistrationState"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getDataRegistrationState"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getOperator"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setRadioPower"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "sendDtmf"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "sendSms"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::GsmSmsMessage"
+        }
+    }
+
+    api: {
+        name: "sendSMSExpectMore"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::GsmSmsMessage"
+        }
+    }
+
+    api: {
+        name: "setupDataCall"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::ApnAuthType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "iccIOForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIo"
+        }
+    }
+
+    api: {
+        name: "sendUssd"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "cancelPendingUssd"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getClir"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setClir"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getCallForwardStatus"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CallForwardInfo"
+        }
+    }
+
+    api: {
+        name: "setCallForward"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CallForwardInfo"
+        }
+    }
+
+    api: {
+        name: "getCallWaiting"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setCallWaiting"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "acknowledgeLastIncomingGsmSms"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SmsAcknowledgeFailCause"
+        }
+    }
+
+    api: {
+        name: "acceptCall"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "deactivateDataCall"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getFacilityLockForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setFacilityLockForApp"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setBarringPassword"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getNetworkSelectionMode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setNetworkSelectionModeAutomatic"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setNetworkSelectionModeManual"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getAvailableNetworks"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "startDtmf"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "stopDtmf"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getBasebandVersion"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "separateConnection"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setMute"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getMute"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getClip"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getDataCallList"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "sendOemRadioRequestRaw"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "sendOemRadioRequestStrings"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "sendScreenState"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setSuppServiceNotifications"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "writeSmsToSim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SmsWriteArgs"
+        }
+    }
+
+    api: {
+        name: "deleteSmsOnSim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setBandMode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioBandMode"
+        }
+    }
+
+    api: {
+        name: "getAvailableBandModes"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "sendEnvelope"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "sendTerminalResponseToSim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "handleStkCallSetupRequestFromSim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "explicitCallTransfer"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setPreferredNetworkType"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::PreferredNetworkType"
+        }
+    }
+
+    api: {
+        name: "getPreferredNetworkType"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getNeighboringCids"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setLocationUpdates"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setCdmaSubscriptionSource"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSubscriptionSource"
+        }
+    }
+
+    api: {
+        name: "setCdmaRoamingPreference"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaRoamingType"
+        }
+    }
+
+    api: {
+        name: "getCdmaRoamingPreference"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setTTYMode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::TtyMode"
+        }
+    }
+
+    api: {
+        name: "getTTYMode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setPreferredVoicePrivacy"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getPreferredVoicePrivacy"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "sendCDMAFeatureCode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "sendBurstDtmf"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "sendCdmaSms"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSmsMessage"
+        }
+    }
+
+    api: {
+        name: "acknowledgeLastIncomingCdmaSms"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSmsAck"
+        }
+    }
+
+    api: {
+        name: "getGsmBroadcastConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setGsmBroadcastConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setGsmBroadcastActivation"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getCdmaBroadcastConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setCdmaBroadcastConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setCdmaBroadcastActivation"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getCDMASubscription"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "writeSmsToRuim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSmsWriteArgs"
+        }
+    }
+
+    api: {
+        name: "deleteSmsOnRuim"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getDeviceIdentity"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "exitEmergencyCallbackMode"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getSmscAddress"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setSmscAddress"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "reportSmsMemoryStatus"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "reportStkServiceIsRunning"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getCdmaSubscriptionSource"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "requestIsimAuthentication"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "acknowledgeIncomingGsmSmsWithPdu"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "sendEnvelopeWithStatus"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getVoiceRadioTechnology"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getCellInfoList"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setCellInfoListRate"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setInitialAttachApn"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::ApnAuthType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getImsRegistrationState"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "sendImsSms"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::ImsSmsMessage"
+        }
+    }
+
+    api: {
+        name: "iccTransmitApduBasicChannel"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SimApdu"
+        }
+    }
+
+    api: {
+        name: "iccOpenLogicalChannel"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "iccCloseLogicalChannel"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "iccTransmitApduLogicalChannel"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SimApdu"
+        }
+    }
+
+    api: {
+        name: "nvReadItem"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::NvItem"
+        }
+    }
+
+    api: {
+        name: "nvWriteItem"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::NvWriteItem"
+        }
+    }
+
+    api: {
+        name: "nvWriteCdmaPrl"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "nvResetConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::ResetNvType"
+        }
+    }
+
+    api: {
+        name: "setUiccSubscription"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SelectUiccSub"
+        }
+    }
+
+    api: {
+        name: "setDataAllowed"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getHardwareConfig"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "requestIccSimAuthentication"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setDataProfile"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::DataProfileInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "requestShutdown"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getRadioCapability"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setRadioCapability"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioCapability"
+        }
+    }
+
+    api: {
+        name: "startLceService"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "stopLceService"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "pullLceData"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getModemActivityInfo"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setAllowedCarriers"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CarrierRestrictions"
+        }
+    }
+
+    api: {
+        name: "getAllowedCarriers"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "responseAcknowledgement"
+    }
+
+}
diff --git a/radio/1.0/vts/RadioIndication.vts b/radio/1.0/vts/RadioIndication.vts
new file mode 100644
index 0000000..fac73a9
--- /dev/null
+++ b/radio/1.0/vts/RadioIndication.vts
@@ -0,0 +1,545 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IRadioIndication"
+
+package: "android.hardware.radio"
+
+import: "android.hardware.radio@1.0::types"
+
+interface: {
+    api: {
+        name: "radioStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioState"
+        }
+    }
+
+    api: {
+        name: "callStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "voiceNetworkStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "newSms"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "newSmsStatusReport"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "newSmsOnSim"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "onUssd"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::UssdModeType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "nitzTimeReceived"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "currentSignalStrength"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SignalStrength"
+        }
+    }
+
+    api: {
+        name: "dataCallListChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::SetupDataCallResult"
+            }
+        }
+    }
+
+    api: {
+        name: "suppSvcNotify"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SuppSvcNotification"
+        }
+    }
+
+    api: {
+        name: "stkSessionEnd"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "stkProactiveCommand"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "stkEventNotify"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "stkCallSetup"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int64_t"
+        }
+    }
+
+    api: {
+        name: "simSmsStorageFull"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "simRefresh"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SimRefreshResult"
+        }
+    }
+
+    api: {
+        name: "callRing"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSignalInfoRecord"
+        }
+    }
+
+    api: {
+        name: "simStatusChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "cdmaNewSms"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSmsMessage"
+        }
+    }
+
+    api: {
+        name: "newBroadcastSms"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "cdmaRuimSmsStorageFull"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "restrictedStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::PhoneRestrictedState"
+        }
+    }
+
+    api: {
+        name: "enterEmergencyCallbackMode"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "cdmaCallWaiting"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaCallWaiting"
+        }
+    }
+
+    api: {
+        name: "cdmaOtaProvisionStatus"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaOtaProvisionStatus"
+        }
+    }
+
+    api: {
+        name: "cdmaInfoRec"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaInformationRecords"
+        }
+    }
+
+    api: {
+        name: "oemHookRaw"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "indicateRingbackTone"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "resendIncallMute"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "cdmaSubscriptionSourceChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSubscriptionSource"
+        }
+    }
+
+    api: {
+        name: "cdmaPrlChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "exitEmergencyCallbackMode"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "rilConnected"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "voiceRadioTechChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioTechnology"
+        }
+    }
+
+    api: {
+        name: "cellInfoList"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::CellInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "imsNetworkStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+    }
+
+    api: {
+        name: "subscriptionStatusChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "srvccStateNotify"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SrvccState"
+        }
+    }
+
+    api: {
+        name: "hardwareConfigChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::HardwareConfig"
+            }
+        }
+    }
+
+    api: {
+        name: "radioCapabilityIndication"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioCapability"
+        }
+    }
+
+    api: {
+        name: "onSupplementaryServiceIndication"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::StkCcUnsolSsResult"
+        }
+    }
+
+    api: {
+        name: "stkCallControlAlphaNotify"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "lceData"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::LceDataInfo"
+        }
+    }
+
+    api: {
+        name: "pcoData"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::PcoDataInfo"
+        }
+    }
+
+    api: {
+        name: "modemReset"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioIndicationType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+}
diff --git a/radio/1.0/vts/RadioResponse.vts b/radio/1.0/vts/RadioResponse.vts
new file mode 100644
index 0000000..2884d30
--- /dev/null
+++ b/radio/1.0/vts/RadioResponse.vts
@@ -0,0 +1,1382 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IRadioResponse"
+
+package: "android.hardware.radio"
+
+import: "android.hardware.radio@1.0::types"
+
+interface: {
+    api: {
+        name: "getIccCardStatusResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CardStatus"
+        }
+    }
+
+    api: {
+        name: "supplyIccPinForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "supplyIccPukForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "supplyIccPin2ForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "supplyIccPuk2ForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "changeIccPinForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "changeIccPin2ForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "supplyNetworkDepersonalizationResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getCurrentCallsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::Call"
+            }
+        }
+    }
+
+    api: {
+        name: "dialResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getIMSIForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "hangupConnectionResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "hangupWaitingOrBackgroundResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "hangupForegroundResumeBackgroundResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "switchWaitingOrHoldingAndActiveResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "conferenceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "rejectCallResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getLastCallFailCauseResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::LastCallFailCauseInfo"
+        }
+    }
+
+    api: {
+        name: "getSignalStrengthResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SignalStrength"
+        }
+    }
+
+    api: {
+        name: "getVoiceRegistrationStateResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::VoiceRegStateResult"
+        }
+    }
+
+    api: {
+        name: "getDataRegistrationStateResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::DataRegStateResult"
+        }
+    }
+
+    api: {
+        name: "getOperatorResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setRadioPowerResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "sendDtmfResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "sendSmsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SendSmsResult"
+        }
+    }
+
+    api: {
+        name: "sendSMSExpectMoreResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SendSmsResult"
+        }
+    }
+
+    api: {
+        name: "setupDataCallResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SetupDataCallResult"
+        }
+    }
+
+    api: {
+        name: "iccIOForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIoResult"
+        }
+    }
+
+    api: {
+        name: "sendUssdResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "cancelPendingUssdResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getClirResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setClirResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCallForwardStatusResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::CallForwardInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setCallForwardResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCallWaitingResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setCallWaitingResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "acknowledgeLastIncomingGsmSmsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "acceptCallResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "deactivateDataCallResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getFacilityLockForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setFacilityLockForAppResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setBarringPasswordResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getNetworkSelectionModeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setNetworkSelectionModeAutomaticResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setNetworkSelectionModeManualResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getAvailableNetworksResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::OperatorInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "startDtmfResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "stopDtmfResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getBasebandVersionResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "separateConnectionResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setMuteResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getMuteResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getClipResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::ClipStatus"
+        }
+    }
+
+    api: {
+        name: "getDataCallListResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::SetupDataCallResult"
+            }
+        }
+    }
+
+    api: {
+        name: "sendOemRilRequestRawResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "sendOemRilRequestStringsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "sendScreenStateResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setSuppServiceNotificationsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "writeSmsToSimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "deleteSmsOnSimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setBandModeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getAvailableBandModesResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ENUM
+                predefined_type: "::android::hardware::radio::V1_0::RadioBandMode"
+            }
+        }
+    }
+
+    api: {
+        name: "sendEnvelopeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "sendTerminalResponseToSimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "handleStkCallSetupRequestFromSimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "explicitCallTransferResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setPreferredNetworkTypeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getPreferredNetworkTypeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::PreferredNetworkType"
+        }
+    }
+
+    api: {
+        name: "getNeighboringCidsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::NeighboringCell"
+            }
+        }
+    }
+
+    api: {
+        name: "setLocationUpdatesResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setCdmaSubscriptionSourceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setCdmaRoamingPreferenceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCdmaRoamingPreferenceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaRoamingType"
+        }
+    }
+
+    api: {
+        name: "setTTYModeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getTTYModeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::TtyMode"
+        }
+    }
+
+    api: {
+        name: "setPreferredVoicePrivacyResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getPreferredVoicePrivacyResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "sendCDMAFeatureCodeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "sendBurstDtmfResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "sendCdmaSmsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SendSmsResult"
+        }
+    }
+
+    api: {
+        name: "acknowledgeLastIncomingCdmaSmsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getGsmBroadcastConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setGsmBroadcastConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setGsmBroadcastActivationResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCdmaBroadcastConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setCdmaBroadcastConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setCdmaBroadcastActivationResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCDMASubscriptionResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "writeSmsToRuimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "deleteSmsOnRuimResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getDeviceIdentityResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "exitEmergencyCallbackModeResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getSmscAddressResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setSmscAddressResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "reportSmsMemoryStatusResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getCdmaSubscriptionSourceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSubscriptionSource"
+        }
+    }
+
+    api: {
+        name: "requestIsimAuthenticationResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "acknowledgeIncomingGsmSmsWithPduResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "sendEnvelopeWithStatusResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIoResult"
+        }
+    }
+
+    api: {
+        name: "getVoiceRadioTechnologyResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioTechnology"
+        }
+    }
+
+    api: {
+        name: "getCellInfoListResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::CellInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "setCellInfoListRateResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setInitialAttachApnResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getImsRegistrationStateResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::RadioTechnologyFamily"
+        }
+    }
+
+    api: {
+        name: "sendImsSmsResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SendSmsResult"
+        }
+    }
+
+    api: {
+        name: "iccTransmitApduBasicChannelResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIoResult"
+        }
+    }
+
+    api: {
+        name: "iccOpenLogicalChannelResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "int8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "iccCloseLogicalChannelResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "iccTransmitApduLogicalChannelResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIoResult"
+        }
+    }
+
+    api: {
+        name: "nvReadItemResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "nvWriteItemResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "nvWriteCdmaPrlResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "nvResetConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setUiccSubscriptionResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "setDataAllowedResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getHardwareConfigResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::radio::V1_0::HardwareConfig"
+            }
+        }
+    }
+
+    api: {
+        name: "requestIccSimAuthenticationResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::IccIoResult"
+        }
+    }
+
+    api: {
+        name: "setDataProfileResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "requestShutdownResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+    }
+
+    api: {
+        name: "getRadioCapabilityResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioCapability"
+        }
+    }
+
+    api: {
+        name: "setRadioCapabilityResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioCapability"
+        }
+    }
+
+    api: {
+        name: "startLceServiceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::LceStatusInfo"
+        }
+    }
+
+    api: {
+        name: "stopLceServiceResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::LceStatusInfo"
+        }
+    }
+
+    api: {
+        name: "pullLceDataResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::LceDataInfo"
+        }
+    }
+
+    api: {
+        name: "getModemActivityInfoResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::ActivityStatsInfo"
+        }
+    }
+
+    api: {
+        name: "setAllowedCarriersResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "getAllowedCarriersResponse"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::RadioResponseInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CarrierRestrictions"
+        }
+    }
+
+    api: {
+        name: "acknowledgeRequest"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+}
diff --git a/radio/1.0/vts/Sap.vts b/radio/1.0/vts/Sap.vts
new file mode 100644
index 0000000..23205d0
--- /dev/null
+++ b/radio/1.0/vts/Sap.vts
@@ -0,0 +1,107 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISap"
+
+package: "android.hardware.radio"
+
+import: "android.hardware.radio@1.0::ISapCallback"
+import: "android.hardware.radio@1.0::types"
+
+interface: {
+    api: {
+        name: "setCallback"
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISapCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "connectReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "disconnectReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "apduReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapApduType"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "transferAtrReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "powerReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "resetSimReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "transferCardReaderStatusReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "setTransferProtocolReq"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapTransferProtocol"
+        }
+    }
+
+}
diff --git a/radio/1.0/vts/SapCallback.vts b/radio/1.0/vts/SapCallback.vts
new file mode 100644
index 0000000..2e61ce6
--- /dev/null
+++ b/radio/1.0/vts/SapCallback.vts
@@ -0,0 +1,156 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISapCallback"
+
+package: "android.hardware.radio"
+
+import: "android.hardware.radio@1.0::types"
+
+interface: {
+    api: {
+        name: "connectResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapConnectRsp"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "disconnectResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "disconnectIndication"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapDisconnectType"
+        }
+    }
+
+    api: {
+        name: "apduResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "transferAtrResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "powerResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+    }
+
+    api: {
+        name: "resetSimResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+    }
+
+    api: {
+        name: "statusIndication"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapStatus"
+        }
+    }
+
+    api: {
+        name: "transferCardReaderStatusResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "errorResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "transferProtocolResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::radio::V1_0::SapResultCode"
+        }
+    }
+
+}
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py
diff --git a/radio/Android.mk b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/Android.mk
similarity index 100%
rename from radio/Android.mk
rename to radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/Android.mk
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py
diff --git a/boot/Android.mk b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk
similarity index 79%
copy from boot/Android.mk
copy to radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk
index f9e3276..59f7c85 100644
--- a/boot/Android.mk
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := RadioHidlTest
+VTS_CONFIG_SRC_DIR := testcases/hal/radio/hidl/host
+include test/vts/tools/build/Android.host_config.mk
\ No newline at end of file
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml
new file mode 100644
index 0000000..a826d20
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS HAL Radio test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+        <option name="cleanup" value="true" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/Radio.vts->/data/local/tmp/spec/Radio.vts" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/RadioIndication.vts->/data/local/tmp/spec/RadioIndication.vts" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/RadioResponse.vts->/data/local/tmp/spec/RadioResponse.vts" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/Sap.vts->/data/local/tmp/spec/Sap.vts" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/SapCallback.vts->/data/local/tmp/spec/SapCallback.vts" />
+        <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="RadioHidlTest" />
+        <option name="test-case-path" value="vts/testcases/hal/radio/hidl/host/RadioHidlTest" />
+    </test>
+</configuration>
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py
new file mode 100644
index 0000000..33dac35
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import logging
+import time
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test_with_webdb
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.profiling import profiling_utils
+
+
+class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
+    """A simple testcase for the VEHICLE HIDL HAL."""
+
+    def setUpClass(self):
+        """Creates a mirror and init vehicle hal."""
+        self.dut = self.registerController(android_device)[0]
+
+        self.dut.shell.InvokeTerminal("one")
+        self.dut.shell.one.Execute("setenforce 0")  # SELinux permissive mode
+
+        if self.enable_profiling:
+            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+        self.dut.hal.InitHidlHal(
+            target_type="radio",
+            target_basepaths=self.dut.libPaths,
+            target_version=1.0,
+            target_package="android.hardware.radio",
+            target_component_name="IRadio",
+            hw_binder_service_name="Radio",
+            bits=64 if self.dut.is64Bit else 32)
+
+        self.radio = self.dut.hal.radio  # shortcut
+        self.radio_types = self.dut.hal.radio.GetHidlTypeInterface("types")
+        logging.info("Radio types: %s", self.radio_types)
+
+    def tearDownClass(self):
+        """Disables the profiling.
+
+        If profiling is enabled for the test, collect the profiling data
+        and disable profiling after the test is done.
+        """
+        if self.enable_profiling:
+            profiling_trace_path = getattr(
+                self, self.VTS_PROFILING_TRACING_PATH, "")
+            self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+            profiling_utils.DisableVTSProfiling(self.dut.shell.one)
+
+    def testHelloWorld(self):
+        logging.info('hello world')
+
+
+if __name__ == "__main__":
+    test_runner.main()
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py
diff --git a/radio/1.0/vts/types.vts b/radio/1.0/vts/types.vts
new file mode 100644
index 0000000..c11db63
--- /dev/null
+++ b/radio/1.0/vts/types.vts
@@ -0,0 +1,5532 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.radio"
+
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioConst"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CDMA_ALPHA_INFO_BUFFER_LENGTH"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "CDMA_NUMBER_INFO_BUFFER_LENGTH"
+        scalar_value: {
+            int32_t: 81
+        }
+        enumerator: "MAX_RILDS"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "MAX_SOCKET_NAME_LENGTH"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "MAX_CLIENT_ID_LENGTH"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "MAX_DEBUG_SOCKET_NAME_LENGTH"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "MAX_QEMU_PIPE_NAME_LENGTH"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "MAX_UUID_LENGTH"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "CARD_MAX_APPS"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "CDMA_MAX_NUMBER_OF_INFO_RECS"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "SS_INFO_MAX"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "NUM_SERVICE_CLASSES"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "NUM_TX_POWER_LEVELS"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioCdmaSmsConst"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ADDRESS_MAX"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "SUBADDRESS_MAX"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "BEARER_DATA_MAX"
+        scalar_value: {
+            int32_t: 255
+        }
+        enumerator: "UDH_MAX_SND_SIZE"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "UDH_EO_DATA_SEGMENT_MAX"
+        scalar_value: {
+            int32_t: 131
+        }
+        enumerator: "MAX_UD_HEADERS"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "USER_DATA_MAX"
+        scalar_value: {
+            int32_t: 229
+        }
+        enumerator: "UDH_LARGE_PIC_SIZE"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "UDH_SMALL_PIC_SIZE"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "UDH_VAR_PIC_SIZE"
+        scalar_value: {
+            int32_t: 134
+        }
+        enumerator: "UDH_ANIM_NUM_BITMAPS"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "UDH_LARGE_BITMAP_SIZE"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "UDH_SMALL_BITMAP_SIZE"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "UDH_OTHER_SIZE"
+        scalar_value: {
+            int32_t: 226
+        }
+        enumerator: "IP_ADDRESS_SIZE"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioError"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "RADIO_NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "GENERIC_FAILURE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "PASSWORD_INCORRECT"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SIM_PIN2"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "SIM_PUK2"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "REQUEST_NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "CANCELLED"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "OP_NOT_ALLOWED_DURING_VOICE_CALL"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "OP_NOT_ALLOWED_BEFORE_REG_TO_NW"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "SMS_SEND_FAIL_RETRY"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "SIM_ABSENT"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "SUBSCRIPTION_NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "MODE_NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "FDN_CHECK_FAILURE"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "ILLEGAL_SIM_OR_ME"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "MISSING_RESOURCE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "NO_SUCH_ELEMENT"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "DIAL_MODIFIED_TO_USSD"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "DIAL_MODIFIED_TO_SS"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "DIAL_MODIFIED_TO_DIAL"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "USSD_MODIFIED_TO_DIAL"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "USSD_MODIFIED_TO_SS"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "USSD_MODIFIED_TO_USSD"
+        scalar_value: {
+            int32_t: 23
+        }
+        enumerator: "SS_MODIFIED_TO_DIAL"
+        scalar_value: {
+            int32_t: 24
+        }
+        enumerator: "SS_MODIFIED_TO_USSD"
+        scalar_value: {
+            int32_t: 25
+        }
+        enumerator: "SUBSCRIPTION_NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 26
+        }
+        enumerator: "SS_MODIFIED_TO_SS"
+        scalar_value: {
+            int32_t: 27
+        }
+        enumerator: "LCE_NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "NO_MEMORY"
+        scalar_value: {
+            int32_t: 37
+        }
+        enumerator: "INTERNAL_ERR"
+        scalar_value: {
+            int32_t: 38
+        }
+        enumerator: "SYSTEM_ERR"
+        scalar_value: {
+            int32_t: 39
+        }
+        enumerator: "MODEM_ERR"
+        scalar_value: {
+            int32_t: 40
+        }
+        enumerator: "INVALID_STATE"
+        scalar_value: {
+            int32_t: 41
+        }
+        enumerator: "NO_RESOURCES"
+        scalar_value: {
+            int32_t: 42
+        }
+        enumerator: "SIM_ERR"
+        scalar_value: {
+            int32_t: 43
+        }
+        enumerator: "INVALID_ARGUMENTS"
+        scalar_value: {
+            int32_t: 44
+        }
+        enumerator: "INVALID_SIM_STATE"
+        scalar_value: {
+            int32_t: 45
+        }
+        enumerator: "INVALID_MODEM_STATE"
+        scalar_value: {
+            int32_t: 46
+        }
+        enumerator: "INVALID_CALL_ID"
+        scalar_value: {
+            int32_t: 47
+        }
+        enumerator: "NO_SMS_TO_ACK"
+        scalar_value: {
+            int32_t: 48
+        }
+        enumerator: "NETWORK_ERR"
+        scalar_value: {
+            int32_t: 49
+        }
+        enumerator: "REQUEST_RATE_LIMITED"
+        scalar_value: {
+            int32_t: 50
+        }
+        enumerator: "SIM_BUSY"
+        scalar_value: {
+            int32_t: 51
+        }
+        enumerator: "SIM_FULL"
+        scalar_value: {
+            int32_t: 52
+        }
+        enumerator: "NETWORK_REJECT"
+        scalar_value: {
+            int32_t: 53
+        }
+        enumerator: "OPERATION_NOT_ALLOWED"
+        scalar_value: {
+            int32_t: 54
+        }
+        enumerator: "EMPTY_RECORD"
+        scalar_value: {
+            int32_t: 55
+        }
+        enumerator: "INVALID_SMS_FORMAT"
+        scalar_value: {
+            int32_t: 56
+        }
+        enumerator: "ENCODING_ERR"
+        scalar_value: {
+            int32_t: 57
+        }
+        enumerator: "INVALID_SMSC_ADDRESS"
+        scalar_value: {
+            int32_t: 58
+        }
+        enumerator: "NO_SUCH_ENTRY"
+        scalar_value: {
+            int32_t: 59
+        }
+        enumerator: "NETWORK_NOT_READY"
+        scalar_value: {
+            int32_t: 60
+        }
+        enumerator: "NOT_PROVISIONED"
+        scalar_value: {
+            int32_t: 61
+        }
+        enumerator: "NO_SUBSCRIPTION"
+        scalar_value: {
+            int32_t: 62
+        }
+        enumerator: "NO_NETWORK_FOUND"
+        scalar_value: {
+            int32_t: 63
+        }
+        enumerator: "DEVICE_IN_USE"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "ABORTED"
+        scalar_value: {
+            int32_t: 65
+        }
+        enumerator: "INVALID_RESPONSE"
+        scalar_value: {
+            int32_t: 66
+        }
+        enumerator: "OEM_ERROR_1"
+        scalar_value: {
+            int32_t: 501
+        }
+        enumerator: "OEM_ERROR_2"
+        scalar_value: {
+            int32_t: 502
+        }
+        enumerator: "OEM_ERROR_3"
+        scalar_value: {
+            int32_t: 503
+        }
+        enumerator: "OEM_ERROR_4"
+        scalar_value: {
+            int32_t: 504
+        }
+        enumerator: "OEM_ERROR_5"
+        scalar_value: {
+            int32_t: 505
+        }
+        enumerator: "OEM_ERROR_6"
+        scalar_value: {
+            int32_t: 506
+        }
+        enumerator: "OEM_ERROR_7"
+        scalar_value: {
+            int32_t: 507
+        }
+        enumerator: "OEM_ERROR_8"
+        scalar_value: {
+            int32_t: 508
+        }
+        enumerator: "OEM_ERROR_9"
+        scalar_value: {
+            int32_t: 509
+        }
+        enumerator: "OEM_ERROR_10"
+        scalar_value: {
+            int32_t: 510
+        }
+        enumerator: "OEM_ERROR_11"
+        scalar_value: {
+            int32_t: 511
+        }
+        enumerator: "OEM_ERROR_12"
+        scalar_value: {
+            int32_t: 512
+        }
+        enumerator: "OEM_ERROR_13"
+        scalar_value: {
+            int32_t: 513
+        }
+        enumerator: "OEM_ERROR_14"
+        scalar_value: {
+            int32_t: 514
+        }
+        enumerator: "OEM_ERROR_15"
+        scalar_value: {
+            int32_t: 515
+        }
+        enumerator: "OEM_ERROR_16"
+        scalar_value: {
+            int32_t: 516
+        }
+        enumerator: "OEM_ERROR_17"
+        scalar_value: {
+            int32_t: 517
+        }
+        enumerator: "OEM_ERROR_18"
+        scalar_value: {
+            int32_t: 518
+        }
+        enumerator: "OEM_ERROR_19"
+        scalar_value: {
+            int32_t: 519
+        }
+        enumerator: "OEM_ERROR_20"
+        scalar_value: {
+            int32_t: 520
+        }
+        enumerator: "OEM_ERROR_21"
+        scalar_value: {
+            int32_t: 521
+        }
+        enumerator: "OEM_ERROR_22"
+        scalar_value: {
+            int32_t: 522
+        }
+        enumerator: "OEM_ERROR_23"
+        scalar_value: {
+            int32_t: 523
+        }
+        enumerator: "OEM_ERROR_24"
+        scalar_value: {
+            int32_t: 524
+        }
+        enumerator: "OEM_ERROR_25"
+        scalar_value: {
+            int32_t: 525
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioResponseType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SOLICITED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SOLICITED_ACK"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SOLICITED_ACK_EXP"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioIndicationType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNSOLICITED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "UNSOLICITED_ACK_EXP"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RestrictedState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CS_EMERGENCY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CS_NORMAL"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CS_ALL"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "PS_ALL"
+        scalar_value: {
+            int32_t: 16
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CardState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ABSENT"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "PRESENT"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ERROR"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "RESTRICTED"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::PinState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ENABLED_NOT_VERIFIED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ENABLED_VERIFIED"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "DISABLED"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ENABLED_BLOCKED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ENABLED_PERM_BLOCKED"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::AppType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SIM"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "USIM"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "RUIM"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CSIM"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ISIM"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::AppState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "DETECTED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "PIN"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "PUK"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SUBSCRIPTION_PERSO"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "READY"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::PersoSubstate"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "IN_PROGRESS"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "READY"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "SIM_NETWORK"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SIM_NETWORK_SUBSET"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "SIM_CORPORATE"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "SIM_SERVICE_PROVIDER"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "SIM_SIM"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "SIM_NETWORK_PUK"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "SIM_NETWORK_SUBSET_PUK"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "SIM_CORPORATE_PUK"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "SIM_SERVICE_PROVIDER_PUK"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "SIM_SIM_PUK"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "RUIM_NETWORK1"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "RUIM_NETWORK2"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "RUIM_HRPD"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "RUIM_CORPORATE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "RUIM_SERVICE_PROVIDER"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "RUIM_RUIM"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "RUIM_NETWORK1_PUK"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "RUIM_NETWORK2_PUK"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "RUIM_HRPD_PUK"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "RUIM_CORPORATE_PUK"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "RUIM_SERVICE_PROVIDER_PUK"
+        scalar_value: {
+            int32_t: 23
+        }
+        enumerator: "RUIM_RUIM_PUK"
+        scalar_value: {
+            int32_t: 24
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "OFF"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "UNAVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ON"
+        scalar_value: {
+            int32_t: 10
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapConnectRsp"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CONNECT_FAILURE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "MSG_SIZE_TOO_LARGE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "MSG_SIZE_TOO_SMALL"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CONNECT_OK_CALL_ONGOING"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapDisconnectType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "GRACEFUL"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "IMMEDIATE"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapApduType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "APDU"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "APDU7816"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapResultCode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "GENERIC_FAILURE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CARD_NOT_ACCESSSIBLE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CARD_ALREADY_POWERED_OFF"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CARD_REMOVED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "CARD_ALREADY_POWERED_ON"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "DATA_NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 7
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN_ERROR"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CARD_RESET"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CARD_NOT_ACCESSIBLE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CARD_REMOVED"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CARD_INSERTED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "RECOVERED"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SapTransferProtocol"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "T0"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "T1"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CallState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ACTIVE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "HOLDING"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "DIALING"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ALERTING"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "INCOMING"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "WAITING"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::UusType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "TYPE1_IMPLICIT"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "TYPE1_REQUIRED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "TYPE1_NOT_REQUIRED"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "TYPE2_REQUIRED"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "TYPE2_NOT_REQUIRED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "TYPE3_REQUIRED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "TYPE3_NOT_REQUIRED"
+        scalar_value: {
+            int32_t: 6
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::UusDcs"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "USP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "OSIHLP"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "X244"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "RMCF"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "IA5C"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CallPresentation"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ALLOWED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "RESTRICTED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "PAYPHONE"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::Clir"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "DEFAULT"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "INVOCATION"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SUPPRESSION"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LastCallFailCause"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNOBTAINABLE_NUMBER"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NO_ROUTE_TO_DESTINATION"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CHANNEL_UNACCEPTABLE"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "OPERATOR_DETERMINED_BARRING"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "NORMAL"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "BUSY"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "NO_USER_RESPONDING"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "NO_ANSWER_FROM_USER"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "CALL_REJECTED"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "NUMBER_CHANGED"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "PREEMPTION"
+        scalar_value: {
+            int32_t: 25
+        }
+        enumerator: "DESTINATION_OUT_OF_ORDER"
+        scalar_value: {
+            int32_t: 27
+        }
+        enumerator: "INVALID_NUMBER_FORMAT"
+        scalar_value: {
+            int32_t: 28
+        }
+        enumerator: "FACILITY_REJECTED"
+        scalar_value: {
+            int32_t: 29
+        }
+        enumerator: "RESP_TO_STATUS_ENQUIRY"
+        scalar_value: {
+            int32_t: 30
+        }
+        enumerator: "NORMAL_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "CONGESTION"
+        scalar_value: {
+            int32_t: 34
+        }
+        enumerator: "NETWORK_OUT_OF_ORDER"
+        scalar_value: {
+            int32_t: 38
+        }
+        enumerator: "TEMPORARY_FAILURE"
+        scalar_value: {
+            int32_t: 41
+        }
+        enumerator: "SWITCHING_EQUIPMENT_CONGESTION"
+        scalar_value: {
+            int32_t: 42
+        }
+        enumerator: "ACCESS_INFORMATION_DISCARDED"
+        scalar_value: {
+            int32_t: 43
+        }
+        enumerator: "REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 44
+        }
+        enumerator: "RESOURCES_UNAVAILABLE_OR_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 47
+        }
+        enumerator: "QOS_UNAVAILABLE"
+        scalar_value: {
+            int32_t: 49
+        }
+        enumerator: "REQUESTED_FACILITY_NOT_SUBSCRIBED"
+        scalar_value: {
+            int32_t: 50
+        }
+        enumerator: "INCOMING_CALLS_BARRED_WITHIN_CUG"
+        scalar_value: {
+            int32_t: 55
+        }
+        enumerator: "BEARER_CAPABILITY_NOT_AUTHORIZED"
+        scalar_value: {
+            int32_t: 57
+        }
+        enumerator: "BEARER_CAPABILITY_UNAVAILABLE"
+        scalar_value: {
+            int32_t: 58
+        }
+        enumerator: "SERVICE_OPTION_NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 63
+        }
+        enumerator: "BEARER_SERVICE_NOT_IMPLEMENTED"
+        scalar_value: {
+            int32_t: 65
+        }
+        enumerator: "ACM_LIMIT_EXCEEDED"
+        scalar_value: {
+            int32_t: 68
+        }
+        enumerator: "REQUESTED_FACILITY_NOT_IMPLEMENTED"
+        scalar_value: {
+            int32_t: 69
+        }
+        enumerator: "ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE"
+        scalar_value: {
+            int32_t: 70
+        }
+        enumerator: "SERVICE_OR_OPTION_NOT_IMPLEMENTED"
+        scalar_value: {
+            int32_t: 79
+        }
+        enumerator: "INVALID_TRANSACTION_IDENTIFIER"
+        scalar_value: {
+            int32_t: 81
+        }
+        enumerator: "USER_NOT_MEMBER_OF_CUG"
+        scalar_value: {
+            int32_t: 87
+        }
+        enumerator: "INCOMPATIBLE_DESTINATION"
+        scalar_value: {
+            int32_t: 88
+        }
+        enumerator: "INVALID_TRANSIT_NW_SELECTION"
+        scalar_value: {
+            int32_t: 91
+        }
+        enumerator: "SEMANTICALLY_INCORRECT_MESSAGE"
+        scalar_value: {
+            int32_t: 95
+        }
+        enumerator: "INVALID_MANDATORY_INFORMATION"
+        scalar_value: {
+            int32_t: 96
+        }
+        enumerator: "MESSAGE_TYPE_NON_IMPLEMENTED"
+        scalar_value: {
+            int32_t: 97
+        }
+        enumerator: "MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE"
+        scalar_value: {
+            int32_t: 98
+        }
+        enumerator: "INFORMATION_ELEMENT_NON_EXISTENT"
+        scalar_value: {
+            int32_t: 99
+        }
+        enumerator: "CONDITIONAL_IE_ERROR"
+        scalar_value: {
+            int32_t: 100
+        }
+        enumerator: "MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE"
+        scalar_value: {
+            int32_t: 101
+        }
+        enumerator: "RECOVERY_ON_TIMER_EXPIRED"
+        scalar_value: {
+            int32_t: 102
+        }
+        enumerator: "PROTOCOL_ERROR_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 111
+        }
+        enumerator: "INTERWORKING_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 127
+        }
+        enumerator: "CALL_BARRED"
+        scalar_value: {
+            int32_t: 240
+        }
+        enumerator: "FDN_BLOCKED"
+        scalar_value: {
+            int32_t: 241
+        }
+        enumerator: "IMSI_UNKNOWN_IN_VLR"
+        scalar_value: {
+            int32_t: 242
+        }
+        enumerator: "IMEI_NOT_ACCEPTED"
+        scalar_value: {
+            int32_t: 243
+        }
+        enumerator: "DIAL_MODIFIED_TO_USSD"
+        scalar_value: {
+            int32_t: 244
+        }
+        enumerator: "DIAL_MODIFIED_TO_SS"
+        scalar_value: {
+            int32_t: 245
+        }
+        enumerator: "DIAL_MODIFIED_TO_DIAL"
+        scalar_value: {
+            int32_t: 246
+        }
+        enumerator: "CDMA_LOCKED_UNTIL_POWER_CYCLE"
+        scalar_value: {
+            int32_t: 1000
+        }
+        enumerator: "CDMA_DROP"
+        scalar_value: {
+            int32_t: 1001
+        }
+        enumerator: "CDMA_INTERCEPT"
+        scalar_value: {
+            int32_t: 1002
+        }
+        enumerator: "CDMA_REORDER"
+        scalar_value: {
+            int32_t: 1003
+        }
+        enumerator: "CDMA_SO_REJECT"
+        scalar_value: {
+            int32_t: 1004
+        }
+        enumerator: "CDMA_RETRY_ORDER"
+        scalar_value: {
+            int32_t: 1005
+        }
+        enumerator: "CDMA_ACCESS_FAILURE"
+        scalar_value: {
+            int32_t: 1006
+        }
+        enumerator: "CDMA_PREEMPTED"
+        scalar_value: {
+            int32_t: 1007
+        }
+        enumerator: "CDMA_NOT_EMERGENCY"
+        scalar_value: {
+            int32_t: 1008
+        }
+        enumerator: "CDMA_ACCESS_BLOCKED"
+        scalar_value: {
+            int32_t: 1009
+        }
+        enumerator: "ERROR_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 65535
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::DataCallFailCause"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "OPERATOR_BARRED"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "NAS_SIGNALLING"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "INSUFFICIENT_RESOURCES"
+        scalar_value: {
+            int32_t: 26
+        }
+        enumerator: "MISSING_UKNOWN_APN"
+        scalar_value: {
+            int32_t: 27
+        }
+        enumerator: "UNKNOWN_PDP_ADDRESS_TYPE"
+        scalar_value: {
+            int32_t: 28
+        }
+        enumerator: "USER_AUTHENTICATION"
+        scalar_value: {
+            int32_t: 29
+        }
+        enumerator: "ACTIVATION_REJECT_GGSN"
+        scalar_value: {
+            int32_t: 30
+        }
+        enumerator: "ACTIVATION_REJECT_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "SERVICE_OPTION_NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "SERVICE_OPTION_NOT_SUBSCRIBED"
+        scalar_value: {
+            int32_t: 33
+        }
+        enumerator: "SERVICE_OPTION_OUT_OF_ORDER"
+        scalar_value: {
+            int32_t: 34
+        }
+        enumerator: "NSAPI_IN_USE"
+        scalar_value: {
+            int32_t: 35
+        }
+        enumerator: "REGULAR_DEACTIVATION"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "QOS_NOT_ACCEPTED"
+        scalar_value: {
+            int32_t: 37
+        }
+        enumerator: "NETWORK_FAILURE"
+        scalar_value: {
+            int32_t: 38
+        }
+        enumerator: "UMTS_REACTIVATION_REQ"
+        scalar_value: {
+            int32_t: 39
+        }
+        enumerator: "FEATURE_NOT_SUPP"
+        scalar_value: {
+            int32_t: 40
+        }
+        enumerator: "TFT_SEMANTIC_ERROR"
+        scalar_value: {
+            int32_t: 41
+        }
+        enumerator: "TFT_SYTAX_ERROR"
+        scalar_value: {
+            int32_t: 42
+        }
+        enumerator: "UNKNOWN_PDP_CONTEXT"
+        scalar_value: {
+            int32_t: 43
+        }
+        enumerator: "FILTER_SEMANTIC_ERROR"
+        scalar_value: {
+            int32_t: 44
+        }
+        enumerator: "FILTER_SYTAX_ERROR"
+        scalar_value: {
+            int32_t: 45
+        }
+        enumerator: "PDP_WITHOUT_ACTIVE_TFT"
+        scalar_value: {
+            int32_t: 46
+        }
+        enumerator: "ONLY_IPV4_ALLOWED"
+        scalar_value: {
+            int32_t: 50
+        }
+        enumerator: "ONLY_IPV6_ALLOWED"
+        scalar_value: {
+            int32_t: 51
+        }
+        enumerator: "ONLY_SINGLE_BEARER_ALLOWED"
+        scalar_value: {
+            int32_t: 52
+        }
+        enumerator: "ESM_INFO_NOT_RECEIVED"
+        scalar_value: {
+            int32_t: 53
+        }
+        enumerator: "PDN_CONN_DOES_NOT_EXIST"
+        scalar_value: {
+            int32_t: 54
+        }
+        enumerator: "MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED"
+        scalar_value: {
+            int32_t: 55
+        }
+        enumerator: "MAX_ACTIVE_PDP_CONTEXT_REACHED"
+        scalar_value: {
+            int32_t: 65
+        }
+        enumerator: "UNSUPPORTED_APN_IN_CURRENT_PLMN"
+        scalar_value: {
+            int32_t: 66
+        }
+        enumerator: "INVALID_TRANSACTION_ID"
+        scalar_value: {
+            int32_t: 81
+        }
+        enumerator: "MESSAGE_INCORRECT_SEMANTIC"
+        scalar_value: {
+            int32_t: 95
+        }
+        enumerator: "INVALID_MANDATORY_INFO"
+        scalar_value: {
+            int32_t: 96
+        }
+        enumerator: "MESSAGE_TYPE_UNSUPPORTED"
+        scalar_value: {
+            int32_t: 97
+        }
+        enumerator: "MSG_TYPE_NONCOMPATIBLE_STATE"
+        scalar_value: {
+            int32_t: 98
+        }
+        enumerator: "UNKNOWN_INFO_ELEMENT"
+        scalar_value: {
+            int32_t: 99
+        }
+        enumerator: "CONDITIONAL_IE_ERROR"
+        scalar_value: {
+            int32_t: 100
+        }
+        enumerator: "MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE"
+        scalar_value: {
+            int32_t: 101
+        }
+        enumerator: "PROTOCOL_ERRORS"
+        scalar_value: {
+            int32_t: 111
+        }
+        enumerator: "APN_TYPE_CONFLICT"
+        scalar_value: {
+            int32_t: 112
+        }
+        enumerator: "INVALID_PCSCF_ADDR"
+        scalar_value: {
+            int32_t: 113
+        }
+        enumerator: "INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN"
+        scalar_value: {
+            int32_t: 114
+        }
+        enumerator: "EMM_ACCESS_BARRED"
+        scalar_value: {
+            int32_t: 115
+        }
+        enumerator: "EMERGENCY_IFACE_ONLY"
+        scalar_value: {
+            int32_t: 116
+        }
+        enumerator: "IFACE_MISMATCH"
+        scalar_value: {
+            int32_t: 117
+        }
+        enumerator: "COMPANION_IFACE_IN_USE"
+        scalar_value: {
+            int32_t: 118
+        }
+        enumerator: "IP_ADDRESS_MISMATCH"
+        scalar_value: {
+            int32_t: 119
+        }
+        enumerator: "IFACE_AND_POL_FAMILY_MISMATCH"
+        scalar_value: {
+            int32_t: 120
+        }
+        enumerator: "EMM_ACCESS_BARRED_INFINITE_RETRY"
+        scalar_value: {
+            int32_t: 121
+        }
+        enumerator: "AUTH_FAILURE_ON_EMERGENCY_CALL"
+        scalar_value: {
+            int32_t: 122
+        }
+        enumerator: "OEM_DCFAILCAUSE_1"
+        scalar_value: {
+            int32_t: 4097
+        }
+        enumerator: "OEM_DCFAILCAUSE_2"
+        scalar_value: {
+            int32_t: 4098
+        }
+        enumerator: "OEM_DCFAILCAUSE_3"
+        scalar_value: {
+            int32_t: 4099
+        }
+        enumerator: "OEM_DCFAILCAUSE_4"
+        scalar_value: {
+            int32_t: 4100
+        }
+        enumerator: "OEM_DCFAILCAUSE_5"
+        scalar_value: {
+            int32_t: 4101
+        }
+        enumerator: "OEM_DCFAILCAUSE_6"
+        scalar_value: {
+            int32_t: 4102
+        }
+        enumerator: "OEM_DCFAILCAUSE_7"
+        scalar_value: {
+            int32_t: 4103
+        }
+        enumerator: "OEM_DCFAILCAUSE_8"
+        scalar_value: {
+            int32_t: 4104
+        }
+        enumerator: "OEM_DCFAILCAUSE_9"
+        scalar_value: {
+            int32_t: 4105
+        }
+        enumerator: "OEM_DCFAILCAUSE_10"
+        scalar_value: {
+            int32_t: 4106
+        }
+        enumerator: "OEM_DCFAILCAUSE_11"
+        scalar_value: {
+            int32_t: 4107
+        }
+        enumerator: "OEM_DCFAILCAUSE_12"
+        scalar_value: {
+            int32_t: 4108
+        }
+        enumerator: "OEM_DCFAILCAUSE_13"
+        scalar_value: {
+            int32_t: 4109
+        }
+        enumerator: "OEM_DCFAILCAUSE_14"
+        scalar_value: {
+            int32_t: 4110
+        }
+        enumerator: "OEM_DCFAILCAUSE_15"
+        scalar_value: {
+            int32_t: 4111
+        }
+        enumerator: "VOICE_REGISTRATION_FAIL"
+        scalar_value: {
+            int32_t: -1
+        }
+        enumerator: "DATA_REGISTRATION_FAIL"
+        scalar_value: {
+            int32_t: -2
+        }
+        enumerator: "SIGNAL_LOST"
+        scalar_value: {
+            int32_t: -3
+        }
+        enumerator: "PREF_RADIO_TECH_CHANGED"
+        scalar_value: {
+            int32_t: -4
+        }
+        enumerator: "RADIO_POWER_OFF"
+        scalar_value: {
+            int32_t: -5
+        }
+        enumerator: "TETHERED_CALL_ACTIVE"
+        scalar_value: {
+            int32_t: -6
+        }
+        enumerator: "ERROR_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 65535
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RegState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NOT_REG_MT_NOT_SEARCHING_OP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "REG_HOME"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NOT_REG_MT_SEARCHING_OP"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "REG_DENIED"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "REG_ROAMING"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "NOT_REG_MT_NOT_SEARCHING_OP_EM"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "NOT_REG_MT_SEARCHING_OP_EM"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "REG_DENIED_EM"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "UNKNOWN_EM"
+        scalar_value: {
+            int32_t: 9
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioTechnology"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "GPRS"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "EDGE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "UMTS"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "IS95A"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "IS95B"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ONE_X_RTT"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "EVDO_0"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "EVDO_A"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "HSDPA"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "HSUPA"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "HSPA"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "EVDO_B"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "EHRPD"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "LTE"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "HSPAP"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "GSM"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "TD_SCDMA"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "IWLAN"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "LTE_CA"
+        scalar_value: {
+            int32_t: 19
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::DataProfile"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "DEFAULT"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "TETHERED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "IMS"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FOTA"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CBS"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "OEM_BASE"
+        scalar_value: {
+            int32_t: 1000
+        }
+        enumerator: "INVALID"
+        scalar_value: {
+            int32_t: -1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SmsAcknowledgeFailCause"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "MEMORY_CAPAPCITY_EXCEEDED"
+        scalar_value: {
+            int32_t: 211
+        }
+        enumerator: "UNSPECIFIED_ERROR"
+        scalar_value: {
+            int32_t: 255
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CallForwardInfoStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "DISABLE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ENABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "INTERROGATE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "REGISTRATION"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ERASURE"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::ClipStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CLIP_PROVISIONED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CLIP_UNPROVISIONED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "UNKOWN"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SmsWriteArgsStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "REC_UNREAD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "REC_READ"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "STO_UNSENT"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "STO_SENT"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioBandMode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "BAND_MODE_UNSPECIFIED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "BAND_MODE_EURO"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "BAND_MODE_USA"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "BAND_MODE_JPN"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "BAND_MODE_AUS"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "BAND_MODE_AUS_2"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "BAND_MODE_CELL_800"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "BAND_MODE_PCS"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "BAND_MODE_JTACS"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "BAND_MODE_KOREA_PCS"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "BAND_MODE_5_450M"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "BAND_MODE_IMT2000"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "BAND_MODE_7_700M_2"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "BAND_MODE_8_1800M"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "BAND_MODE_9_900M"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "BAND_MODE_10_800M_2"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "BAND_MODE_EURO_PAMR_400M"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "BAND_MODE_AWS"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "BAND_MODE_USA_2500M"
+        scalar_value: {
+            int32_t: 18
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::OperatorStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "AVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CURRENT"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FORBIDDEN"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::PreferredNetworkType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "GSM_WCDMA"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "GSM_ONLY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "WCDMA"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "GSM_WCDMA_AUTO"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CDMA_EVDO_AUTO"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "CDMA_ONLY"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "EVDO_ONLY"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "GSM_WCDMA_CDMA_EVDO_AUTO"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "LTE_CDMA_EVDO"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "LTE_GSM_WCDMA"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "LTE_CMDA_EVDO_GSM_WCDMA"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "LTE_ONLY"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "LTE_WCDMA"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "TD_SCDMA_ONLY"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "TD_SCDMA_WCDMA"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "TD_SCDMA_LTE"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "TD_SCDMA_GSM"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "TD_SCDMA_GSM_LTE"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "TD_SCDMA_GSM_WCDMA"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "TD_SCDMA_WCDMA_LTE"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "TD_SCDMA_GSM_WCDMA_LTE"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA"
+        scalar_value: {
+            int32_t: 22
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSubscriptionSource"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "RUIM_SIM"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "NV"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaRoamingType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "HOME_NETWORK"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "AFFILIATED_ROAM"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ANY_ROAM"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::TtyMode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "OFF"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "FULL"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "HCO"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "VCO"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::NvItem"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CDMA_MEID"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CDMA_MIN"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CDMA_MDN"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CDMA_ACCOLC"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "DEVICE_MSL"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "RTN_RECONDITIONED_STATUS"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "RTN_ACTIVATION_DATE"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "RTN_LIFE_TIMER"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "RTN_LIFE_CALLS"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "RTN_LIFE_DATA_TX"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "RTN_LIFE_DATA_RX"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "OMADM_HFA_LEVEL"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "MIP_PROFILE_NAI"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "MIP_PROFILE_HOME_ADDRESS"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "MIP_PROFILE_AAA_AUTH"
+        scalar_value: {
+            int32_t: 33
+        }
+        enumerator: "MIP_PROFILE_HA_AUTH"
+        scalar_value: {
+            int32_t: 34
+        }
+        enumerator: "MIP_PROFILE_PRI_HA_ADDR"
+        scalar_value: {
+            int32_t: 35
+        }
+        enumerator: "MIP_PROFILE_SEC_HA_ADDR"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "MIP_PROFILE_REV_TUN_PREF"
+        scalar_value: {
+            int32_t: 37
+        }
+        enumerator: "MIP_PROFILE_HA_SPI"
+        scalar_value: {
+            int32_t: 38
+        }
+        enumerator: "MIP_PROFILE_AAA_SPI"
+        scalar_value: {
+            int32_t: 39
+        }
+        enumerator: "MIP_PROFILE_MN_HA_SS"
+        scalar_value: {
+            int32_t: 40
+        }
+        enumerator: "MIP_PROFILE_MN_AAA_SS"
+        scalar_value: {
+            int32_t: 41
+        }
+        enumerator: "CDMA_PRL_VERSION"
+        scalar_value: {
+            int32_t: 51
+        }
+        enumerator: "CDMA_BC10"
+        scalar_value: {
+            int32_t: 52
+        }
+        enumerator: "CDMA_BC14"
+        scalar_value: {
+            int32_t: 53
+        }
+        enumerator: "CDMA_SO68"
+        scalar_value: {
+            int32_t: 54
+        }
+        enumerator: "CDMA_SO73_COP0"
+        scalar_value: {
+            int32_t: 55
+        }
+        enumerator: "CDMA_SO73_COP1TO7"
+        scalar_value: {
+            int32_t: 56
+        }
+        enumerator: "CDMA_1X_ADVANCED_ENABLED"
+        scalar_value: {
+            int32_t: 57
+        }
+        enumerator: "CDMA_EHRPD_ENABLED"
+        scalar_value: {
+            int32_t: 58
+        }
+        enumerator: "CDMA_EHRPD_FORCED"
+        scalar_value: {
+            int32_t: 59
+        }
+        enumerator: "LTE_BAND_ENABLE_25"
+        scalar_value: {
+            int32_t: 71
+        }
+        enumerator: "LTE_BAND_ENABLE_26"
+        scalar_value: {
+            int32_t: 72
+        }
+        enumerator: "LTE_BAND_ENABLE_41"
+        scalar_value: {
+            int32_t: 73
+        }
+        enumerator: "LTE_SCAN_PRIORITY_25"
+        scalar_value: {
+            int32_t: 74
+        }
+        enumerator: "LTE_SCAN_PRIORITY_26"
+        scalar_value: {
+            int32_t: 75
+        }
+        enumerator: "LTE_SCAN_PRIORITY_41"
+        scalar_value: {
+            int32_t: 76
+        }
+        enumerator: "LTE_HIDDEN_BAND_PRIORITY_25"
+        scalar_value: {
+            int32_t: 77
+        }
+        enumerator: "LTE_HIDDEN_BAND_PRIORITY_26"
+        scalar_value: {
+            int32_t: 78
+        }
+        enumerator: "LTE_HIDDEN_BAND_PRIORITY_41"
+        scalar_value: {
+            int32_t: 79
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::ResetNvType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "RELOAD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ERASE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "FACORY_RESET"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::HardwareConfigType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "MODEM"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SIM"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::HardwareConfigState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ENABLED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "STANDBY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "DISABLED"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LceStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "STOPPED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ACTIVE"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CarrierMatchType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ALL"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SPN"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "IMSI_PREFIX"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "GID1"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "GID2"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::NeighboringCell"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cid"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "rssi"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsDigitMode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "FOUR_BIT"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "EIGHT_BIT"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsNumberMode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NOT_DATA_NETWORK"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "DATA_NETWORK"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsNumberType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "INTERNATIONAL_OR_DATA_IP"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NATIONAL_OR_INTERNET_MAIL"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "NETWORK"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SUBSCRIBER"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ALPHANUMERIC"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ABBREVIATED"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "RESERVED_7"
+        scalar_value: {
+            int32_t: 7
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsNumberPlan"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "TELEPHONY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "RESERVED_2"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "DATA"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "TELEX"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "RESERVED_5"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "RESERVED_6"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "RESERVED_7"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "RESERVED_8"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "PRIVATE"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "RESERVED_10"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "RESERVED_11"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "RESERVED_12"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "RESERVED_13"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "RESERVED_14"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "RESERVED_15"
+        scalar_value: {
+            int32_t: 15
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsSubaddressType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NSAP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "USER_SPECIFIED"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsErrorClass"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NO_ERROR"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ERROR"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "REC_UNREAD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "REC_READ"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "STO_UNSENT"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "STO_SENT"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "GSM"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CDMA"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "LTE"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "WCDMA"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "TD_SCDMA"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::TimeStampType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ANTENNA"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "MODEM"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "OEM_RIL"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "JAVA_RIL"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::ApnAuthType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NO_PAP_NO_CHAP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "PAP_NO_CHAP"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NO_PAP_CHAP"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "PAP_CHAP"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioTechnologyFamily"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "THREE_GPP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "THREE_GPP2"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioCapabilityPhase"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CONFIGURED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "START"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "APPLY"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "UNSOL_RSP"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "FINISH"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioCapabilityStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SUCCESS"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "FAIL"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioAccessFamily"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "GPRS"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "EDGE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "UMTS"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "IS95A"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "IS95B"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "ONE_X_RTT"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "EVDO_0"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "EVDO_A"
+        scalar_value: {
+            int32_t: 256
+        }
+        enumerator: "HSDPA"
+        scalar_value: {
+            int32_t: 512
+        }
+        enumerator: "HSUPA"
+        scalar_value: {
+            int32_t: 1024
+        }
+        enumerator: "HSPA"
+        scalar_value: {
+            int32_t: 2048
+        }
+        enumerator: "EVDO_B"
+        scalar_value: {
+            int32_t: 4096
+        }
+        enumerator: "EHRPD"
+        scalar_value: {
+            int32_t: 8192
+        }
+        enumerator: "LTE"
+        scalar_value: {
+            int32_t: 16384
+        }
+        enumerator: "HSPAP"
+        scalar_value: {
+            int32_t: 32768
+        }
+        enumerator: "GSM"
+        scalar_value: {
+            int32_t: 65536
+        }
+        enumerator: "TD_SCDMA"
+        scalar_value: {
+            int32_t: 131072
+        }
+        enumerator: "LTE_CA"
+        scalar_value: {
+            int32_t: 524288
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::UssdModeType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NOTIFY"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "REQUEST"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NW_RELEASE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "LOCAL_CLIENT"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "NOT_SUPPORTED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "NW_TIMEOUT"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SimRefreshType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SIM_FILE_UPDATE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SIM_INIT"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SIM_RESET"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SrvccState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "HANDOVER_STARTED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "HANDOVER_COMPLETED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "HANDOVER_FAILED"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "HANDOVER_CANCELED"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::UiccSubActStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "DEACTIVATE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ACTIVATE"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SubscriptionType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SUBSCRIPTION_1"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SUBSCRIPTION_2"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SUBSCRIPTION_3"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::DataProfileInfoType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "COMMON"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "THREE_GPP"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "THREE_GPP2"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::PhoneRestrictedState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CS_EMERGENCY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CS_NORMAL"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CS_ALL"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "PS_ALL"
+        scalar_value: {
+            int32_t: 16
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ALLOWED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "RESTRICTED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "INTERNATIONAL"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "NATIONAL"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "NETWORK_SPECIFIC"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SUBSCRIBER"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ISDN"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "DATA"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "TELEX"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "NATIONAL"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "PRIVATE"
+        scalar_value: {
+            int32_t: 9
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaOtaProvisionStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SPL_UNLOCKED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SPC_RETRIES_EXCEEDED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "A_KEY_EXCHANGED"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "SSD_UPDATED"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "NAM_DOWNLOADED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "MDN_DOWNLOADED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "IMSI_DOWNLOADED"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "PRL_DOWNLOADED"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "COMMITTED"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "OTAPA_STARTED"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "OTAPA_STOPPED"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "OTAPA_ABORTED"
+        scalar_value: {
+            int32_t: 11
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaInfoRecName"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "DISPLAY"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CALLED_PARTY_NUMBER"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CALLING_PARTY_NUMBER"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CONNECTED_NUMBER"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SIGNAL"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "REDIRECTING_NUMBER"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "LINE_CONTROL"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "EXTENDED_DISPLAY"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "T53_CLIR"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "T53_RELEASE"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "T53_AUDIO_CONTROL"
+        scalar_value: {
+            int32_t: 10
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaRedirectingReason"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CALL_FORWARDING_BUSY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CALL_FORWARDING_NO_REPLY"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CALLED_DTE_OUT_OF_ORDER"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "CALL_FORWARDING_BY_THE_CALLED_DTE"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "CALL_FORWARDING_UNCONDITIONAL"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "RESERVED"
+        scalar_value: {
+            int32_t: 16
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SsServiceType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CFU"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "CF_BUSY"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CF_NO_REPLY"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "CF_NOT_REACHABLE"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "CF_ALL"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "CF_ALL_CONDITIONAL"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "CLIP"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "CLIR"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "COLP"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "COLR"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "WAIT"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "BAOC"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "BAOIC"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "BAOIC_EXC_HOME"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "BAIC"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "BAIC_ROAMING"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "ALL_BARRING"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "OUTGOING_BARRING"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "INCOMING_BARRING"
+        scalar_value: {
+            int32_t: 18
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SsRequestType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ACTIVATION"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "DEACTIVATION"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "INTERROGATION"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "REGISTRATION"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ERASURE"
+        scalar_value: {
+            int32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SsTeleserviceType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ALL_TELE_AND_BEARER_SERVICES"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ALL_TELESEVICES"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "TELEPHONY"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ALL_DATA_TELESERVICES"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SMS_SERVICES"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ALL_TELESERVICES_EXCEPT_SMS"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SuppServiceClass"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "VOICE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "DATA"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FAX"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "SMS"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "DATA_SYNC"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "DATA_ASYNC"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "PACKET"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "PAD"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "MAX"
+        scalar_value: {
+            int32_t: 128
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioResponseInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioResponseType"
+    }
+    struct_value: {
+        name: "serial"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "error"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioError"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::AppStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "appType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::AppType"
+    }
+    struct_value: {
+        name: "appState"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::AppState"
+    }
+    struct_value: {
+        name: "persoSubstate"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::PersoSubstate"
+    }
+    struct_value: {
+        name: "aidPtr"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "appLabelPtr"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "pin1Replaced"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "pin1"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::PinState"
+    }
+    struct_value: {
+        name: "pin2"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::PinState"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CardStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cardState"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CardState"
+    }
+    struct_value: {
+        name: "universalPinState"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::PinState"
+    }
+    struct_value: {
+        name: "gsmUmtsSubscriptionAppIndex"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cdmaSubscriptionAppIndex"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "imsSubscriptionAppIndex"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "applications"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::AppStatus"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::UusInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "uusType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::UusType"
+    }
+    struct_value: {
+        name: "uusDcs"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::UusDcs"
+    }
+    struct_value: {
+        name: "uusData"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::Call"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "state"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CallState"
+    }
+    struct_value: {
+        name: "index"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "toa"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "isMpty"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "isMT"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "als"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "isVoice"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "isVoicePrivacy"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "number"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "numberPresentation"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CallPresentation"
+    }
+    struct_value: {
+        name: "name"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "namePresentation"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CallPresentation"
+    }
+    struct_value: {
+        name: "uusInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::UusInfo"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::Dial"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "address"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "clir"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::Clir"
+    }
+    struct_value: {
+        name: "uusInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::UusInfo"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LastCallFailCauseInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "causeCode"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::LastCallFailCause"
+    }
+    struct_value: {
+        name: "vendorCause"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::GsmSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "signalStrength"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "bitErrorRate"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "timingAdvance"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::WcdmaSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "signalStrength"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "bitErrorRate"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "dbm"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ecio"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::EvdoSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "dbm"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ecio"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "signalNoiseRatio"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LteSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "signalStrength"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rsrp"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rsrq"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rssnr"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cqi"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "timingAdvance"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::TdScdmaSignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rscp"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SignalStrength"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "gw"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::GsmSignalStrength"
+    }
+    struct_value: {
+        name: "cdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSignalStrength"
+    }
+    struct_value: {
+        name: "evdo"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::EvdoSignalStrength"
+    }
+    struct_value: {
+        name: "lte"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::LteSignalStrength"
+    }
+    struct_value: {
+        name: "tdScdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::TdScdmaSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SendSmsResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "messageRef"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "ackPDU"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "errorCode"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SetupDataCallResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "status"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "suggestedRetryTime"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "active"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "type"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "ifname"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "addresses"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "dnses"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "gateways"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "pcscf"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mtu"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::IccIo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "command"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "fileId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "path"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "p1"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "p2"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "p3"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "data"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "pin2"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "aid"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::IccIoResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "sw1"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "sw2"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "simResponse"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::VoiceRegStateResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "regState"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RegState"
+    }
+    struct_value: {
+        name: "lac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "rat"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "baseStationId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "baseStationLatitude"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "baseStationLongitude"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cssSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "systemId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "networkId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "roamingIndicator"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "systemIsInPrl"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "defaultRoamingIndicator"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "reasonForDenial"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "psc"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::DataRegStateResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "regState"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RegState"
+    }
+    struct_value: {
+        name: "lac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "rat"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "reasonDataDenied"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "maxDataCalls"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "tac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "phyCid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "eci"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "csgid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "tadv"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CallForwardInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CallForwardInfoStatus"
+    }
+    struct_value: {
+        name: "reason"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "serviceClass"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "toa"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "number"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "timeSeconds"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::OperatorInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "alphaLong"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "alphaShort"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "operatorNumeric"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::OperatorStatus"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SmsWriteArgs"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SmsWriteArgsStatus"
+    }
+    struct_value: {
+        name: "pdu"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "smsc"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsAddress"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "digitMode"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsDigitMode"
+    }
+    struct_value: {
+        name: "numberMode"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsNumberMode"
+    }
+    struct_value: {
+        name: "numberType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsNumberType"
+    }
+    struct_value: {
+        name: "numberPlan"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsNumberPlan"
+    }
+    struct_value: {
+        name: "digits"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsSubaddress"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "subaddressType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsSubaddressType"
+    }
+    struct_value: {
+        name: "odd"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "digits"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsMessage"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "teleserviceId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "isServicePresent"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "serviceCategory"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "address"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsAddress"
+    }
+    struct_value: {
+        name: "subAddress"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsSubaddress"
+    }
+    struct_value: {
+        name: "bearerData"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsAck"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "errorClass"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsErrorClass"
+    }
+    struct_value: {
+        name: "smsCauseCode"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "serviceCategory"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "language"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "selected"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSmsWriteArgs"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus"
+    }
+    struct_value: {
+        name: "message"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSmsMessage"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "fromServiceId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "toServiceId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "fromCodeScheme"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "toCodeScheme"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "selected"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellIdentityGsm"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "mcc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mnc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "lac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "arfcn"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "bsic"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellIdentityWcdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "mcc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mnc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "lac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "psc"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "uarfcn"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellIdentityCdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "networkId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "systemId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "basestationId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "longitude"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "latitude"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellIdentityLte"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "mcc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mnc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "ci"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "pci"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "tac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "earfcn"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellIdentityTdscdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "mcc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mnc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "lac"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cpid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoGsm"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellIdentityGsm"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CellIdentityGsm"
+    }
+    struct_value: {
+        name: "signalStrengthGsm"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::GsmSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoWcdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellIdentityWcdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CellIdentityWcdma"
+    }
+    struct_value: {
+        name: "signalStrengthWcdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::WcdmaSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoCdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellIdentityCdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CellIdentityCdma"
+    }
+    struct_value: {
+        name: "signalStrengthCdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSignalStrength"
+    }
+    struct_value: {
+        name: "signalStrengthEvdo"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::EvdoSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoLte"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellIdentityLte"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CellIdentityLte"
+    }
+    struct_value: {
+        name: "signalStrengthLte"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::LteSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfoTdscdma"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellIdentityTdscdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CellIdentityTdscdma"
+    }
+    struct_value: {
+        name: "signalStrengthTdscdma"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::TdScdmaSignalStrength"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CellInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cellInfoType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CellInfoType"
+    }
+    struct_value: {
+        name: "registered"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "timeStampType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::TimeStampType"
+    }
+    struct_value: {
+        name: "timeStamp"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "gsm"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CellInfoGsm"
+        }
+    }
+    struct_value: {
+        name: "cdma"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CellInfoCdma"
+        }
+    }
+    struct_value: {
+        name: "lte"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CellInfoLte"
+        }
+    }
+    struct_value: {
+        name: "wcdma"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CellInfoWcdma"
+        }
+    }
+    struct_value: {
+        name: "tdscdma"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CellInfoTdscdma"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::GsmSmsMessage"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "smscPdu"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "pdu"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::ImsSmsMessage"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "tech"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioTechnologyFamily"
+    }
+    struct_value: {
+        name: "retry"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "messageRef"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cdmaMessage"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSmsMessage"
+        }
+    }
+    struct_value: {
+        name: "gsmMessage"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::GsmSmsMessage"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SimApdu"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "sessionId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "cla"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "instruction"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "p1"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "p2"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "p3"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "data"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::NvWriteItem"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "itemId"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::NvItem"
+    }
+    struct_value: {
+        name: "value"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SelectUiccSub"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "slot"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "appIndex"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "subType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SubscriptionType"
+    }
+    struct_value: {
+        name: "actStatus"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::UiccSubActStatus"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::HardwareConfigModem"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rilModel"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "rat"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxVoice"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "maxData"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "maxStandby"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::HardwareConfigSim"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "modemUuid"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::HardwareConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::HardwareConfigType"
+    }
+    struct_value: {
+        name: "uuid"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "state"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::HardwareConfigState"
+    }
+    struct_value: {
+        name: "modem"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::HardwareConfigModem"
+        }
+    }
+    struct_value: {
+        name: "sim"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::HardwareConfigSim"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::DataProfileInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "profileId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "apn"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "protocol"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "authType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::ApnAuthType"
+    }
+    struct_value: {
+        name: "user"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "password"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::DataProfileInfoType"
+    }
+    struct_value: {
+        name: "maxConnsTime"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "maxConns"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "waitTime"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "enabled"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::RadioCapability"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "session"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "phase"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioCapabilityPhase"
+    }
+    struct_value: {
+        name: "raf"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioAccessFamily"
+    }
+    struct_value: {
+        name: "logicalModemUuid"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioCapabilityStatus"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LceStatusInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "lceStatus"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::LceStatus"
+    }
+    struct_value: {
+        name: "actualIntervalMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::LceDataInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "lastHopCapacityKbps"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "confidenceLevel"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "lceSuspended"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::ActivityStatsInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "sleepModeTimeMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "idleModeTimeMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "txmModetimeMs"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 5
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "rxModeTimeMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::Carrier"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "mcc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "mnc"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "matchType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CarrierMatchType"
+    }
+    struct_value: {
+        name: "matchData"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CarrierRestrictions"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "allowedCarriers"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::Carrier"
+        }
+    }
+    struct_value: {
+        name: "excludedCarriers"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::Carrier"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SuppSvcNotification"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "isMT"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "code"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "index"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "type"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "number"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SimRefreshResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SimRefreshType"
+    }
+    struct_value: {
+        name: "efId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "aid"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaSignalInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "isPresent"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "signalType"
+        type: TYPE_SCALAR
+        scalar_type: "int8_t"
+    }
+    struct_value: {
+        name: "alertPitch"
+        type: TYPE_SCALAR
+        scalar_type: "int8_t"
+    }
+    struct_value: {
+        name: "signal"
+        type: TYPE_SCALAR
+        scalar_type: "int8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaCallWaiting"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "number"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "numberPresentation"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation"
+    }
+    struct_value: {
+        name: "name"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "signalInfoRecord"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaSignalInfoRecord"
+    }
+    struct_value: {
+        name: "numbertype"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberType"
+    }
+    struct_value: {
+        name: "numberPlan"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaDisplayInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "alphaBuf"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaNumberInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "number"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "numberType"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "numberPlan"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "pi"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "si"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "redirectingNumber"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::radio::V1_0::CdmaNumberInfoRecord"
+    }
+    struct_value: {
+        name: "redirectingReason"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaRedirectingReason"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaLineControlInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "lineCtrlPolarityIncluded"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "lineCtrlToggle"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "lineCtrlReverse"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "lineCtrlPowerDenial"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cause"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "upLink"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "downLink"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaInformationRecord"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "name"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::CdmaInfoRecName"
+    }
+    struct_value: {
+        name: "display"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaDisplayInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "number"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaNumberInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "signal"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaSignalInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "redir"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "lineCtrl"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaLineControlInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "clir"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord"
+        }
+    }
+    struct_value: {
+        name: "audioCtrl"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CdmaInformationRecords"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "infoRec"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CdmaInformationRecord"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::CfData"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cfInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CallForwardInfo"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::SsInfoData"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "ssInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::StkCcUnsolSsResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "serviceType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SsServiceType"
+    }
+    struct_value: {
+        name: "requestType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SsRequestType"
+    }
+    struct_value: {
+        name: "teleserviceType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SsTeleserviceType"
+    }
+    struct_value: {
+        name: "serviceClass"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::SuppServiceClass"
+    }
+    struct_value: {
+        name: "result"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::radio::V1_0::RadioError"
+    }
+    struct_value: {
+        name: "ssInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::SsInfoData"
+        }
+    }
+    struct_value: {
+        name: "cfData"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::radio::V1_0::CfData"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::radio::V1_0::PcoDataInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "cid"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "bearerProto"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "pcoId"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "contents"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index b5ee36a..2995504 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/sensors/1.0/types.h",
         "android/hardware/sensors/1.0/ISensors.h",
         "android/hardware/sensors/1.0/IHwSensors.h",
-        "android/hardware/sensors/1.0/BnSensors.h",
-        "android/hardware/sensors/1.0/BpSensors.h",
+        "android/hardware/sensors/1.0/BnHwSensors.h",
+        "android/hardware/sensors/1.0/BpHwSensors.h",
         "android/hardware/sensors/1.0/BsSensors.h",
     ],
 }
diff --git a/sensors/1.0/ISensors.hal b/sensors/1.0/ISensors.hal
index adacfe0..5c8301a 100644
--- a/sensors/1.0/ISensors.hal
+++ b/sensors/1.0/ISensors.hal
@@ -23,7 +23,7 @@
     getSensorsList() generates (vec<SensorInfo> list);
 
     /**
-     *  Place the module in a specific mode. The following modes are defined
+     * Place the module in a specific mode. The following modes are defined
      *
      *  SENSOR_HAL_NORMAL_MODE - Normal operation. Default state of the module.
      *
@@ -39,40 +39,36 @@
 
     /* Activate/de-activate one sensor.
      *
-     * sensorHandle is the handle of the sensor to change.
-     * enabled set to true to enable, or false to disable the sensor.
-     *
      * After sensor de-activation, existing sensor events that have not
-     * been picked up by poll() should be abandoned immediately so that
+     * been picked up by poll() must be abandoned immediately so that
      * subsequent activation will not get stale sensor events (events
      * that are generated prior to the latter activation).
      *
-     * Returns OK on success, BAD_VALUE if sensorHandle is invalid.
+     * @param  sensorHandle is the handle of the sensor to change.
+     * @param  enabled set to true to enable, or false to disable the sensor.
+     *
+     * @return result OK on success, BAD_VALUE if sensorHandle is invalid.
      */
     activate(int32_t sensorHandle, bool enabled) generates (Result result);
 
     /**
-     * Set the sampling period in nanoseconds for a given sensor.
-     * If samplingPeriodNs > maxDelay it will be truncated to
-     * maxDelay and if samplingPeriodNs < minDelay it will be
-     * replaced by minDelay.
-     *
-     * Returns OK on success, BAD_VALUE if sensorHandle is invalid.
-     */
-    setDelay(int32_t sensorHandle, int64_t samplingPeriodNs)
-        generates (Result result);
-
-    /**
      * Generate a vector of sensor events containing at most "maxCount"
      * entries.
      *
      * Additionally a vector of SensorInfos is returned for any dynamic sensors
      * connected as notified by returned events of type DYNAMIC_SENSOR_META.
      *
-     * This function should block if there is no sensor event
-     * available when being called.
+     * If there is no sensor event when this function is being called, block
+     * until there are sensor events available.
      *
-     * Returns OK on success or BAD_VALUE if maxCount <= 0.
+     * @param  maxCount max number of samples can be returned, must be > 0.
+     *         Actual number of events returned in data must be <= maxCount
+     *         and > 0.
+     * @return result OK on success or BAD_VALUE if maxCount <= 0.
+     * @return data vector of Event contains sensor events.
+     * @return dynamicSensorsAdded vector of SensorInfo contains dynamic sensor
+     *         added. Each element corresponds to a dynamic sensor meta events
+     *         in data.
      */
     poll(int32_t maxCount)
         generates (
@@ -90,35 +86,110 @@
      * See the Batching sensor results page for details:
      * http://source.android.com/devices/sensors/batching.html
      *
-     * Returns OK on success, BAD_VALUE if any parameters are invalid.
+     * @param  sensorHandle handle of sensor to be changed.
+     * @param  samplingPeriodNs specifies sensor sample period in nanoseconds.
+     * @param  maxReportLatencyNs allowed delay time before an event is sampled
+     *         to time of report.
+     * @return result OK on success, BAD_VALUE if any parameters are invalid.
      */
     batch(int32_t sensorHandle,
-          int32_t flags,
           int64_t samplingPeriodNs,
           int64_t maxReportLatencyNs) generates (Result result);
 
     /*
+     * Trigger a flush of internal FIFO.
+     *
      * Flush adds a FLUSH_COMPLETE metadata event to the end of the "batch mode"
-     * FIFO for the specified sensor and flushes the FIFO.
-     * If the FIFO is empty or if the sensor doesn't support batching
-     * (FIFO size zero), it should return SUCCESS along with a trivial
-     * FLUSH_COMPLETE event added to the event stream.
-     * This applies to all sensors other than one-shot sensors.
-     * If the sensor is a one-shot sensor, flush must return BAD_VALUE and not
-     * generate any flush complete metadata.
-     * If the sensor is not active at the time flush() is called, flush() should
-     * return BAD_VALUE.
-     * Returns OK on success and BAD_VALUE if sensorHandle is invalid.
+     * FIFO for the specified sensor and flushes the FIFO.  If the FIFO is empty
+     * or if the sensor doesn't support batching (FIFO size zero), return
+     * SUCCESS and add a trivial FLUSH_COMPLETE event added to the event stream.
+     * This applies to all sensors other than one-shot sensors. If the sensor
+     * is a one-shot sensor, flush must return BAD_VALUE and not generate any
+     * flush complete metadata.  If the sensor is not active at the time flush()
+     * is called, flush() return BAD_VALUE.
+     *
+     * @param   sensorHandle handle of sensor to be flushed.
+     * @return  result OK on success and BAD_VALUE if sensorHandle is invalid.
      */
     flush(int32_t sensorHandle) generates (Result result);
 
     /*
-     * Inject a single sensor sample to this device.
-     * data points to the sensor event to be injected
-     * Returns OK on success
-     *         PERMISSION_DENIED if operation is not allowed
-     *         INVALID_OPERATION, if this functionality is unsupported
-     *         BAD_VALUE if sensor event cannot be injected
+     * Inject a single sensor event or push operation environment parameters to
+     * device.
+     *
+     * When device is in NORMAL mode, this function is called to push operation
+     * environment data to device. In this operation, Event is always of
+     * SensorType::AdditionalInfo type. See operation evironment parameters
+     * section in AdditionalInfoType.
+     *
+     * When device is in DATA_INJECTION mode, this function is also used for
+     * injecting sensor events.
+     *
+     * Regardless of OperationMode, injected SensorType::ADDITIONAL_INFO
+     * type events should not be routed back to poll() function.
+     *
+     * @see AdditionalInfoType
+     * @see OperationMode
+     * @param   event sensor event to be injected
+     * @return  result OK on success; PERMISSION_DENIED if operation is not
+     *          allowed; INVALID_OPERATION, if this functionality is
+     *          unsupported; BAD_VALUE if sensor event cannot be injected.
      */
     injectSensorData(Event event) generates (Result result);
+
+    /*
+     * Register direct report channel.
+     *
+     * Register a direct channel with supplied shared memory information. Upon
+     * return, the sensor hardware is responsible for resetting the memory
+     * content to initial value (depending on memory format settings).
+     *
+     * @param   mem shared memory info data structure.
+     * @return  result OK on success; BAD_VALUE if shared memory information is
+     *          not consistent; NO_MEMORY if shared memory cannot be used by
+     *          sensor system; INVALID_OPERATION if functionality is not
+     *          supported.
+     * @return  channelHandle a positive integer used for referencing registered
+     *          direct channel (>0) in configureDirectReport and
+     *          unregisterDirectChannel if result is OK, -1 otherwise.
+     */
+    registerDirectChannel(SharedMemInfo mem)
+            generates (Result result, int32_t channelHandle);
+
+    /*
+     * Unregister direct report channel.
+     *
+     * Unregister a direct channel previously registered using
+     * registerDirectChannel, and remove all active sensor report configured in
+     * still active sensor report configured in the direct channel.
+     *
+     * @param   channelHandle handle of direct channel to be unregistered.
+     * @return  result OK if direct report is supported; INVALID_OPERATION
+     *          otherwise.
+     */
+    unregisterDirectChannel(int32_t channelHandle) generates (Result result);
+
+    /*
+     * Configure direct sensor event report in direct channel.
+     *
+     * This function start, modify rate or stop direct report of a sensor in a
+     * certain direct channel.
+     *
+     * @param   sensorHandle handle of sensor to be configured. When combined
+     *          with STOP rate, sensorHandle can be -1 to denote all active
+     *          sensors in the direct channel specified by channel Handle.
+     * @param   channelHandle handle of direct channel to be configured.
+     * @param   rate rate level, see RateLevel enum.
+     *
+     * @return  result OK on success; BAD_VALUE if parameter is invalid (such as
+     *          rate level is not supported by sensor, channelHandle does not
+     *          exist, etc); INVALID_OPERATION if functionality is not
+     *          supported.
+     * @return  reportToken positive integer to identify multiple sensors of
+     *          the same type in a single direct channel. Ignored if rate is
+     *          STOP. See SharedMemFormat.
+     */
+    configDirectReport(
+            int32_t sensorHandle, int32_t channelHandle, RateLevel rate)
+            generates (Result result, int32_t reportToken);
 };
diff --git a/sensors/1.0/default/Sensors.cpp b/sensors/1.0/default/Sensors.cpp
index c76369f..41eb945 100644
--- a/sensors/1.0/default/Sensors.cpp
+++ b/sensors/1.0/default/Sensors.cpp
@@ -42,10 +42,12 @@
     switch (err) {
         case OK:
             return Result::OK;
-        case BAD_VALUE:
-            return Result::BAD_VALUE;
         case PERMISSION_DENIED:
             return Result::PERMISSION_DENIED;
+        case NO_MEMORY:
+            return Result::NO_MEMORY;
+        case BAD_VALUE:
+            return Result::BAD_VALUE;
         default:
             return Result::INVALID_OPERATION;
     }
@@ -102,7 +104,7 @@
     return mInitCheck;
 }
 
-Return<void> Sensors::getSensorsList(getSensorsList_cb _aidl_cb) {
+Return<void> Sensors::getSensorsList(getSensorsList_cb _hidl_cb) {
     sensor_t const *list;
     size_t count = mSensorModule->get_sensors_list(mSensorModule, &list);
 
@@ -116,7 +118,7 @@
         convertFromSensor(*src, dst);
     }
 
-    _aidl_cb(out);
+    _hidl_cb(out);
 
     return Void();
 }
@@ -142,33 +144,25 @@
                 enabled));
 }
 
-Return<Result> Sensors::setDelay(
-        int32_t sensor_handle, int64_t sampling_period_ns) {
-    return ResultFromStatus(
-            mSensorDevice->setDelay(
-                reinterpret_cast<sensors_poll_device_t *>(mSensorDevice),
-                sensor_handle,
-                sampling_period_ns));
-}
-
-Return<void> Sensors::poll(int32_t maxCount, poll_cb _aidl_cb) {
+Return<void> Sensors::poll(int32_t maxCount, poll_cb _hidl_cb) {
     hidl_vec<Event> out;
     hidl_vec<SensorInfo> dynamicSensorsAdded;
 
     if (maxCount <= 0) {
-        _aidl_cb(Result::BAD_VALUE, out, dynamicSensorsAdded);
+        _hidl_cb(Result::BAD_VALUE, out, dynamicSensorsAdded);
         return Void();
     }
 
-    std::unique_ptr<sensors_event_t[]> data(new sensors_event_t[maxCount]);
+    int bufferSize = maxCount <= kPollMaxBufferSize ? maxCount : kPollMaxBufferSize;
+
+    std::unique_ptr<sensors_event_t[]> data(new sensors_event_t[bufferSize]);
 
     int err = mSensorDevice->poll(
             reinterpret_cast<sensors_poll_device_t *>(mSensorDevice),
-            data.get(),
-            maxCount);
+            data.get(), bufferSize);
 
     if (err < 0) {
-        _aidl_cb(ResultFromStatus(err), out, dynamicSensorsAdded);
+        _hidl_cb(ResultFromStatus(err), out, dynamicSensorsAdded);
         return Void();
     }
 
@@ -199,21 +193,20 @@
     out.resize(count);
     convertFromSensorEvents(err, data.get(), &out);
 
-    _aidl_cb(Result::OK, out, dynamicSensorsAdded);
+    _hidl_cb(Result::OK, out, dynamicSensorsAdded);
 
     return Void();
 }
 
 Return<Result> Sensors::batch(
         int32_t sensor_handle,
-        int32_t flags,
         int64_t sampling_period_ns,
         int64_t max_report_latency_ns) {
     return ResultFromStatus(
             mSensorDevice->batch(
                 mSensorDevice,
                 sensor_handle,
-                flags,
+                0, /*flags*/
                 sampling_period_ns,
                 max_report_latency_ns));
 }
@@ -234,6 +227,73 @@
             mSensorDevice->inject_sensor_data(mSensorDevice, &out));
 }
 
+Return<void> Sensors::registerDirectChannel(
+        const SharedMemInfo& mem, registerDirectChannel_cb _hidl_cb) {
+    if (mSensorDevice->register_direct_channel == nullptr
+            || mSensorDevice->config_direct_report == nullptr) {
+        // HAL does not support
+        _hidl_cb(Result::INVALID_OPERATION, -1);
+        return Void();
+    }
+
+    sensors_direct_mem_t m;
+    if (!convertFromSharedMemInfo(mem, &m)) {
+      _hidl_cb(Result::BAD_VALUE, -1);
+      return Void();
+    }
+
+    int err = mSensorDevice->register_direct_channel(mSensorDevice, &m, -1);
+
+    if (err < 0) {
+        _hidl_cb(ResultFromStatus(err), -1);
+    } else {
+        int32_t channelHandle = static_cast<int32_t>(err);
+        _hidl_cb(Result::OK, channelHandle);
+    }
+    return Void();
+}
+
+Return<Result> Sensors::unregisterDirectChannel(int32_t channelHandle) {
+    if (mSensorDevice->register_direct_channel == nullptr
+            || mSensorDevice->config_direct_report == nullptr) {
+        // HAL does not support
+        return Result::INVALID_OPERATION;
+    }
+
+    mSensorDevice->register_direct_channel(mSensorDevice, nullptr, channelHandle);
+
+    return Result::OK;
+}
+
+Return<void> Sensors::configDirectReport(
+        int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
+        configDirectReport_cb _hidl_cb) {
+    if (mSensorDevice->register_direct_channel == nullptr
+            || mSensorDevice->config_direct_report == nullptr) {
+        // HAL does not support
+        _hidl_cb(Result::INVALID_OPERATION, -1);
+        return Void();
+    }
+
+    sensors_direct_cfg_t cfg = {
+        .rate_level = convertFromRateLevel(rate)
+    };
+    if (cfg.rate_level < 0) {
+        _hidl_cb(Result::BAD_VALUE, -1);
+        return Void();
+    }
+
+    int err = mSensorDevice->config_direct_report(mSensorDevice,
+            sensorHandle, channelHandle, &cfg);
+
+    if (rate == RateLevel::STOP) {
+        _hidl_cb(ResultFromStatus(err), -1);
+    } else {
+        _hidl_cb(err > 0 ? Result::OK : ResultFromStatus(err), err);
+    }
+    return Void();
+}
+
 // static
 void Sensors::convertFromSensorEvents(
         size_t count,
diff --git a/sensors/1.0/default/Sensors.h b/sensors/1.0/default/Sensors.h
index f9b837d..09729d3 100644
--- a/sensors/1.0/default/Sensors.h
+++ b/sensors/1.0/default/Sensors.h
@@ -27,26 +27,23 @@
 namespace V1_0 {
 namespace implementation {
 
+
 struct Sensors : public ::android::hardware::sensors::V1_0::ISensors {
     Sensors();
 
     status_t initCheck() const;
 
-    Return<void> getSensorsList(getSensorsList_cb _aidl_cb) override;
+    Return<void> getSensorsList(getSensorsList_cb _hidl_cb) override;
 
     Return<Result> setOperationMode(OperationMode mode) override;
 
     Return<Result> activate(
             int32_t sensor_handle, bool enabled) override;
 
-    Return<Result> setDelay(
-            int32_t sensor_handle, int64_t sampling_period_ns) override;
-
     Return<void> poll(int32_t maxCount, poll_cb _hidl_cb) override;
 
     Return<Result> batch(
             int32_t sensor_handle,
-            int32_t flags,
             int64_t sampling_period_ns,
             int64_t max_report_latency_ns) override;
 
@@ -54,7 +51,17 @@
 
     Return<Result> injectSensorData(const Event& event) override;
 
+    Return<void> registerDirectChannel(
+            const SharedMemInfo& mem, registerDirectChannel_cb _hidl_cb) override;
+
+    Return<Result> unregisterDirectChannel(int32_t channelHandle) override;
+
+    Return<void> configDirectReport(
+            int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
+            configDirectReport_cb _hidl_cb) override;
+
 private:
+    static constexpr int32_t kPollMaxBufferSize = 128;
     status_t mInitCheck;
     sensors_module_t *mSensorModule;
     sensors_poll_device_1_t *mSensorDevice;
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index 18725e7..acff6ca 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -72,18 +72,18 @@
     dst->timestamp = src.timestamp;
 
     switch (dst->sensorType) {
-        case SensorType::SENSOR_TYPE_META_DATA:
+        case SensorType::META_DATA:
         {
             dst->u.meta.what = (MetaDataEventType)src.meta_data.what;
             break;
         }
 
-        case SensorType::SENSOR_TYPE_ACCELEROMETER:
-        case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
-        case SensorType::SENSOR_TYPE_ORIENTATION:
-        case SensorType::SENSOR_TYPE_GYROSCOPE:
-        case SensorType::SENSOR_TYPE_GRAVITY:
-        case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
+        case SensorType::ACCELEROMETER:
+        case SensorType::MAGNETIC_FIELD:
+        case SensorType::ORIENTATION:
+        case SensorType::GYROSCOPE:
+        case SensorType::GRAVITY:
+        case SensorType::LINEAR_ACCELERATION:
         {
             dst->u.vec3.x = src.acceleration.x;
             dst->u.vec3.y = src.acceleration.y;
@@ -92,9 +92,9 @@
             break;
         }
 
-        case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
-        case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
-        case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
+        case SensorType::ROTATION_VECTOR:
+        case SensorType::GAME_ROTATION_VECTOR:
+        case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
         {
             dst->u.vec4.x = src.data[0];
             dst->u.vec4.y = src.data[1];
@@ -103,146 +103,148 @@
             break;
         }
 
-        case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
-        case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
-        {
-            dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
-            dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
-            dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
-            dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
-            dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
-            dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
-            break;
-        }
+      case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+      case SensorType::GYROSCOPE_UNCALIBRATED:
+      case SensorType::ACCELEROMETER_UNCALIBRATED:
+      {
+          dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
+          dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
+          dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
+          dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
+          dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
+          dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
-        case SensorType::SENSOR_TYPE_LIGHT:
-        case SensorType::SENSOR_TYPE_PRESSURE:
-        case SensorType::SENSOR_TYPE_TEMPERATURE:
-        case SensorType::SENSOR_TYPE_PROXIMITY:
-        case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
-        case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
-        case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
-        case SensorType::SENSOR_TYPE_STEP_DETECTOR:
-        case SensorType::SENSOR_TYPE_TILT_DETECTOR:
-        case SensorType::SENSOR_TYPE_WAKE_GESTURE:
-        case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
-        case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
-        case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
-        case SensorType::SENSOR_TYPE_STATIONARY_DETECT:
-        case SensorType::SENSOR_TYPE_MOTION_DETECT:
-        case SensorType::SENSOR_TYPE_HEART_BEAT:
-        {
-            dst->u.scalar = src.data[0];
-            break;
-        }
+      case SensorType::DEVICE_ORIENTATION:
+      case SensorType::LIGHT:
+      case SensorType::PRESSURE:
+      case SensorType::TEMPERATURE:
+      case SensorType::PROXIMITY:
+      case SensorType::RELATIVE_HUMIDITY:
+      case SensorType::AMBIENT_TEMPERATURE:
+      case SensorType::SIGNIFICANT_MOTION:
+      case SensorType::STEP_DETECTOR:
+      case SensorType::TILT_DETECTOR:
+      case SensorType::WAKE_GESTURE:
+      case SensorType::GLANCE_GESTURE:
+      case SensorType::PICK_UP_GESTURE:
+      case SensorType::WRIST_TILT_GESTURE:
+      case SensorType::STATIONARY_DETECT:
+      case SensorType::MOTION_DETECT:
+      case SensorType::HEART_BEAT:
+      {
+          dst->u.scalar = src.data[0];
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_STEP_COUNTER:
-        {
-            dst->u.stepCount = src.u64.step_counter;
-            break;
-        }
+      case SensorType::STEP_COUNTER:
+      {
+          dst->u.stepCount = src.u64.step_counter;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_HEART_RATE:
-        {
-            dst->u.heartRate.bpm = src.heart_rate.bpm;
-            dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
-            break;
-        }
+      case SensorType::HEART_RATE:
+      {
+          dst->u.heartRate.bpm = src.heart_rate.bpm;
+          dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_POSE_6DOF:  // 15 floats
-        {
-            for (size_t i = 0; i < 15; ++i) {
-                dst->u.pose6DOF[i] = src.data[i];
-            }
-            break;
-        }
+      case SensorType::POSE_6DOF:  // 15 floats
+      {
+          for (size_t i = 0; i < 15; ++i) {
+              dst->u.pose6DOF[i] = src.data[i];
+          }
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
-        {
-            dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
-            dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
+      case SensorType::DYNAMIC_SENSOR_META:
+      {
+          dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
+          dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
 
-            memcpy(dst->u.dynamic.uuid.data(),
-                   src.dynamic_sensor_meta.uuid,
-                   16);
+          memcpy(dst->u.dynamic.uuid.data(),
+                 src.dynamic_sensor_meta.uuid,
+                 16);
 
-            break;
-        }
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_ADDITIONAL_INFO:
-        {
-            ::android::hardware::sensors::V1_0::AdditionalInfo *dstInfo =
-                &dst->u.additional;
+      case SensorType::ADDITIONAL_INFO:
+      {
+          ::android::hardware::sensors::V1_0::AdditionalInfo *dstInfo =
+              &dst->u.additional;
 
-            const additional_info_event_t &srcInfo = src.additional_info;
+          const additional_info_event_t &srcInfo = src.additional_info;
 
-            dstInfo->type =
-                (::android::hardware::sensors::V1_0::AdditionalInfoType)
-                    srcInfo.type;
+          dstInfo->type =
+              (::android::hardware::sensors::V1_0::AdditionalInfoType)
+                  srcInfo.type;
 
-            dstInfo->serial = srcInfo.serial;
+          dstInfo->serial = srcInfo.serial;
 
-            CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
-            memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
-            break;
-        }
+          CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
+          memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
+          break;
+      }
 
-        default:
-        {
-            CHECK_GE((int32_t)dst->sensorType,
-                     (int32_t)SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE);
+      default:
+      {
+          CHECK_GE((int32_t)dst->sensorType,
+                   (int32_t)SensorType::DEVICE_PRIVATE_BASE);
 
-            memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
-            break;
-        }
-    }
+          memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
+          break;
+      }
+  }
 }
 
 void convertToSensorEvent(const Event &src, sensors_event_t *dst) {
-    dst->version = sizeof(sensors_event_t);
-    dst->sensor = src.sensorHandle;
-    dst->type = (int32_t)src.sensorType;
-    dst->reserved0 = 0;
-    dst->timestamp = src.timestamp;
-    dst->flags = 0;
-    dst->reserved1[0] = dst->reserved1[1] = dst->reserved1[2] = 0;
+  dst->version = sizeof(sensors_event_t);
+  dst->sensor = src.sensorHandle;
+  dst->type = (int32_t)src.sensorType;
+  dst->reserved0 = 0;
+  dst->timestamp = src.timestamp;
+  dst->flags = 0;
+  dst->reserved1[0] = dst->reserved1[1] = dst->reserved1[2] = 0;
 
-    switch (src.sensorType) {
-        case SensorType::SENSOR_TYPE_META_DATA:
-        {
-            dst->meta_data.what = (int32_t)src.u.meta.what;
-            dst->meta_data.sensor = dst->sensor;
-            break;
-        }
+  switch (src.sensorType) {
+      case SensorType::META_DATA:
+      {
+          dst->meta_data.what = (int32_t)src.u.meta.what;
+          dst->meta_data.sensor = dst->sensor;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_ACCELEROMETER:
-        case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
-        case SensorType::SENSOR_TYPE_ORIENTATION:
-        case SensorType::SENSOR_TYPE_GYROSCOPE:
-        case SensorType::SENSOR_TYPE_GRAVITY:
-        case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
-        {
-            dst->acceleration.x = src.u.vec3.x;
-            dst->acceleration.y = src.u.vec3.y;
-            dst->acceleration.z = src.u.vec3.z;
-            dst->acceleration.status = (int8_t)src.u.vec3.status;
-            break;
-        }
+      case SensorType::ACCELEROMETER:
+      case SensorType::MAGNETIC_FIELD:
+      case SensorType::ORIENTATION:
+      case SensorType::GYROSCOPE:
+      case SensorType::GRAVITY:
+      case SensorType::LINEAR_ACCELERATION:
+      {
+          dst->acceleration.x = src.u.vec3.x;
+          dst->acceleration.y = src.u.vec3.y;
+          dst->acceleration.z = src.u.vec3.z;
+          dst->acceleration.status = (int8_t)src.u.vec3.status;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
-        case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
-        case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
-        {
-            dst->data[0] = src.u.vec4.x;
-            dst->data[1] = src.u.vec4.y;
-            dst->data[2] = src.u.vec4.z;
-            dst->data[3] = src.u.vec4.w;
-            break;
-        }
+      case SensorType::ROTATION_VECTOR:
+      case SensorType::GAME_ROTATION_VECTOR:
+      case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
+      {
+          dst->data[0] = src.u.vec4.x;
+          dst->data[1] = src.u.vec4.y;
+          dst->data[2] = src.u.vec4.z;
+          dst->data[3] = src.u.vec4.w;
+          break;
+      }
 
-        case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
-        case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+      case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+        case SensorType::GYROSCOPE_UNCALIBRATED:
+        case SensorType::ACCELEROMETER_UNCALIBRATED:
         {
             dst->uncalibrated_gyro.x_uncalib = src.u.uncal.x;
             dst->uncalibrated_gyro.y_uncalib = src.u.uncal.y;
@@ -253,42 +255,42 @@
             break;
         }
 
-        case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
-        case SensorType::SENSOR_TYPE_LIGHT:
-        case SensorType::SENSOR_TYPE_PRESSURE:
-        case SensorType::SENSOR_TYPE_TEMPERATURE:
-        case SensorType::SENSOR_TYPE_PROXIMITY:
-        case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
-        case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
-        case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
-        case SensorType::SENSOR_TYPE_STEP_DETECTOR:
-        case SensorType::SENSOR_TYPE_TILT_DETECTOR:
-        case SensorType::SENSOR_TYPE_WAKE_GESTURE:
-        case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
-        case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
-        case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
-        case SensorType::SENSOR_TYPE_STATIONARY_DETECT:
-        case SensorType::SENSOR_TYPE_MOTION_DETECT:
-        case SensorType::SENSOR_TYPE_HEART_BEAT:
+        case SensorType::DEVICE_ORIENTATION:
+        case SensorType::LIGHT:
+        case SensorType::PRESSURE:
+        case SensorType::TEMPERATURE:
+        case SensorType::PROXIMITY:
+        case SensorType::RELATIVE_HUMIDITY:
+        case SensorType::AMBIENT_TEMPERATURE:
+        case SensorType::SIGNIFICANT_MOTION:
+        case SensorType::STEP_DETECTOR:
+        case SensorType::TILT_DETECTOR:
+        case SensorType::WAKE_GESTURE:
+        case SensorType::GLANCE_GESTURE:
+        case SensorType::PICK_UP_GESTURE:
+        case SensorType::WRIST_TILT_GESTURE:
+        case SensorType::STATIONARY_DETECT:
+        case SensorType::MOTION_DETECT:
+        case SensorType::HEART_BEAT:
         {
             dst->data[0] = src.u.scalar;
             break;
         }
 
-        case SensorType::SENSOR_TYPE_STEP_COUNTER:
+        case SensorType::STEP_COUNTER:
         {
             dst->u64.step_counter = src.u.stepCount;
             break;
         }
 
-        case SensorType::SENSOR_TYPE_HEART_RATE:
+        case SensorType::HEART_RATE:
         {
             dst->heart_rate.bpm = src.u.heartRate.bpm;
             dst->heart_rate.status = (int8_t)src.u.heartRate.status;
             break;
         }
 
-        case SensorType::SENSOR_TYPE_POSE_6DOF:  // 15 floats
+        case SensorType::POSE_6DOF:  // 15 floats
         {
             for (size_t i = 0; i < 15; ++i) {
                 dst->data[i] = src.u.pose6DOF[i];
@@ -296,7 +298,7 @@
             break;
         }
 
-        case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
+        case SensorType::DYNAMIC_SENSOR_META:
         {
             dst->dynamic_sensor_meta.connected = src.u.dynamic.connected;
             dst->dynamic_sensor_meta.handle = src.u.dynamic.sensorHandle;
@@ -309,7 +311,7 @@
             break;
         }
 
-        case SensorType::SENSOR_TYPE_ADDITIONAL_INFO:
+        case SensorType::ADDITIONAL_INFO:
         {
             const ::android::hardware::sensors::V1_0::AdditionalInfo &srcInfo =
                 src.u.additional;
@@ -330,7 +332,7 @@
         default:
         {
             CHECK_GE((int32_t)src.sensorType,
-                     (int32_t)SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE);
+                     (int32_t)SensorType::DEVICE_PRIVATE_BASE);
 
             memcpy(dst->data, src.u.data.data(), 16 * sizeof(float));
             break;
@@ -338,6 +340,50 @@
     }
 }
 
+bool convertFromSharedMemInfo(const SharedMemInfo& memIn, sensors_direct_mem_t *memOut) {
+    if (memOut == nullptr) {
+        return false;
+    }
+
+    switch(memIn.type) {
+        case SharedMemType::ASHMEM:
+            memOut->type = SENSOR_DIRECT_MEM_TYPE_ASHMEM;
+            break;
+        case SharedMemType::GRALLOC:
+            memOut->type = SENSOR_DIRECT_MEM_TYPE_GRALLOC;
+            break;
+        default:
+            return false;
+    }
+
+    switch(memIn.format) {
+        case SharedMemFormat::SENSORS_EVENT:
+            memOut->format = SENSOR_DIRECT_FMT_SENSORS_EVENT;
+            break;
+        default:
+            return false;
+    }
+
+    memOut->size = memIn.size;
+    memOut->handle = memIn.memoryHandle;
+    return true;
+}
+
+int convertFromRateLevel(RateLevel rate) {
+    switch(rate) {
+        case RateLevel::STOP:
+            return SENSOR_DIRECT_RATE_STOP;
+        case RateLevel::NORMAL:
+            return SENSOR_DIRECT_RATE_NORMAL;
+        case RateLevel::FAST:
+            return SENSOR_DIRECT_RATE_FAST;
+        case RateLevel::VERY_FAST:
+            return SENSOR_DIRECT_RATE_VERY_FAST;
+        default:
+            return -1;
+    }
+}
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace sensors
diff --git a/sensors/1.0/default/include/sensors/convert.h b/sensors/1.0/default/include/sensors/convert.h
index d289a81..c3a0125 100644
--- a/sensors/1.0/default/include/sensors/convert.h
+++ b/sensors/1.0/default/include/sensors/convert.h
@@ -33,6 +33,9 @@
 void convertFromSensorEvent(const sensors_event_t &src, Event *dst);
 void convertToSensorEvent(const Event &src, sensors_event_t *dst);
 
+bool convertFromSharedMemInfo(const SharedMemInfo& memIn, sensors_direct_mem_t *memOut);
+int convertFromRateLevel(RateLevel rate);
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace sensors
diff --git a/sensors/1.0/types.hal b/sensors/1.0/types.hal
index 460cef5..c0d8c5d 100644
--- a/sensors/1.0/types.hal
+++ b/sensors/1.0/types.hal
@@ -25,18 +25,19 @@
 /* Type enumerating various result codes returned from ISensors methods */
 enum Result : int32_t {
     OK,
-    BAD_VALUE,
-    PERMISSION_DENIED,
-    INVALID_OPERATION,
+    PERMISSION_DENIED                   = -1,
+    NO_MEMORY                           = -12,
+    BAD_VALUE                           = -22,
+    INVALID_OPERATION                   = -38,
 };
 
 /*
  * Sensor HAL modes used in setOperationMode method
  */
-@export(name="")
+@export(name="", value_prefix="SENSOR_HAL_", value_suffix="_MODE")
 enum OperationMode : int32_t {
-    SENSOR_HAL_NORMAL_MODE              = 0,
-    SENSOR_HAL_DATA_INJECTION_MODE      = 1,
+    NORMAL                          = 0,
+    DATA_INJECTION                  = 1,
 };
 
 /*
@@ -51,21 +52,22 @@
  * Device manufacturers (OEMs) can define their own sensor types, for
  * their private use by applications or services provided by them. Such
  * sensor types are specific to an OEM and can't be exposed in the SDK.
- * These types must start at SENSOR_TYPE_DEVICE_PRIVATE_BASE.
+ * These types must start at SensorType::DEVICE_PRIVATE_BASE.
  *
  * All sensors defined outside of the device private range must correspond to
  * a type defined in this file, and must satisfy the characteristics listed in
  * the description of the sensor type.
  *
  * Each sensor also has a "typeAsString".
- *  - StringType of sensors inside of the device private range MUST be prefixed
+ *  - string type of sensors defined in this file is overridden by Android to
+ *    values defined in Android API with "android.sensor." prefix.
+ *    Example: for an accelerometer,
+ *      type = SensorType::Acclerometer
+ *      typeAsString = "" (will be replace by "android.sensor.accelerometer" by
+ *                         Android frameowrk)
+ *  - string type of sensors inside of the device private range MUST be prefixed
  *    by the sensor provider's or OEM reverse domain name. In particular, they
- *    cannot use the "android.sensor" prefix.
- *  - StringType of sensors outside of the device private range MUST correspond
- *    to the one defined in this file (starting with "android.sensor").
- *    For example, accelerometers must have
- *      type=SENSOR_TYPE_ACCELEROMETER and
- *      stringType=SENSOR_STRING_TYPE_ACCELEROMETER
+ *    cannot use the "android.sensor." prefix.
  *
  * When android introduces a new sensor type that can replace an OEM-defined
  * sensor type, the OEM must use the official sensor type and stringType on
@@ -75,13 +77,14 @@
  * detecting that Glass is on a head.
  *  - Such a sensor is not officially supported in android KitKat
  *  - Glass devices launching on KitKat can implement a sensor with
- *    type = 0x10001 and stringType = "com.google.glass.onheaddetector"
+ *      type = 0x10001
+ *      typeAsString = "com.google.glass.onheaddetector"
  *  - In L android release, if android decides to define
- *    SENSOR_TYPE_ON_HEAD_DETECTOR and STRING_SENSOR_TYPE_ON_HEAD_DETECTOR,
+ *    SensorType::ON_HEAD_DETECTOR and STRING_SensorType::ON_HEAD_DETECTOR,
  *    those types should replace the Glass-team-specific types in all future
  *    launches.
  *  - When launching Glass on the L release, Google should now use the official
- *    type (SENSOR_TYPE_ON_HEAD_DETECTOR) and stringType.
+ *    type (SensorType::ON_HEAD_DETECTOR) and stringType.
  *  - This way, all applications can now use this sensor.
  */
 
@@ -98,42 +101,42 @@
  * different rates independently of each other.
  *
  * Note: Proximity sensor and significant motion sensor which were defined in
- * previous releases are also wake-up sensors and should be treated as such.
+ * previous releases are also wake-up sensors and must be treated as such.
  * Wake-up one-shot sensors like SIGNIFICANT_MOTION cannot be batched, hence
  * the text about batch above doesn't apply to them. See the definitions of
- * SENSOR_TYPE_PROXIMITY and SENSOR_TYPE_SIGNIFICANT_MOTION for more info.
+ * SensorType::PROXIMITY and SensorType::SIGNIFICANT_MOTION for more info.
  *
  * Set SENSOR_FLAG_WAKE_UP flag for all wake-up sensors.
  *
- * For example, A device can have two sensors both of SENSOR_TYPE_ACCELEROMETER
+ * For example, A device can have two sensors both of SensorType::ACCELEROMETER
  * and one of them can be a wake_up sensor (with SENSOR_FLAG_WAKE_UP flag set)
  * and the other can be a regular non wake_up sensor. Both of these sensors
  * must be activated/deactivated independently of the other.
  */
 
-@export(name="")
+@export(name="", value_prefix="SENSOR_TYPE_")
 enum SensorType : int32_t {
     /* META_DATA is a special event type used to populate the MetaData
      * structure. It doesn't correspond to a physical sensor. Events of this
      * type exist only inside the HAL, their primary purpose is to signal the
      * completion of a flush request.
      */
-    SENSOR_TYPE_META_DATA                       = 0,
+    META_DATA                       = 0,
 
     /*
-     * SENSOR_TYPE_ACCELEROMETER
+     * ACCELEROMETER
      * reporting-mode: continuous
      *
      * All values are in SI units (m/s^2) and measure the acceleration of the
-     * device minus the force of gravity.
+     * device minus the acceleration due to gravity.
      *
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_ACCELEROMETER                   = 1,
+    ACCELEROMETER                   = 1,
 
     /*
-     * SENSOR_TYPE_GEOMAGNETIC_FIELD
+     * MAGNETIC_FIELD
      * reporting-mode: continuous
      *
      * All values are in micro-Tesla (uT) and measure the geomagnetic
@@ -142,10 +145,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GEOMAGNETIC_FIELD               = 2,
+    MAGNETIC_FIELD                  = 2,
 
     /*
-     * SENSOR_TYPE_ORIENTATION
+     * ORIENTATION
      * reporting-mode: continuous
      *
      * All values are angles in degrees.
@@ -156,10 +159,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_ORIENTATION                     = 3,
+    ORIENTATION                     = 3,
 
     /*
-     * SENSOR_TYPE_GYROSCOPE
+     * GYROSCOPE
      * reporting-mode: continuous
      *
      * All values are in radians/second and measure the rate of rotation
@@ -168,20 +171,20 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GYROSCOPE                       = 4,
+    GYROSCOPE                       = 4,
 
     /*
-     * SENSOR_TYPE_LIGHT
+     * LIGHT
      * reporting-mode: on-change
      *
      * The light sensor value is returned in SI lux units.
      *
      * Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_LIGHT                           = 5,
+    LIGHT                           = 5,
 
     /*
-     * SENSOR_TYPE_PRESSURE
+     * PRESSURE
      * reporting-mode: continuous
      *
      * The pressure sensor return the athmospheric pressure in hectopascal (hPa)
@@ -189,13 +192,13 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_PRESSURE                        = 6,
+    PRESSURE                        = 6,
 
-    /* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */
-    SENSOR_TYPE_TEMPERATURE                     = 7,
+    /* TEMPERATURE is deprecated in the HAL */
+    TEMPERATURE                     = 7,
 
     /*
-     * SENSOR_TYPE_PROXIMITY
+     * PROXIMITY
      * reporting-mode: on-change
      *
      * The proximity sensor which turns the screen off and back on during calls
@@ -205,10 +208,10 @@
      * The value corresponds to the distance to the nearest object in
      * centimeters.
      */
-    SENSOR_TYPE_PROXIMITY                       = 8,
+    PROXIMITY                       = 8,
 
     /*
-     * SENSOR_TYPE_GRAVITY
+     * GRAVITY
      * reporting-mode: continuous
      *
      * A gravity output indicates the direction of and magnitude of gravity in
@@ -217,10 +220,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GRAVITY                         = 9,
+    GRAVITY                         = 9,
 
     /*
-     * SENSOR_TYPE_LINEAR_ACCELERATION
+     * LINEAR_ACCELERATION
      * reporting-mode: continuous
      *
      * Indicates the linear acceleration of the device in device coordinates,
@@ -229,10 +232,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_LINEAR_ACCELERATION             = 10,
+    LINEAR_ACCELERATION             = 10,
 
     /*
-     * SENSOR_TYPE_ROTATION_VECTOR
+     * ROTATION_VECTOR
      * reporting-mode: continuous
      *
      * The rotation vector symbolizes the orientation of the device relative to
@@ -241,10 +244,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_ROTATION_VECTOR                 = 11,
+    ROTATION_VECTOR                 = 11,
 
     /*
-     * SENSOR_TYPE_RELATIVE_HUMIDITY
+     * RELATIVE_HUMIDITY
      * reporting-mode: on-change
      *
      * A relative humidity sensor measures relative ambient air humidity and
@@ -252,44 +255,44 @@
      *
      * Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_RELATIVE_HUMIDITY               = 12,
+    RELATIVE_HUMIDITY               = 12,
 
     /*
-     * SENSOR_TYPE_AMBIENT_TEMPERATURE
+     * AMBIENT_TEMPERATURE
      * reporting-mode: on-change
      *
      * The ambient (room) temperature in degree Celsius.
      *
      * Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_AMBIENT_TEMPERATURE             = 13,
+    AMBIENT_TEMPERATURE             = 13,
 
     /*
-     * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED
+     * MAGNETIC_FIELD_UNCALIBRATED
      * reporting-mode: continuous
      *
-     * Similar to SENSOR_TYPE_MAGNETIC_FIELD, but the hard iron calibration is
+     * Similar to MAGNETIC_FIELD, but the hard iron calibration is
      * reported separately instead of being included in the measurement.
      *
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED     = 14,
+    MAGNETIC_FIELD_UNCALIBRATED     = 14,
 
     /*
-     * SENSOR_TYPE_GAME_ROTATION_VECTOR
+     * GAME_ROTATION_VECTOR
      * reporting-mode: continuous
      *
-     * Similar to SENSOR_TYPE_ROTATION_VECTOR, but not using the geomagnetic
+     * Similar to ROTATION_VECTOR, but not using the geomagnetic
      * field.
      *
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GAME_ROTATION_VECTOR            = 15,
+    GAME_ROTATION_VECTOR            = 15,
 
     /*
-     * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+     * GYROSCOPE_UNCALIBRATED
      * reporting-mode: continuous
      *
      * All values are in radians/second and measure the rate of rotation
@@ -298,10 +301,10 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GYROSCOPE_UNCALIBRATED          = 16,
+    GYROSCOPE_UNCALIBRATED          = 16,
 
     /*
-     * SENSOR_TYPE_SIGNIFICANT_MOTION
+     * SIGNIFICANT_MOTION
      * reporting-mode: one-shot
      *
      * A sensor of this type triggers an event each time significant motion
@@ -311,10 +314,10 @@
      * significant motion sensor. A non wake-up version is not useful.
      * The only allowed value to return is 1.0.
      */
-    SENSOR_TYPE_SIGNIFICANT_MOTION              = 17,
+    SIGNIFICANT_MOTION              = 17,
 
     /*
-     * SENSOR_TYPE_STEP_DETECTOR
+     * STEP_DETECTOR
      * reporting-mode: special
      *
      * A sensor of this type triggers an event each time a step is taken
@@ -323,10 +326,10 @@
      *
      * Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_STEP_DETECTOR                   = 18,
+    STEP_DETECTOR                   = 18,
 
     /*
-     * SENSOR_TYPE_STEP_COUNTER
+     * STEP_COUNTER
      * reporting-mode: on-change
      *
      * A sensor of this type returns the number of steps taken by the user since
@@ -336,22 +339,22 @@
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_STEP_COUNTER                    = 19,
+    STEP_COUNTER                    = 19,
 
     /*
-     * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
+     * GEOMAGNETIC_ROTATION_VECTOR
      * reporting-mode: continuous
      *
-     *  Similar to SENSOR_TYPE_ROTATION_VECTOR, but using a magnetometer instead
+     *  Similar to ROTATION_VECTOR, but using a magnetometer instead
      *  of using a gyroscope.
      *
      * Implement the non-wake-up version of this sensor and implement the
      * wake-up version if the system possesses a wake up fifo.
      */
-    SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR     = 20,
+    GEOMAGNETIC_ROTATION_VECTOR     = 20,
 
     /*
-     * SENSOR_TYPE_HEART_RATE
+     * HEART_RATE
      * reporting-mode: on-change
      *
      *  A sensor of this type returns the current heart rate.
@@ -363,7 +366,7 @@
      *  when heart_rate.bpm or heart_rate.status have changed since the last
      *  event. In particular, upon the first activation, unless the device is
      *  known to not be on the body, the status field of the first event must be
-     *  set to SENSOR_STATUS_UNRELIABLE. The event should be generated no faster
+     *  set to SensorStatus::UNRELIABLE. The event should be generated no faster
      *  than every period_ns passed to setDelay() or to batch().
      *  See the definition of the on-change reporting mode for more information.
      *
@@ -372,14 +375,14 @@
      *
      *  Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_HEART_RATE                      = 21,
+    HEART_RATE                      = 21,
 
     /*
-     * SENSOR_TYPE_WAKE_UP_TILT_DETECTOR
+     * WAKE_UP_TILT_DETECTOR
      * reporting-mode: special (setDelay has no impact)
      *
      * A sensor of this type generates an event each time a tilt event is
-     * detected. A tilt event should be generated if the direction of the
+     * detected. A tilt event must be generated if the direction of the
      * 2-seconds window average gravity changed by at least 35 degrees since the
      * activation or the last trigger of the sensor.
      *
@@ -394,16 +397,16 @@
      *     angle(reference_estimated_gravity, current_estimated_gravity)
      *       > 35 degrees
      *
-     * Large accelerations without a change in phone orientation should not
+     * Large accelerations without a change in phone orientation must not
      * trigger a tilt event.
      * For example, a sharp turn or strong acceleration while driving a car
-     * should not trigger a tilt event, even though the angle of the average
+     * must not trigger a tilt event, even though the angle of the average
      * acceleration might vary by more than 35 degrees.
      *
      * Typically, this sensor is implemented with the help of only an
      * accelerometer. Other sensors can be used as well if they do not increase
      * the power consumption significantly. This is a low power sensor that
-     * should allow the AP to go into suspend mode. Do not emulate this sensor
+     * must allow the AP to go into suspend mode. Do not emulate this sensor
      * in the HAL.
      * Like other wake up sensors, the driver is expected to a hold a wake_lock
      * with a timeout of 200 ms while reporting this event. The only allowed
@@ -411,10 +414,10 @@
      *
      * Implement only the wake-up version of this sensor.
      */
-    SENSOR_TYPE_TILT_DETECTOR                   = 22,
+    TILT_DETECTOR                   = 22,
 
     /*
-     * SENSOR_TYPE_WAKE_GESTURE
+     * WAKE_GESTURE
      * reporting-mode: one-shot
      *
      * A sensor enabling waking up the device based on a device specific motion.
@@ -432,14 +435,14 @@
      *
      * Implement only the wake-up version of this sensor.
      */
-    SENSOR_TYPE_WAKE_GESTURE                    = 23,
+    WAKE_GESTURE                    = 23,
 
     /*
-     * SENSOR_TYPE_GLANCE_GESTURE
+     * GLANCE_GESTURE
      * reporting-mode: one-shot
      *
      * A sensor enabling briefly turning the screen on to enable the user to
-     * glance content on screen based on a specific motion.  The device should
+     * glance content on screen based on a specific motion.  The device must
      * turn the screen off after a few moments.
      *
      * When this sensor triggers, the device turns the screen on momentarily
@@ -457,10 +460,10 @@
      *
      * Implement only the wake-up version of this sensor.
      */
-    SENSOR_TYPE_GLANCE_GESTURE                  = 24,
+    GLANCE_GESTURE                  = 24,
 
     /**
-     * SENSOR_TYPE_PICK_UP_GESTURE
+     * PICK_UP_GESTURE
      * reporting-mode: one-shot
      *
      * A sensor of this type triggers when the device is picked up regardless of
@@ -469,10 +472,10 @@
      *
      * Implement only the wake-up version of this sensor.
      */
-    SENSOR_TYPE_PICK_UP_GESTURE                 = 25,
+    PICK_UP_GESTURE                 = 25,
 
     /*
-     * SENSOR_TYPE_WRIST_TILT_GESTURE
+     * WRIST_TILT_GESTURE
      * trigger-mode: special
      * wake-up sensor: yes
      *
@@ -484,13 +487,13 @@
      *
      * Implement only the wake-up version of this sensor.
      */
-    SENSOR_TYPE_WRIST_TILT_GESTURE              = 26,
+    WRIST_TILT_GESTURE              = 26,
 
     /*
-     * SENSOR_TYPE_DEVICE_ORIENTATION
+     * DEVICE_ORIENTATION
      * reporting-mode: on-change
      *
-     * The current orientation of the device. The value should be reported in
+     * The current orientation of the device. The value is reported in
      * the "scalar" element of the EventPayload in Event. The
      * only values that can be reported are (please refer to Android Sensor
      * Coordinate System to understand the X and Y axis direction with respect
@@ -504,24 +507,24 @@
      *       (X axis is vertical and points down)
      *
      * Moving the device to an orientation where the Z axis is vertical (either
-     * up or down) should not cause a new event to be reported.
+     * up or down) must not cause a new event to be reported.
      *
      * To improve the user experience of this sensor, it is recommended to
      * implement some physical (i.e., rotation angle) and temporal (i.e., delay)
-     * hysteresis.
-     * In other words, minor or transient rotations should not cause a new event
-     * to be reported.
+     * hysteresis. In other words, minor or transient rotations must not cause
+     * a new event to be reported.
      *
-     * This sensor should only be implemented with the help of an accelerometer.
-     * This is a low power sensor that should reduce the number of interrupts of
-     * the AP. Do not emulate this sensor in the HAL.
+     * This is a low power sensor that intended to reduce interrupts of
+     * application processor and thus allow it to go sleep. Use hardware
+     * implementation based on low power consumption sensors, such as
+     * accelerometer. Device must not emulate this sensor in the HAL.
      *
      * Both wake-up and non wake-up versions are useful.
      */
-    SENSOR_TYPE_DEVICE_ORIENTATION              = 27,
+    DEVICE_ORIENTATION              = 27,
 
     /*
-     * SENSOR_TYPE_POSE_6DOF
+     * POSE_6DOF
      * trigger-mode: continuous
      *
      * A sensor of this type returns the pose of the device.
@@ -536,29 +539,29 @@
      *           . Depth Camera
      *
      */
-    SENSOR_TYPE_POSE_6DOF                       = 28,
+    POSE_6DOF                       = 28,
 
     /*
-     * SENSOR_TYPE_STATIONARY_DETECT
+     * STATIONARY_DETECT
      * trigger mode: one shot
      *
      * A sensor of this type returns an event if the device is still/stationary
-     * for a while. The period of time to monitor for statinarity should be
-     * greater than 5 seconds, and less than 10 seconds.
+     * for a while. The period of time to monitor for stationarity must be
+     * greater than 5 seconds. The latency must be less than 10 seconds.
      *
      * Stationarity here refers to absolute stationarity. eg: device on desk.
      *
      * The only allowed value to return is 1.0.
      */
-    SENSOR_TYPE_STATIONARY_DETECT               = 29,
+    STATIONARY_DETECT               = 29,
 
     /*
-     * SENSOR_TYPE_MOTION_DETECT
+     * MOTION_DETECT
      * trigger mode: one shot
      *
      * A sensor of this type returns an event if the device is not still for
-     * a while. The period of time to monitor for statinarity should be greater
-     * than 5 seconds, and less than 10 seconds.
+     * for a while. The period of time to monitor for stationarity must be
+     * greater than 5 seconds. The latency must be less than 10 seconds.
      *
      * Motion here refers to any mechanism in which the device is causes to be
      * moved in its inertial frame. eg: Pickin up the device and walking with it
@@ -568,10 +571,10 @@
      *
      * The only allowed value to return is 1.0.
      */
-    SENSOR_TYPE_MOTION_DETECT                   = 30,
+    MOTION_DETECT                   = 30,
 
     /*
-     * SENSOR_TYPE_HEART_BEAT
+     * HEART_BEAT
      * trigger mode: continuous
      *
      * A sensor of this type returns an event everytime a hear beat peak is
@@ -581,49 +584,49 @@
      * and ECG signal.
      *
      * The sensor is not expected to be optimized for latency. As a guide, a
-     * latency of up to 10 seconds is acceptable. However the timestamp attached
-     * to the event should be accurate and should correspond to the time the
-     * peak occured.
+     * latency of up to 10 seconds is acceptable. However, the timestamp attached
+     * to the event must be accuratly correspond to the time the peak occured.
      *
      * The sensor event contains a parameter for the confidence in the detection
      * of the peak where 0.0 represent no information at all, and 1.0 represents
      * certainty.
      */
-    SENSOR_TYPE_HEART_BEAT                      = 31,
+    HEART_BEAT                      = 31,
 
     /**
-     * SENSOR_TYPE_DYNAMIC_SENSOR_META
+     * DYNAMIC_SENSOR_META
      * trigger-mode: special
+     * wake-up sensor: yes
      *
      * A sensor event of this type is received when a dynamic sensor is added to
      * or removed from the system. At most one sensor of this type can be
      * present in one sensor HAL implementation and presence of a sensor of this
      * type in sensor HAL implementation indicates that this sensor HAL supports
      * dynamic sensor feature. Operations, such as batch, activate and setDelay,
-     * to this special purpose sensor should be treated as no-op and return
+     * to this special purpose sensor must be treated as no-op and return
      * successful; flush() also has to generate flush complete event as if this
      * is a sensor that does not support batching.
      *
      * A dynamic sensor connection indicates connection of a physical device or
      * instantiation of a virtual sensor backed by algorithm; and a dynamic
      * sensor disconnection indicates the the opposite. A sensor event of
-     * SENSOR_TYPE_DYNAMIC_SENSOR_META type should be delivered regardless of
+     * DYNAMIC_SENSOR_META type should be delivered regardless of
      * the activation status of the sensor in the event of dynamic sensor
      * connection and disconnection. In the sensor event, besides the common
      * data entries, "dynamic_sensor_meta", which includes fields for connection
      * status, handle of the sensor involved, pointer to sensor_t structure and
-     * a uuid field, should be populated.
+     * a uuid field, must be populated.
      *
      * At a dynamic sensor connection event, fields of sensor_t structure
-     * referenced by a pointer in dynamic_sensor_meta should be filled as if it
+     * referenced by a pointer in dynamic_sensor_meta must be filled as if it
      * was regular sensors. Sensor HAL is responsible for recovery of memory if
      * the corresponding data is dynamicially allocated. However, the the
      * pointer must be valid until the first activate call to the sensor
      * reported in this connection event. At a dynamic sensor disconnection,
-     * the sensor_t pointer should be NULL.
+     * the sensor_t pointer must be NULL.
      *
-     * The sensor handle assigned to dynamic sensors should never be the same as
-     * that of any regular static sensors, and should be unique until next boot.
+     * The sensor handle assigned to dynamic sensors must never be the same as
+     * that of any regular static sensors, and must be unique until next boot.
      * In another word, if a handle h is used for a dynamic sensor A, that same
      * number cannot be used for the same dynamic sensor A or another dynamic
      * sensor B even after disconnection of A until reboot.
@@ -631,15 +634,15 @@
      * The UUID field will be used for identifying the sensor in addition to
      * name, vendor and version and type. For physical sensors of the same
      * model, all sensors will have the same values in sensor_t, but the UUID
-     * should be unique and persistent for each individual unit. An all zero
+     * must be unique and persistent for each individual unit. An all zero
      * UUID indicates it is not possible to differentiate individual sensor
      * unit.
      *
      */
-    SENSOR_TYPE_DYNAMIC_SENSOR_META             = 32,
+    DYNAMIC_SENSOR_META             = 32,
 
     /**
-     * SENSOR_TYPE_ADDITIONAL_INFO
+     * ADDITIONAL_INFO
      * reporting-mode: N/A
      *
      * This sensor type is for delivering additional sensor information aside
@@ -649,12 +652,16 @@
      * etc.
      *
      * This type will never bind to a sensor. In other words, no sensor in the
-     * sensor list should be of the type SENSOR_TYPE_ADDITIONAL_INFO. If a
+     * sensor list can have the type SENSOR_TYPE_ADDITIONAL_INFO. If a
      * sensor HAL supports sensor additional information feature, it reports
      * sensor_event_t with "sensor" field set to handle of the reporting sensor
-     * and "type" field set to SENSOR_TYPE_ADDITIONAL_INFO. Delivery of
+     * and "type" field set to ADDITIONAL_INFO. Delivery of
      * additional information events is triggered under two conditions: an
      * enable activate() call or a flush() call to the corresponding sensor.
+     * Besides, time varying parameters can update infrequently without being
+     * triggered. Device is responsible to control update rate. The recommend
+     * update rate is less than 1/1000 of sensor event rate or less than once
+     * per minute in average.
      *
      * A single additional information report consists of multiple frames.
      * Sequences of these frames are ordered using timestamps, which means the
@@ -668,13 +675,13 @@
      * spans multiple frames. The first frame of the entire report is always of
      * type AINFO_BEGIN, and the last frame is always AINFO_END.
      *
-     * All additional information frames have to be delivered after flush
-     * complete event if flush() was triggering the report.
+     * If flush() was triggering the report, all additional information frames
+     * must be delivered after flush complete event.
      */
-    SENSOR_TYPE_ADDITIONAL_INFO                 = 33,
+    ADDITIONAL_INFO                 = 33,
 
     /*
-     * SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT
+     * LOW_LATENCY_OFFBODY_DETECT
      * trigger-mode: on-change
      * wake-up sensor: yes
      *
@@ -694,17 +701,29 @@
      *    1.0 for on-body
      *
      */
-    SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT      = 34,
+    LOW_LATENCY_OFFBODY_DETECT      = 34,
+
+    /*
+     * ACCELEROMETER_UNCALIBRATED
+     * reporting-mode: continuous
+     *
+     * All values are in SI units (m/s^2) and measure the acceleration of the
+     * device minus the acceleration due to gravity.
+     *
+     * Implement the non-wake-up version of this sensor and implement the
+     * wake-up version if the system possesses a wake up fifo.
+     */
+    ACCELEROMETER_UNCALIBRATED      = 35,
 
     /*
      * Base for device manufacturers private sensor types.
      * These sensor types can't be exposed in the SDK.
      */
-    SENSOR_TYPE_DEVICE_PRIVATE_BASE             = 0x10000
+    DEVICE_PRIVATE_BASE             = 0x10000
 };
 
-@export(name="")
-enum SensorFlagBits : uint64_t {
+@export(name="", value_prefix="SENSOR_FLAG_")
+enum SensorFlagBits : uint32_t {
     /*
      * Whether this sensor wakes up the AP from suspend mode when data is
      * available.  Whenever sensor events are delivered from a wake_up sensor,
@@ -714,7 +733,7 @@
      * SensorService, the driver can safely release the wake_lock. SensorService
      * will continue to hold a wake_lock till the app actually reads the events.
      */
-    SENSOR_FLAG_WAKE_UP                     = 1,
+    WAKE_UP                     = 1,
 
     /*
      * Reporting modes for various sensors. Each sensor will have exactly one of
@@ -722,10 +741,10 @@
      * The least significant 2nd, 3rd and 4th bits are used to represent four
      * possible reporting modes.
      */
-    SENSOR_FLAG_CONTINUOUS_MODE             = 0,
-    SENSOR_FLAG_ON_CHANGE_MODE              = 2,
-    SENSOR_FLAG_ONE_SHOT_MODE               = 4,
-    SENSOR_FLAG_SPECIAL_REPORTING_MODE      = 6,
+    CONTINUOUS_MODE             = 0,
+    ON_CHANGE_MODE              = 2,
+    ONE_SHOT_MODE               = 4,
+    SPECIAL_REPORTING_MODE      = 6,
 
     /*
      * Set this flag if the sensor supports data_injection mode and allows data
@@ -735,19 +754,58 @@
      * can be set with this flag and SensorService will inject accelerometer
      * data and read the corresponding step counts.
      */
-    SENSOR_FLAG_SUPPORTS_DATA_INJECTION     = 0x10,
+    DATA_INJECTION              = 0x10,
 
     /*
      * Set this flag if the sensor is a dynamically connected sensor. See
      * DynamicSensorInfo and DYNAMIC_SENSOR_META for details.
      */
-    SENSOR_FLAG_DYNAMIC_SENSOR              = 0x20,
+    DYNAMIC_SENSOR              = 0x20,
 
     /*
      * Set this flag if sensor additional information is supported.
      * See ADDITIONAL_INFO and AdditionalInfo for details.
      */
-    SENSOR_FLAG_ADDITIONAL_INFO             = 0x40,
+    ADDITIONAL_INFO             = 0x40,
+
+    /*
+     * Set this flag if sensor suppor direct channel backed by ashmem.
+     * See SharedMemType and registerDirectChannel for more details.
+     */
+    DIRECT_CHANNEL_ASHMEM       = 0x400,
+
+    /*
+     * Set this flag if sensor suppor direct channel backed by gralloc HAL memory.
+     * See SharedMemType and registerDirectChannel for more details.
+     */
+    DIRECT_CHANNEL_GRALLOC      = 0x800,
+
+    /*
+     * Flags mask for reporting mode of sensor.
+     */
+    MASK_REPORTING_MODE         = 0xE,
+
+    /*
+     * Flags mask for direct report maximum rate level support.
+     * See RateLevel.
+     */
+    MASK_DIRECT_REPORT          = 0x380,
+
+    /*
+     * Flags mask for all direct channel support bits.
+     * See SharedMemType.
+     */
+    MASK_DIRECT_CHANNEL         = 0xC00,
+};
+
+@export(name="sensor_flag_shift_t", value_prefix="SENSOR_FLAG_SHIFT_")
+enum SensorFlagShift : uint8_t {
+    REPORTING_MODE              = 1,
+    DATA_INJECTION              = 4,
+    DYNAMIC_SENSOR              = 5,
+    ADDITIONAL_INFO             = 6,
+    DIRECT_REPORT               = 7,
+    DIRECT_CHANNEL              = 10,
 };
 
 struct SensorInfo {
@@ -774,13 +832,14 @@
     /* this sensor's type. */
     SensorType type;
 
-    /* type of this sensor as a string. Set to corresponding
-     * SENSOR_STRING_TYPE_*.
+    /* type of this sensor as a string.
+     *
      * When defining an OEM specific sensor or sensor manufacturer specific
      * sensor, use your reserve domain name as a prefix.
-     * ex: com.google.glass.onheaddetector
-     * For sensors of known type, the android framework might overwrite this
-     * string automatically.
+     * e.g. com.google.glass.onheaddetector
+     *
+     * For sensors of known type defined in SensorType (value <
+     * SensorType::DEVICE_PRIVATE_BASE), this can be an empty string.
      */
     string typeAsString;
 
@@ -843,16 +902,16 @@
     int32_t maxDelay;
 
     /* Bitmask of SensorFlagBits */
-    uint64_t flags;
+    bitfield<SensorFlagBits> flags;
 };
 
-@export(name="")
+@export(name="", value_prefix="SENSOR_STATUS_")
 enum SensorStatus : int8_t {
-    SENSOR_STATUS_NO_CONTACT      = -1,
-    SENSOR_STATUS_UNRELIABLE      = 0,
-    SENSOR_STATUS_ACCURACY_LOW    = 1,
-    SENSOR_STATUS_ACCURACY_MEDIUM = 2,
-    SENSOR_STATUS_ACCURACY_HIGH   = 3,
+    NO_CONTACT          = -1,
+    UNRELIABLE          = 0,
+    ACCURACY_LOW        = 1,
+    ACCURACY_MEDIUM     = 2,
+    ACCURACY_HIGH       = 3,
 };
 
 struct Vec3 {
@@ -880,15 +939,12 @@
 
 struct HeartRate {
     /* Heart rate in beats per minute.
-     * Set to 0 when status is SENSOR_STATUS_UNRELIABLE or ..._NO_CONTACT
+     * Set to 0 when status is SensorStatus::UNRELIABLE or
+     * SensorStatus::NO_CONTACT
      */
     float bpm;
 
-    /* Status of the sensor for this reading. Set to one SENSOR_STATUS_...
-     * Note that this value should only be set for sensors that explicitly
-     * define the meaning of this field. This field is not piped through the
-     * framework for other sensors.
-     */
+    /* Status of the heart rate sensor for this reading. */
     SensorStatus status;
 };
 
@@ -906,7 +962,7 @@
     int32_t sensorHandle;
 
     /* UUID of a dynamic sensor (using RFC 4122 byte order)
-     * For UUID 12345678-90AB-CDEF-1122-334455667788 the uuid field should be
+     * For UUID 12345678-90AB-CDEF-1122-334455667788 the uuid field is
      * initialized as:
      *   {0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x11, ...}
      */
@@ -949,8 +1005,9 @@
      */
     AINFO_SAMPLING,
 
-    /* Sampling channel modeling information
-     * int32_t: noise type
+    // Sampling channel modeling information section
+
+    /* int32_t: noise type
      * float[n]: parameters
      */
     AINFO_CHANNEL_NOISE               = 0x20000,
@@ -980,7 +1037,7 @@
     AINFO_CHANNEL_LINEAR_TRANSFORM,
 
     /* int32_t[2]: extrapolate method, interpolate method
-     * float[n]: mapping key points in paris, (in, out)...
+     * float[n]: mapping key points in pairs, (in, out)...
      *           (may be used to model saturation).
      */
     AINFO_CHANNEL_NONLINEAR_MAP,
@@ -990,6 +1047,49 @@
      */
     AINFO_CHANNEL_RESAMPLER,
 
+    /* Operation environment parameters section
+     * Types in the following section is sent down (instead of reported from)
+     * device as additional information to aid sensor operation. Data is sent
+     * via injectSensorData() function to sensor handle -1 denoting all sensors
+     * in device.
+     */
+
+    /* Local geomagnetic field information based on device geo location. This
+     * type is primarily for for magnetic field calibration and rotation vector
+     * sensor fusion.
+     * float[3]: strength (uT), declination and inclination angle (rad).
+     */
+    AINFO_LOCAL_GEOMAGNETIC_FIELD     = 0x30000,
+
+    /* Local gravitational acceleration strength at device geo location.
+     * float: gravitational acceleration norm in m/s^2.
+     */
+    AINFO_LOCAL_GRAVITY,
+
+    /* Device dock state.
+     * int32_t: dock state following Android API Intent.EXTRA_DOCK_STATE
+     * definition, undefined value is ignored.
+     */
+    AINFO_DOCK_STATE,
+
+    /* High performance mode hint. Device is able to use up more power and take
+     * more reources to improve throughput and latency in high performance mode.
+     * One possible use case is virtual reality, when sensor latency need to be
+     * carefully controlled.
+     * int32_t: 1 or 0, denote if device is in/out of high performance mode,
+     *          other values is ignored.
+     */
+    AINFO_HIGH_PERFORMANCE_MODE,
+
+    /* Magnetic field calibration hint. Device is notified when manually
+     * triggered magnetic field calibration procedure is started or stopped. The
+     * calibration procedure is assumed timed out after 1 minute from start,
+     * even if an explicit stop is not received.
+     *
+     * int32_t: 1 for start, 0 for stop, other value is ignored.
+     */
+    AINFO_MAGNETIC_FIELD_CALIBRATION,
+
     /* Custom information */
     AINFO_CUSTOM_START                = 0x10000000,
 
@@ -1005,9 +1105,6 @@
     int32_t serial;
 
     union Payload {
-        /* for each frame, a single data type, either int32_t or float,
-         * should be used.
-         */
         int32_t[14] data_int32;
         float[14] data_float;
     } u;
@@ -1024,52 +1121,53 @@
  * relative humidity in percent
  */
 union EventPayload {
-    /* SENSOR_TYPE_ACCELEROMETER, SENSOR_TYPE_GEOMAGNETIC_FIELD,
-     * SENSOR_TYPE_ORIENTATION, SENSOR_TYPE_GYROSCOPE, SENSOR_TYPE_GRAVITY,
-     * SENSOR_TYPE_LINEAR_ACCELERATION
+    /* SensorType::ACCELEROMETER, SensorType::MAGNETIC_FIELD,
+     * SensorType::ORIENTATION, SensorType::GYROSCOPE, SensorType::GRAVITY,
+     * SensorType::LINEAR_ACCELERATION
      */
     Vec3 vec3;
 
-    /* SENSOR_TYPE_ROTATION_VECTOR, SENSOR_TYPE_GAME_ROTATION_VECTOR,
-     * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
+    /* SensorType::ROTATION_VECTOR, SensorType::GAME_ROTATION_VECTOR,
+     * SensorType::GEOMAGNETIC_ROTATION_VECTOR
      */
     Vec4 vec4;
 
-    /* SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
-     * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+    /* SensorType::MAGNETIC_FIELD_UNCALIBRATED,
+     * SensorType::GYROSCOPE_UNCALIBRATED
+     * SensorType::ACCELEROMETER_UNCALIBRATED
      */
     Uncal uncal;
 
-    /* SENSOR_TYPE_META_DATA */
+    /* SensorType::META_DATA */
     MetaData meta;
 
-    /* SENSOR_TYPE_DEVICE_ORIENTATION, SENSOR_TYPE_LIGHT, SENSOR_TYPE_PRESSURE,
-     * SENSOR_TYPE_TEMPERATURE, SENSOR_TYPE_PROXIMITY,
-     * SENSOR_TYPE_RELATIVE_HUMIDITY, SENSOR_TYPE_AMBIENT_TEMPERATURE,
-     * SENSOR_TYPE_SIGNIFICANT_MOTION, SENSOR_TYPE_STEP_DETECTOR,
-     * SENSOR_TYPE_TILT_DETECTOR, SENSOR_TYPE_WAKE_GESTURE,
-     * SENSOR_TYPE_GLANCE_GESTURE, SENSOR_TYPE_PICK_UP_GESTURE,
-     * SENSOR_TYPE_WRIST_TILT_GESTURE, SENSOR_TYPE_STATIONARY_DETECT,
-     * SENSOR_TYPE_MOTION_DETECT, SENSOR_TYPE_HEART_BEAT
+    /* SensorType::DEVICE_ORIENTATION, SensorType::LIGHT, SensorType::PRESSURE,
+     * SensorType::TEMPERATURE, SensorType::PROXIMITY,
+     * SensorType::RELATIVE_HUMIDITY, SensorType::AMBIENT_TEMPERATURE,
+     * SensorType::SIGNIFICANT_MOTION, SensorType::STEP_DETECTOR,
+     * SensorType::TILT_DETECTOR, SensorType::WAKE_GESTURE,
+     * SensorType::GLANCE_GESTURE, SensorType::PICK_UP_GESTURE,
+     * SensorType::WRIST_TILT_GESTURE, SensorType::STATIONARY_DETECT,
+     * SensorType::MOTION_DETECT, SensorType::HEART_BEAT
      */
     float scalar;
 
-    /* SENSOR_TYPE_STEP_COUNTER */
+    /* SensorType::STEP_COUNTER */
     uint64_t stepCount;
 
-    /* SENSOR_TYPE_HEART_RATE */
+    /* SensorType::HEART_RATE */
     HeartRate heartRate;
 
-    /* SENSOR_TYPE_POSE_6DOF */
+    /* SensorType::POSE_6DOF */
     float[15] pose6DOF;
 
-    /* SENSOR_TYPE_DYNAMIC_SENSOR_META */
+    /* SensorType::DYNAMIC_SENSOR_META */
     DynamicSensorInfo dynamic;
 
-    /* SENSOR_TYPE_ADDITIONAL_INFO */
+    /* SensorType::ADDITIONAL_INFO */
     AdditionalInfo additional;
 
-    /* undefined/custom sensor type, >= SENSOR_TYPE_DEVICE_PRIVATE_BASE */
+    /* undefined/custom sensor type >= SensorType::DEVICE_PRIVATE_BASE */
     float[16] data;
 };
 
@@ -1085,3 +1183,81 @@
     /* Union discriminated on sensorType */
     EventPayload u;
 };
+
+/**
+ * Direct report rate level definition. Except for SENSOR_DIRECT_RATE_STOP, each
+ * rate level covers the range (55%, 220%] * nominal report rate. For example,
+ * if config direct report specify a rate level SENSOR_DIRECT_RATE_FAST, it is
+ * legal for sensor hardware to report event at a rate greater than 110Hz, and
+ * less or equal to 440Hz. Note that rate has to remain steady without variation
+ * before new rate level is configured, i.e. if a sensor is configured to
+ * SENSOR_DIRECT_RATE_FAST and starts to report event at 256Hz, it cannot
+ * change rate to 128Hz after a few seconds of running even if 128Hz is also in
+ * the legal range of SENSOR_DIRECT_RATE_FAST. Thus, it is recommended to
+ * associate report rate with RateLvel statically for single sensor.
+ */
+@export(name="direct_rate_level_t", value_prefix="SENSOR_DIRECT_RATE_")
+enum RateLevel : int32_t {
+    STOP,            // stop
+    NORMAL,          // nominal 50Hz
+    FAST,            // nominal 200Hz
+    VERY_FAST,       // nominal 800Hz
+};
+
+/**
+ * Direct channel shared memory types. See struct SharedMemInfo.
+ */
+@export(name="direct_mem_type_t", value_prefix="SENSOR_DIRECT_MEM_TYPE_")
+enum SharedMemType : int32_t {
+    // handle contains 1 fd (ashmem handle) and 0 int.
+    ASHMEM = 1,
+    // handle definition matches gralloc HAL.
+    GRALLOC
+};
+
+
+/**
+ * Direct channel lock-free queue format, this defines how the shared memory is
+ * interpreted by both sensor hardware and application.
+ *
+ * @see SharedMemInfo.
+ */
+@export(name="direct_format_t", value_prefix="SENSOR_DIRECT_FMT_")
+enum SharedMemFormat : int32_t {
+    SENSORS_EVENT = 1,  // shared memory is formated as an array of data
+                        // elements. See SensorsEventFormatOffset for details.
+                        // Upon return of channel registration call, the
+                        // shared memory space must be formated to all 0 by HAL.
+};
+
+enum SensorsEventFormatOffset : uint16_t {
+    // offset   type        name
+    //-----------------------------------
+    // 0x0000   int32_t     size (always 104)
+    // 0x0004   int32_t     sensor report token
+    // 0x0008   int32_t     type (see SensorType)
+    // 0x000C   uint32_t    atomic counter
+    // 0x0010   int64_t     timestamp (see Event)
+    // 0x0018   float[16]/  data
+    //          int64_t[8]
+    // 0x0058   int32_t[4]  reserved (set to zero)
+    SIZE_FIELD      = 0x0,
+    REPORT_TOKEN    = 0x4,
+    SENSOR_TYPE     = 0x8,
+    ATOMIC_COUNTER  = 0xC,
+    TIMESTAMP       = 0x10,
+    DATA            = 0x18,
+    RESERVED        = 0x58,
+    TOTAL_LENGTH    = 0x68
+};
+
+/**
+ * Shared memory information for a direct channel
+ */
+struct SharedMemInfo {
+    SharedMemType type;         // shared memory type
+    SharedMemFormat format;
+    uint32_t size;              // size of the memory region, in bytes
+    handle memoryHandle;        // shared memory handle, it is interpreted
+                                // depending on type field, see SharedMemType.
+};
diff --git a/sensors/1.0/vts/Sensors.vts b/sensors/1.0/vts/Sensors.vts
index f80fff5..9e90755 100644
--- a/sensors/1.0/vts/Sensors.vts
+++ b/sensors/1.0/vts/Sensors.vts
@@ -47,22 +47,6 @@
     }
 
     api: {
-        name: "setDelay"
-        return_type_hidl: {
-            type: TYPE_ENUM
-            predefined_type: "::android::hardware::sensors::V1_0::Result"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "int32_t"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "int64_t"
-        }
-    }
-
-    api: {
         name: "poll"
         return_type_hidl: {
             type: TYPE_ENUM
@@ -100,10 +84,6 @@
         }
         arg: {
             type: TYPE_SCALAR
-            scalar_type: "int32_t"
-        }
-        arg: {
-            type: TYPE_SCALAR
             scalar_type: "int64_t"
         }
         arg: {
@@ -136,4 +116,56 @@
         }
     }
 
+    api: {
+        name: "registerDirectChannel"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::sensors::V1_0::Result"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::sensors::V1_0::SharedMemInfo"
+        }
+    }
+
+    api: {
+        name: "unregisterDirectChannel"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::sensors::V1_0::Result"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "configDirectReport"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::sensors::V1_0::Result"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::sensors::V1_0::RateLevel"
+        }
+    }
+
 }
diff --git a/sensors/1.0/vts/functional/Android.bp b/sensors/1.0/vts/functional/Android.bp
index 675484a..9ca6230 100644
--- a/sensors/1.0/vts/functional/Android.bp
+++ b/sensors/1.0/vts/functional/Android.bp
@@ -19,10 +19,11 @@
     gtest: true,
     srcs: ["sensors_hidl_hal_test.cpp"],
     shared_libs: [
-        "liblog",
-        "libhidlbase",
-        "libutils",
         "android.hardware.sensors@1.0",
+        "libcutils",
+        "libhidlbase",
+        "liblog",
+        "libutils",
     ],
     static_libs: ["libgtest"],
     cflags: [
diff --git a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
index 8e85b23..c7600f3 100644
--- a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
+++ b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
@@ -19,16 +19,20 @@
 #include <android/hardware/sensors/1.0/ISensors.h>
 #include <android/hardware/sensors/1.0/types.h>
 #include <android/log.h>
+#include <cutils/ashmem.h>
 #include <gtest/gtest.h>
 #include <hardware/sensors.h>       // for sensor type strings
 
 #include <algorithm>
 #include <cinttypes>
 #include <cmath>
+#include <memory>
 #include <mutex>
 #include <thread>
+#include <unordered_set>
 #include <vector>
 
+#include <sys/mman.h>
 #include <unistd.h>
 
 using ::android::hardware::Return;
@@ -84,6 +88,10 @@
 
   collectionEnabled = false;
   startPollingThread();
+
+  // In case framework just stopped for test and there is sensor events in the pipe,
+  // wait some time for those events to be cleared to avoid them messing up the test.
+  std::this_thread::sleep_for(std::chrono::seconds(3));
 }
 
 void SensorsHidlEnvironment::TearDown() {
@@ -144,6 +152,164 @@
   ALOGD("polling thread end");
 }
 
+class SensorsTestSharedMemory {
+ public:
+  static SensorsTestSharedMemory* create(SharedMemType type, size_t size);
+  SharedMemInfo getSharedMemInfo() const;
+  char * getBuffer() const;
+  std::vector<Event> parseEvents(int64_t lastCounter = -1, size_t offset = 0) const;
+  virtual ~SensorsTestSharedMemory();
+ private:
+  SensorsTestSharedMemory(SharedMemType type, size_t size);
+
+  SharedMemType mType;
+  native_handle_t* mNativeHandle;
+  size_t mSize;
+  char* mBuffer;
+
+  DISALLOW_COPY_AND_ASSIGN(SensorsTestSharedMemory);
+};
+
+SharedMemInfo SensorsTestSharedMemory::getSharedMemInfo() const {
+  SharedMemInfo mem = {
+    .type = mType,
+    .format = SharedMemFormat::SENSORS_EVENT,
+    .size = static_cast<uint32_t>(mSize),
+    .memoryHandle = mNativeHandle
+  };
+  return mem;
+}
+
+char * SensorsTestSharedMemory::getBuffer() const {
+  return mBuffer;
+}
+
+std::vector<Event> SensorsTestSharedMemory::parseEvents(int64_t lastCounter, size_t offset) const {
+
+  constexpr size_t kEventSize = static_cast<size_t>(SensorsEventFormatOffset::TOTAL_LENGTH);
+  constexpr size_t kOffsetSize = static_cast<size_t>(SensorsEventFormatOffset::SIZE_FIELD);
+  constexpr size_t kOffsetToken = static_cast<size_t>(SensorsEventFormatOffset::REPORT_TOKEN);
+  constexpr size_t kOffsetType = static_cast<size_t>(SensorsEventFormatOffset::SENSOR_TYPE);
+  constexpr size_t kOffsetAtomicCounter =
+      static_cast<size_t>(SensorsEventFormatOffset::ATOMIC_COUNTER);
+  constexpr size_t kOffsetTimestamp = static_cast<size_t>(SensorsEventFormatOffset::TIMESTAMP);
+  constexpr size_t kOffsetData = static_cast<size_t>(SensorsEventFormatOffset::DATA);
+
+  std::vector<Event> events;
+  std::vector<float> data(16);
+
+  while (offset + kEventSize <= mSize) {
+    int64_t atomicCounter = *reinterpret_cast<uint32_t *>(mBuffer + offset + kOffsetAtomicCounter);
+    if (atomicCounter <= lastCounter) {
+      break;
+    }
+
+    int32_t size = *reinterpret_cast<int32_t *>(mBuffer + offset + kOffsetSize);
+    if (size != kEventSize) {
+      // unknown error, events parsed may be wrong, remove all
+      events.clear();
+      break;
+    }
+
+    int32_t token = *reinterpret_cast<int32_t *>(mBuffer + offset + kOffsetToken);
+    int32_t type = *reinterpret_cast<int32_t *>(mBuffer + offset + kOffsetType);
+    int64_t timestamp = *reinterpret_cast<int64_t *>(mBuffer + offset + kOffsetTimestamp);
+
+    ALOGV("offset = %zu, cnt %" PRId32 ", token %" PRId32 ", type %" PRId32 ", timestamp %" PRId64,
+        offset, atomicCounter, token, type, timestamp);
+
+    Event event = {
+      .timestamp = timestamp,
+      .sensorHandle = token,
+      .sensorType = static_cast<SensorType>(type),
+    };
+    event.u.data = android::hardware::hidl_array<float, 16>
+        (reinterpret_cast<float*>(mBuffer + offset + kOffsetData));
+
+    events.push_back(event);
+
+    lastCounter = atomicCounter;
+    offset += kEventSize;
+  }
+
+  return events;
+}
+
+SensorsTestSharedMemory::SensorsTestSharedMemory(SharedMemType type, size_t size)
+    : mType(type), mSize(0), mBuffer(nullptr) {
+  native_handle_t *handle = nullptr;
+  char *buffer = nullptr;
+  switch(type) {
+    case SharedMemType::ASHMEM: {
+      int fd;
+      handle = ::native_handle_create(1 /*nFds*/, 0/*nInts*/);
+      if (handle != nullptr) {
+        handle->data[0] = fd = ::ashmem_create_region("SensorsTestSharedMemory", size);
+        if (handle->data[0] > 0) {
+          // memory is pinned by default
+          buffer = static_cast<char *>
+              (::mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0));
+          if (buffer != reinterpret_cast<char*>(MAP_FAILED)) {
+            break;
+          }
+          ::native_handle_close(handle);
+        }
+        ::native_handle_delete(handle);
+        handle = nullptr;
+      }
+      break;
+    }
+    default:
+      break;
+  }
+
+  if (buffer != nullptr) {
+    mNativeHandle = handle;
+    mSize = size;
+    mBuffer = buffer;
+  }
+}
+
+SensorsTestSharedMemory::~SensorsTestSharedMemory() {
+  switch(mType) {
+    case SharedMemType::ASHMEM: {
+      if (mSize != 0) {
+        ::munmap(mBuffer, mSize);
+        mBuffer = nullptr;
+
+        ::native_handle_close(mNativeHandle);
+        ::native_handle_delete(mNativeHandle);
+
+        mNativeHandle = nullptr;
+        mSize = 0;
+      }
+      break;
+    }
+    default: {
+      if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) {
+        ALOGE("SensorsTestSharedMemory %p not properly destructed: "
+            "type %d, native handle %p, size %zu, buffer %p",
+            this, static_cast<int>(mType), mNativeHandle, mSize, mBuffer);
+      }
+      break;
+    }
+  }
+}
+
+SensorsTestSharedMemory* SensorsTestSharedMemory::create(SharedMemType type, size_t size) {
+  constexpr size_t kMaxSize = 128*1024*1024; // sensor test should not need more than 128M
+  if (size == 0 || size >= kMaxSize) {
+    return nullptr;
+  }
+
+  auto m = new SensorsTestSharedMemory(type, size);
+  if (m->mSize != size || m->mBuffer == nullptr) {
+    delete m;
+    m = nullptr;
+  }
+  return m;
+}
+
 // The main test class for SENSORS HIDL HAL.
 class SensorsHidlTest : public ::testing::Test {
  public:
@@ -151,84 +317,165 @@
   }
 
   virtual void TearDown() override {
+    // stop all sensors
+    for (auto s : mSensorHandles) {
+      S()->activate(s, false);
+    }
+    mSensorHandles.clear();
+
+    // stop all direct report and channels
+    for (auto c : mDirectChannelHandles) {
+      // disable all reports
+      S()->configDirectReport(-1, c, RateLevel::STOP, [] (auto, auto){});
+      S()->unregisterDirectChannel(c);
+    }
+    mDirectChannelHandles.clear();
   }
 
  protected:
+  SensorInfo defaultSensorByType(SensorType type);
+  std::vector<Event> collectEvents(useconds_t timeLimitUs, size_t nEventLimit,
+        bool clearBeforeStart = true, bool changeCollection = true);
+
+  // implementation wrapper
+  Return<void> getSensorsList(ISensors::getSensorsList_cb _hidl_cb) {
+    return S()->getSensorsList(_hidl_cb);
+  }
+
+  Return<Result> activate(
+          int32_t sensorHandle, bool enabled);
+
+  Return<Result> batch(
+          int32_t sensorHandle,
+          int64_t samplingPeriodNs,
+          int64_t maxReportLatencyNs) {
+    return S()->batch(sensorHandle, samplingPeriodNs, maxReportLatencyNs);
+  }
+
+  Return<Result> flush(int32_t sensorHandle) {
+    return S()->flush(sensorHandle);
+  }
+
+  Return<Result> injectSensorData(const Event& event) {
+    return S()->injectSensorData(event);
+  }
+
+  Return<void> registerDirectChannel(
+          const SharedMemInfo& mem, ISensors::registerDirectChannel_cb _hidl_cb);
+
+  Return<Result> unregisterDirectChannel(int32_t channelHandle) {
+    return S()->unregisterDirectChannel(channelHandle);
+  }
+
+  Return<void> configDirectReport(
+          int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
+          ISensors::configDirectReport_cb _hidl_cb) {
+    return S()->configDirectReport(sensorHandle, channelHandle, rate, _hidl_cb);
+  }
+
   inline sp<ISensors>& S() {
     return SensorsHidlEnvironment::Instance()->sensors;
   }
 
-  std::vector<Event> collectEvents(useconds_t timeLimitUs, size_t nEventLimit,
-                                   bool clearBeforeStart = true,
-                                   bool changeCollection = true) {
-    std::vector<Event> events;
-    constexpr useconds_t SLEEP_GRANULARITY = 100*1000; //gradularity 100 ms
-
-    ALOGI("collect max of %zu events for %d us, clearBeforeStart %d",
-          nEventLimit, timeLimitUs, clearBeforeStart);
-
-    if (changeCollection) {
-      SensorsHidlEnvironment::Instance()->setCollection(true);
-    }
-    if (clearBeforeStart) {
-      SensorsHidlEnvironment::Instance()->catEvents(nullptr);
-    }
-
-    while (timeLimitUs > 0) {
-      useconds_t duration = std::min(SLEEP_GRANULARITY, timeLimitUs);
-      usleep(duration);
-      timeLimitUs -= duration;
-
-      SensorsHidlEnvironment::Instance()->catEvents(&events);
-      if (events.size() >= nEventLimit) {
-        break;
-      }
-      ALOGV("time to go = %d, events to go = %d",
-            (int)timeLimitUs, (int)(nEventLimit - events.size()));
-    }
-
-    if (changeCollection) {
-      SensorsHidlEnvironment::Instance()->setCollection(false);
-    }
-    return events;
-  }
-
-  static bool typeMatchStringType(SensorType type, const hidl_string& stringType);
-  static bool typeMatchReportMode(SensorType type, SensorFlagBits reportMode);
-  static bool delayMatchReportMode(int32_t minDelay, int32_t maxDelay, SensorFlagBits reportMode);
-
   inline static SensorFlagBits extractReportMode(uint64_t flag) {
     return (SensorFlagBits) (flag
-        & ((uint64_t) SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE
-          | (uint64_t) SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE
-          | (uint64_t) SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE
-          | (uint64_t) SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE));
+        & ((uint64_t) SensorFlagBits::CONTINUOUS_MODE
+          | (uint64_t) SensorFlagBits::ON_CHANGE_MODE
+          | (uint64_t) SensorFlagBits::ONE_SHOT_MODE
+          | (uint64_t) SensorFlagBits::SPECIAL_REPORTING_MODE));
   }
 
   inline static bool isMetaSensorType(SensorType type) {
-    return (type == SensorType::SENSOR_TYPE_META_DATA
-            || type == SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META
-            || type == SensorType::SENSOR_TYPE_ADDITIONAL_INFO);
+    return (type == SensorType::META_DATA
+            || type == SensorType::DYNAMIC_SENSOR_META
+            || type == SensorType::ADDITIONAL_INFO);
   }
 
   inline static bool isValidType(SensorType type) {
     return (int32_t) type > 0;
   }
 
+  static bool typeMatchStringType(SensorType type, const hidl_string& stringType);
+  static bool typeMatchReportMode(SensorType type, SensorFlagBits reportMode);
+  static bool delayMatchReportMode(int32_t minDelay, int32_t maxDelay, SensorFlagBits reportMode);
   static SensorFlagBits expectedReportModeForType(SensorType type);
-  SensorInfo defaultSensorByType(SensorType type);
+
+  // all sensors and direct channnels used
+  std::unordered_set<int32_t> mSensorHandles;
+  std::unordered_set<int32_t> mDirectChannelHandles;
 };
 
+
+Return<Result> SensorsHidlTest::activate(int32_t sensorHandle, bool enabled) {
+  // If activating a sensor, add the handle in a set so that when test fails it can be turned off.
+  // The handle is not removed when it is deactivating on purpose so that it is not necessary to
+  // check the return value of deactivation. Deactivating a sensor more than once does not have
+  // negative effect.
+  if (enabled) {
+    mSensorHandles.insert(sensorHandle);
+  }
+  return S()->activate(sensorHandle, enabled);
+}
+
+Return<void> SensorsHidlTest::registerDirectChannel(
+    const SharedMemInfo& mem, ISensors::registerDirectChannel_cb cb) {
+  // If registeration of a channel succeeds, add the handle of channel to a set so that it can be
+  // unregistered when test fails. Unregister a channel does not remove the handle on purpose.
+  // Unregistering a channel more than once should not have negative effect.
+  S()->registerDirectChannel(mem,
+      [&] (auto result, auto channelHandle) {
+        if (result == Result::OK) {
+          mDirectChannelHandles.insert(channelHandle);
+        }
+        cb(result, channelHandle);
+      });
+  return Void();
+}
+
+std::vector<Event> SensorsHidlTest::collectEvents(useconds_t timeLimitUs, size_t nEventLimit,
+      bool clearBeforeStart, bool changeCollection) {
+  std::vector<Event> events;
+  constexpr useconds_t SLEEP_GRANULARITY = 100*1000; //gradularity 100 ms
+
+  ALOGI("collect max of %zu events for %d us, clearBeforeStart %d",
+        nEventLimit, timeLimitUs, clearBeforeStart);
+
+  if (changeCollection) {
+    SensorsHidlEnvironment::Instance()->setCollection(true);
+  }
+  if (clearBeforeStart) {
+    SensorsHidlEnvironment::Instance()->catEvents(nullptr);
+  }
+
+  while (timeLimitUs > 0) {
+    useconds_t duration = std::min(SLEEP_GRANULARITY, timeLimitUs);
+    usleep(duration);
+    timeLimitUs -= duration;
+
+    SensorsHidlEnvironment::Instance()->catEvents(&events);
+    if (events.size() >= nEventLimit) {
+      break;
+    }
+    ALOGV("time to go = %d, events to go = %d",
+          (int)timeLimitUs, (int)(nEventLimit - events.size()));
+  }
+
+  if (changeCollection) {
+    SensorsHidlEnvironment::Instance()->setCollection(false);
+  }
+  return events;
+}
+
 bool SensorsHidlTest::typeMatchStringType(SensorType type, const hidl_string& stringType) {
 
-  if (type >= SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE) {
+  if (type >= SensorType::DEVICE_PRIVATE_BASE) {
     return true;
   }
 
   bool res = true;
   switch (type) {
 #define CHECK_TYPE_STRING_FOR_SENSOR_TYPE(type) \
-    case SensorType::SENSOR_TYPE_ ## type: res = stringType == SENSOR_STRING_TYPE_ ## type;\
+    case SensorType::type: res = stringType == SENSOR_STRING_TYPE_ ## type;\
       break;\
 
     CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER);
@@ -273,7 +520,7 @@
 }
 
 bool SensorsHidlTest::typeMatchReportMode(SensorType type, SensorFlagBits reportMode) {
-  if (type >= SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE) {
+  if (type >= SensorType::DEVICE_PRIVATE_BASE) {
     return true;
   }
 
@@ -286,19 +533,22 @@
     int32_t minDelay, int32_t maxDelay, SensorFlagBits reportMode) {
   bool res = true;
   switch(reportMode) {
-    case SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE:
+    case SensorFlagBits::CONTINUOUS_MODE:
       res = (minDelay > 0) && (maxDelay >= 0);
       break;
-    case SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE:
+    case SensorFlagBits::ON_CHANGE_MODE:
       //TODO: current implementation does not satisfy minDelay == 0 on Proximity
       res = (minDelay >= 0) && (maxDelay >= 0);
       //res = (minDelay == 0) && (maxDelay >= 0);
       break;
-    case SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE:
+    case SensorFlagBits::ONE_SHOT_MODE:
       res = (minDelay == -1) && (maxDelay == 0);
       break;
-    case SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE:
+    case SensorFlagBits::SPECIAL_REPORTING_MODE:
       res = (minDelay == 0) && (maxDelay == 0);
+      break;
+    default:
+      res = false;
   }
 
   return res;
@@ -306,44 +556,44 @@
 
 SensorFlagBits SensorsHidlTest::expectedReportModeForType(SensorType type) {
   switch (type) {
-    case SensorType::SENSOR_TYPE_ACCELEROMETER:
-    case SensorType::SENSOR_TYPE_GYROSCOPE:
-    case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
-    case SensorType::SENSOR_TYPE_ORIENTATION:
-    case SensorType::SENSOR_TYPE_PRESSURE:
-    case SensorType::SENSOR_TYPE_TEMPERATURE:
-    case SensorType::SENSOR_TYPE_GRAVITY:
-    case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
-    case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
-    case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
-    case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
-    case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
-    case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
-    case SensorType::SENSOR_TYPE_POSE_6DOF:
-    case SensorType::SENSOR_TYPE_HEART_BEAT:
-      return SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE;
+    case SensorType::ACCELEROMETER:
+    case SensorType::GYROSCOPE:
+    case SensorType::MAGNETIC_FIELD:
+    case SensorType::ORIENTATION:
+    case SensorType::PRESSURE:
+    case SensorType::TEMPERATURE:
+    case SensorType::GRAVITY:
+    case SensorType::LINEAR_ACCELERATION:
+    case SensorType::ROTATION_VECTOR:
+    case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+    case SensorType::GAME_ROTATION_VECTOR:
+    case SensorType::GYROSCOPE_UNCALIBRATED:
+    case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
+    case SensorType::POSE_6DOF:
+    case SensorType::HEART_BEAT:
+      return SensorFlagBits::CONTINUOUS_MODE;
 
-    case SensorType::SENSOR_TYPE_LIGHT:
-    case SensorType::SENSOR_TYPE_PROXIMITY:
-    case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
-    case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
-    case SensorType::SENSOR_TYPE_HEART_RATE:
-    case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
-    case SensorType::SENSOR_TYPE_MOTION_DETECT:
-    case SensorType::SENSOR_TYPE_STEP_COUNTER:
-      return SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE;
+    case SensorType::LIGHT:
+    case SensorType::PROXIMITY:
+    case SensorType::RELATIVE_HUMIDITY:
+    case SensorType::AMBIENT_TEMPERATURE:
+    case SensorType::HEART_RATE:
+    case SensorType::DEVICE_ORIENTATION:
+    case SensorType::MOTION_DETECT:
+    case SensorType::STEP_COUNTER:
+      return SensorFlagBits::ON_CHANGE_MODE;
 
-    case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
-    case SensorType::SENSOR_TYPE_WAKE_GESTURE:
-    case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
-    case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
-      return SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE;
+    case SensorType::SIGNIFICANT_MOTION:
+    case SensorType::WAKE_GESTURE:
+    case SensorType::GLANCE_GESTURE:
+    case SensorType::PICK_UP_GESTURE:
+      return SensorFlagBits::ONE_SHOT_MODE;
 
-    case SensorType::SENSOR_TYPE_STEP_DETECTOR:
-    case SensorType::SENSOR_TYPE_TILT_DETECTOR:
-    case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
-    case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
-      return SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE;
+    case SensorType::STEP_DETECTOR:
+    case SensorType::TILT_DETECTOR:
+    case SensorType::WRIST_TILT_GESTURE:
+    case SensorType::DYNAMIC_SENSOR_META:
+      return SensorFlagBits::SPECIAL_REPORTING_MODE;
 
     default:
       ALOGW("Type %d is not implemented in expectedReportModeForType", (int)type);
@@ -395,8 +645,8 @@
 
           // Info type, should have no sensor
           ASSERT_FALSE(
-              s.type == SensorType::SENSOR_TYPE_ADDITIONAL_INFO
-              || s.type == SensorType::SENSOR_TYPE_META_DATA);
+              s.type == SensorType::ADDITIONAL_INFO
+              || s.type == SensorType::META_DATA);
 
           // Test fifoMax >= fifoReserved
           ALOGV("max reserve = %d, %d", s.fifoMaxEventCount, s.fifoReservedEventCount);
@@ -422,7 +672,7 @@
   constexpr int64_t batchingPeriodInNs = 0; // no batching
   constexpr useconds_t minTimeUs = 5*1000*1000;  // 5 s
   constexpr size_t minNEvent = 100;  // at lease 100 events
-  constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+  constexpr SensorType type = SensorType::ACCELEROMETER;
 
   SensorInfo sensor = defaultSensorByType(type);
 
@@ -433,10 +683,10 @@
 
   int32_t handle = sensor.sensorHandle;
 
-  S()->batch(handle, 0, samplingPeriodInNs, batchingPeriodInNs);
-  S()->activate(handle, 1);
+  ASSERT_EQ(batch(handle, samplingPeriodInNs, batchingPeriodInNs), Result::OK);
+  ASSERT_EQ(activate(handle, 1), Result::OK);
   events = collectEvents(minTimeUs, minNEvent, true /*clearBeforeStart*/);
-  S()->activate(handle, 0);
+  ASSERT_EQ(activate(handle, 0), Result::OK);
 
   ALOGI("Collected %zu samples", events.size());
 
@@ -469,14 +719,13 @@
 
 // Test if sensor hal can do gyroscope streaming properly
 TEST_F(SensorsHidlTest, NormalGyroscopeStreamingOperation) {
-
   std::vector<Event> events;
 
   constexpr int64_t samplingPeriodInNs = 10ull*1000*1000; // 10ms
   constexpr int64_t batchingPeriodInNs = 0; // no batching
   constexpr useconds_t minTimeUs = 5*1000*1000;  // 5 s
   constexpr size_t minNEvent = 200;
-  constexpr SensorType type = SensorType::SENSOR_TYPE_GYROSCOPE;
+  constexpr SensorType type = SensorType::GYROSCOPE;
 
   SensorInfo sensor = defaultSensorByType(type);
 
@@ -487,10 +736,10 @@
 
   int32_t handle = sensor.sensorHandle;
 
-  S()->batch(handle, 0, samplingPeriodInNs, batchingPeriodInNs);
-  S()->activate(handle, 1);
+  ASSERT_EQ(batch(handle, samplingPeriodInNs, batchingPeriodInNs), Result::OK);
+  ASSERT_EQ(activate(handle, 1), Result::OK);
   events = collectEvents(minTimeUs, minNEvent, true /*clearBeforeStart*/);
-  S()->activate(handle, 0);
+  ASSERT_EQ(activate(handle, 0), Result::OK);
 
   ALOGI("Collected %zu samples", events.size());
 
@@ -523,13 +772,12 @@
 
 // Test if sensor hal can do accelerometer sampling rate switch properly when sensor is active
 TEST_F(SensorsHidlTest, AccelerometerSamplingPeriodHotSwitchOperation) {
-
   std::vector<Event> events1, events2;
 
   constexpr int64_t batchingPeriodInNs = 0; // no batching
   constexpr useconds_t minTimeUs = 5*1000*1000;  // 5 s
   constexpr size_t minNEvent = 50;
-  constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+  constexpr SensorType type = SensorType::ACCELEROMETER;
 
   SensorInfo sensor = defaultSensorByType(type);
 
@@ -547,18 +795,18 @@
     return;
   }
 
-  S()->batch(handle, 0, minSamplingPeriodInNs, batchingPeriodInNs);
-  S()->activate(handle, 1);
+  ASSERT_EQ(batch(handle, minSamplingPeriodInNs, batchingPeriodInNs), Result::OK);
+  ASSERT_EQ(activate(handle, 1), Result::OK);
 
   usleep(500000); // sleep 0.5 sec to wait for change rate to happen
   events1 = collectEvents(sensor.minDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
 
-  S()->batch(handle, 0, maxSamplingPeriodInNs, batchingPeriodInNs);
+  ASSERT_EQ(batch(handle, maxSamplingPeriodInNs, batchingPeriodInNs), Result::OK);
 
   usleep(500000); // sleep 0.5 sec to wait for change rate to happen
   events2 = collectEvents(sensor.maxDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
 
-  S()->activate(handle, 0);
+  ASSERT_EQ(activate(handle, 0), Result::OK);
 
   ALOGI("Collected %zu fast samples and %zu slow samples", events1.size(), events2.size());
 
@@ -610,13 +858,12 @@
 
 // Test if sensor hal can do normal accelerometer batching properly
 TEST_F(SensorsHidlTest, AccelerometerBatchingOperation) {
-
   std::vector<Event> events;
 
   constexpr int64_t oneSecondInNs = 1ull * 1000 * 1000 * 1000;
   constexpr useconds_t minTimeUs = 5*1000*1000;  // 5 s
   constexpr size_t minNEvent = 50;
-  constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+  constexpr SensorType type = SensorType::ACCELEROMETER;
   constexpr int64_t maxBatchingTestTimeNs = 30ull * 1000 * 1000 * 1000;
 
   SensorInfo sensor = defaultSensorByType(type);
@@ -643,18 +890,17 @@
   int64_t allowedBatchDeliverTimeNs =
       std::max(oneSecondInNs, batchingPeriodInNs / 10);
 
-  S()->batch(handle, 0, minSamplingPeriodInNs, INT64_MAX);
-  S()->activate(handle, 1);
+  ASSERT_EQ(batch(handle, minSamplingPeriodInNs, INT64_MAX), Result::OK);
+  ASSERT_EQ(activate(handle, 1), Result::OK);
 
   usleep(500000); // sleep 0.5 sec to wait for initialization
-  S()->flush(handle);
+  ASSERT_EQ(flush(handle), Result::OK);
 
   // wait for 80% of the reserved batching period
   // there should not be any significant amount of events
   // since collection is not enabled all events will go down the drain
   usleep(batchingPeriodInNs / 1000 * 8 / 10);
 
-
   SensorsHidlEnvironment::Instance()->setCollection(true);
   // 0.8 + 0.3 times the batching period
   // plus some time for the event to deliver
@@ -662,13 +908,13 @@
       batchingPeriodInNs / 1000 * 3 / 10,
         minFifoCount, true /*clearBeforeStart*/, false /*change collection*/);
 
-  S()->flush(handle);
+  ASSERT_EQ(flush(handle), Result::OK);
 
   events = collectEvents(allowedBatchDeliverTimeNs / 1000,
         minFifoCount, true /*clearBeforeStart*/, false /*change collection*/);
 
   SensorsHidlEnvironment::Instance()->setCollection(false);
-  S()->activate(handle, 0);
+  ASSERT_EQ(activate(handle, 0), Result::OK);
 
   size_t nEvent = 0;
   for (auto & e : events) {
@@ -681,6 +927,79 @@
   ASSERT_GT(nEvent, (size_t)(batchingPeriodInNs / minSamplingPeriodInNs * 9 / 10));
 }
 
+// Test sensor event direct report with ashmem for gyro sensor
+TEST_F(SensorsHidlTest, GyroscopeAshmemDirectReport) {
+
+  constexpr SensorType type = SensorType::GYROSCOPE;
+  constexpr size_t kEventSize = 104;
+  constexpr size_t kNEvent = 500;
+  constexpr size_t kMemSize = kEventSize * kNEvent;
+
+  SensorInfo sensor = defaultSensorByType(type);
+
+  if (!(sensor.flags | SensorFlagBits::MASK_DIRECT_REPORT)
+      || !(sensor.flags | SensorFlagBits::DIRECT_CHANNEL_ASHMEM)) {
+    // does not declare support
+    return;
+  }
+
+  std::unique_ptr<SensorsTestSharedMemory>
+      mem(SensorsTestSharedMemory::create(SharedMemType::ASHMEM, kMemSize));
+  ASSERT_NE(mem, nullptr);
+
+  char* buffer = mem->getBuffer();
+  // fill memory with data
+  for (size_t i = 0; i < kMemSize; ++i) {
+    buffer[i] = '\xcc';
+  }
+
+  int32_t channelHandle;
+  registerDirectChannel(mem->getSharedMemInfo(),
+      [&channelHandle] (auto result, auto channelHandle_) {
+          ASSERT_EQ(result, Result::OK);
+          channelHandle = channelHandle_;
+      });
+
+  // check memory is zeroed
+  for (size_t i = 0; i < kMemSize; ++i) {
+    ASSERT_EQ(buffer[i], '\0');
+  }
+
+  int32_t eventToken;
+  configDirectReport(sensor.sensorHandle, channelHandle, RateLevel::NORMAL,
+      [&eventToken] (auto result, auto token) {
+          ASSERT_EQ(result, Result::OK);
+          eventToken = token;
+      });
+
+  usleep(1500000); // sleep 1 sec for data, plus 0.5 sec for initialization
+  auto events = mem->parseEvents();
+
+  // allowed to be 55% of nominal freq (50Hz)
+  ASSERT_GT(events.size(), 50 / 2);
+  ASSERT_LT(events.size(), static_cast<size_t>(110*1.5));
+
+  int64_t lastTimestamp = 0;
+  for (auto &e : events) {
+    ASSERT_EQ(e.sensorType, type);
+    ASSERT_EQ(e.sensorHandle, eventToken);
+    ASSERT_GT(e.timestamp, lastTimestamp);
+
+    Vec3 gyro = e.u.vec3;
+    double gyroNorm = std::sqrt(gyro.x * gyro.x + gyro.y * gyro.y + gyro.z * gyro.z);
+    // assert not drifting
+    ASSERT_TRUE(gyroNorm < 0.1);  // < ~5 degree/sa
+
+    lastTimestamp = e.timestamp;
+  }
+
+  // stop sensor and unregister channel
+  configDirectReport(sensor.sensorHandle, channelHandle, RateLevel::STOP,
+        [&eventToken] (auto result, auto) {
+            ASSERT_EQ(result, Result::OK);
+        });
+  ASSERT_EQ(unregisterDirectChannel(channelHandle), Result::OK);
+}
 
 int main(int argc, char **argv) {
   ::testing::AddGlobalTestEnvironment(SensorsHidlEnvironment::Instance());
@@ -689,4 +1008,4 @@
   ALOGI("Test result = %d", status);
   return status;
 }
-
+// vim: set ts=2 sw=2
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
index 88fe675..db210d9 100644
--- a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
@@ -43,25 +43,31 @@
         self.dut.shell.one.Execute(
             "setprop vts.hal.vts.hidl.get_stub true")
 
-        if self.enable_profiling:
-            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
         self.dut.hal.InitHidlHal(
             target_type="sensors",
-            target_basepaths=["/system/lib64"],
+            target_basepaths=self.dut.libPaths,
             target_version=1.0,
             target_package="android.hardware.sensors",
             target_component_name="ISensors",
-            bits=64)
+            hw_binder_service_name=None,
+            bits=64 if self.dut.is64Bit else 32)
 
     def tearDownClass(self):
         """ If profiling is enabled for the test, collect the profiling data
             and disable profiling after the test is done.
         """
         if self.enable_profiling:
+            self.ProcessAndUploadTraceData()
+
+    def setUpTest(self):
+        if self.enable_profiling:
+            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+    def tearDownTest(self):
+        if self.enable_profiling:
             profiling_trace_path = getattr(
                 self, self.VTS_PROFILING_TRACING_PATH, "")
-            self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+            self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
             profiling_utils.DisableVTSProfiling(self.dut.shell.one)
 
     def testSensorsBasic(self):
diff --git a/boot/Android.mk b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk
index f9e3276..6029cc0 100644
--- a/boot/Android.mk
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SensorsHidlProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/sensors/hidl/host_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml
new file mode 100644
index 0000000..c056d90
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS HAL sensors test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+        <option name="cleanup" value="true" />
+        <option name="push" value="spec/hardware/interfaces/sensors/1.0/vts/Sensors.vts->/data/local/tmp/spec/Sensors.vts" />
+        <option name="push" value="spec/hardware/interfaces/sensors/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="SensorsHidlProfilingTest" />
+        <option name="test-case-path" value="vts/testcases/hal/sensors/hidl/host/SensorsHidlTest" />
+        <option name="test-timeout" value="3m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/boot/Android.mk b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk
index f9e3276..1b81381 100644
--- a/boot/Android.mk
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk
@@ -17,3 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SensorsHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/sensors/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..80e46b7
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS sensors HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="SensorsHidlTargetProfilingTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/sensors_hidl_hal_test/sensors_hidl_hal_test,
+            _64bit::DATA/nativetest64/sensors_hidl_hal_test/sensors_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="binary-test-disable-framework" value="true" />
+        <option name="test-timeout" value="10m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
+
diff --git a/sensors/1.0/vts/types.vts b/sensors/1.0/vts/types.vts
index 37271fd..1b48916 100644
--- a/sensors/1.0/vts/types.vts
+++ b/sensors/1.0/vts/types.vts
@@ -15,17 +15,21 @@
         scalar_value: {
             int32_t: 0
         }
-        enumerator: "BAD_VALUE"
-        scalar_value: {
-            int32_t: 1
-        }
         enumerator: "PERMISSION_DENIED"
         scalar_value: {
-            int32_t: 2
+            int32_t: -1
+        }
+        enumerator: "NO_MEMORY"
+        scalar_value: {
+            int32_t: -12
+        }
+        enumerator: "BAD_VALUE"
+        scalar_value: {
+            int32_t: -22
         }
         enumerator: "INVALID_OPERATION"
         scalar_value: {
-            int32_t: 3
+            int32_t: -38
         }
     }
 }
@@ -36,11 +40,11 @@
     enum_value: {
         scalar_type: "int32_t"
 
-        enumerator: "SENSOR_HAL_NORMAL_MODE"
+        enumerator: "NORMAL"
         scalar_value: {
             int32_t: 0
         }
-        enumerator: "SENSOR_HAL_DATA_INJECTION_MODE"
+        enumerator: "DATA_INJECTION"
         scalar_value: {
             int32_t: 1
         }
@@ -53,147 +57,151 @@
     enum_value: {
         scalar_type: "int32_t"
 
-        enumerator: "SENSOR_TYPE_META_DATA"
+        enumerator: "META_DATA"
         scalar_value: {
             int32_t: 0
         }
-        enumerator: "SENSOR_TYPE_ACCELEROMETER"
+        enumerator: "ACCELEROMETER"
         scalar_value: {
             int32_t: 1
         }
-        enumerator: "SENSOR_TYPE_GEOMAGNETIC_FIELD"
+        enumerator: "MAGNETIC_FIELD"
         scalar_value: {
             int32_t: 2
         }
-        enumerator: "SENSOR_TYPE_ORIENTATION"
+        enumerator: "ORIENTATION"
         scalar_value: {
             int32_t: 3
         }
-        enumerator: "SENSOR_TYPE_GYROSCOPE"
+        enumerator: "GYROSCOPE"
         scalar_value: {
             int32_t: 4
         }
-        enumerator: "SENSOR_TYPE_LIGHT"
+        enumerator: "LIGHT"
         scalar_value: {
             int32_t: 5
         }
-        enumerator: "SENSOR_TYPE_PRESSURE"
+        enumerator: "PRESSURE"
         scalar_value: {
             int32_t: 6
         }
-        enumerator: "SENSOR_TYPE_TEMPERATURE"
+        enumerator: "TEMPERATURE"
         scalar_value: {
             int32_t: 7
         }
-        enumerator: "SENSOR_TYPE_PROXIMITY"
+        enumerator: "PROXIMITY"
         scalar_value: {
             int32_t: 8
         }
-        enumerator: "SENSOR_TYPE_GRAVITY"
+        enumerator: "GRAVITY"
         scalar_value: {
             int32_t: 9
         }
-        enumerator: "SENSOR_TYPE_LINEAR_ACCELERATION"
+        enumerator: "LINEAR_ACCELERATION"
         scalar_value: {
             int32_t: 10
         }
-        enumerator: "SENSOR_TYPE_ROTATION_VECTOR"
+        enumerator: "ROTATION_VECTOR"
         scalar_value: {
             int32_t: 11
         }
-        enumerator: "SENSOR_TYPE_RELATIVE_HUMIDITY"
+        enumerator: "RELATIVE_HUMIDITY"
         scalar_value: {
             int32_t: 12
         }
-        enumerator: "SENSOR_TYPE_AMBIENT_TEMPERATURE"
+        enumerator: "AMBIENT_TEMPERATURE"
         scalar_value: {
             int32_t: 13
         }
-        enumerator: "SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED"
+        enumerator: "MAGNETIC_FIELD_UNCALIBRATED"
         scalar_value: {
             int32_t: 14
         }
-        enumerator: "SENSOR_TYPE_GAME_ROTATION_VECTOR"
+        enumerator: "GAME_ROTATION_VECTOR"
         scalar_value: {
             int32_t: 15
         }
-        enumerator: "SENSOR_TYPE_GYROSCOPE_UNCALIBRATED"
+        enumerator: "GYROSCOPE_UNCALIBRATED"
         scalar_value: {
             int32_t: 16
         }
-        enumerator: "SENSOR_TYPE_SIGNIFICANT_MOTION"
+        enumerator: "SIGNIFICANT_MOTION"
         scalar_value: {
             int32_t: 17
         }
-        enumerator: "SENSOR_TYPE_STEP_DETECTOR"
+        enumerator: "STEP_DETECTOR"
         scalar_value: {
             int32_t: 18
         }
-        enumerator: "SENSOR_TYPE_STEP_COUNTER"
+        enumerator: "STEP_COUNTER"
         scalar_value: {
             int32_t: 19
         }
-        enumerator: "SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR"
+        enumerator: "GEOMAGNETIC_ROTATION_VECTOR"
         scalar_value: {
             int32_t: 20
         }
-        enumerator: "SENSOR_TYPE_HEART_RATE"
+        enumerator: "HEART_RATE"
         scalar_value: {
             int32_t: 21
         }
-        enumerator: "SENSOR_TYPE_TILT_DETECTOR"
+        enumerator: "TILT_DETECTOR"
         scalar_value: {
             int32_t: 22
         }
-        enumerator: "SENSOR_TYPE_WAKE_GESTURE"
+        enumerator: "WAKE_GESTURE"
         scalar_value: {
             int32_t: 23
         }
-        enumerator: "SENSOR_TYPE_GLANCE_GESTURE"
+        enumerator: "GLANCE_GESTURE"
         scalar_value: {
             int32_t: 24
         }
-        enumerator: "SENSOR_TYPE_PICK_UP_GESTURE"
+        enumerator: "PICK_UP_GESTURE"
         scalar_value: {
             int32_t: 25
         }
-        enumerator: "SENSOR_TYPE_WRIST_TILT_GESTURE"
+        enumerator: "WRIST_TILT_GESTURE"
         scalar_value: {
             int32_t: 26
         }
-        enumerator: "SENSOR_TYPE_DEVICE_ORIENTATION"
+        enumerator: "DEVICE_ORIENTATION"
         scalar_value: {
             int32_t: 27
         }
-        enumerator: "SENSOR_TYPE_POSE_6DOF"
+        enumerator: "POSE_6DOF"
         scalar_value: {
             int32_t: 28
         }
-        enumerator: "SENSOR_TYPE_STATIONARY_DETECT"
+        enumerator: "STATIONARY_DETECT"
         scalar_value: {
             int32_t: 29
         }
-        enumerator: "SENSOR_TYPE_MOTION_DETECT"
+        enumerator: "MOTION_DETECT"
         scalar_value: {
             int32_t: 30
         }
-        enumerator: "SENSOR_TYPE_HEART_BEAT"
+        enumerator: "HEART_BEAT"
         scalar_value: {
             int32_t: 31
         }
-        enumerator: "SENSOR_TYPE_DYNAMIC_SENSOR_META"
+        enumerator: "DYNAMIC_SENSOR_META"
         scalar_value: {
             int32_t: 32
         }
-        enumerator: "SENSOR_TYPE_ADDITIONAL_INFO"
+        enumerator: "ADDITIONAL_INFO"
         scalar_value: {
             int32_t: 33
         }
-        enumerator: "SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT"
+        enumerator: "LOW_LATENCY_OFFBODY_DETECT"
         scalar_value: {
             int32_t: 34
         }
-        enumerator: "SENSOR_TYPE_DEVICE_PRIVATE_BASE"
+        enumerator: "ACCELEROMETER_UNCALIBRATED"
+        scalar_value: {
+            int32_t: 35
+        }
+        enumerator: "DEVICE_PRIVATE_BASE"
         scalar_value: {
             int32_t: 65536
         }
@@ -204,39 +212,92 @@
     name: "::android::hardware::sensors::V1_0::SensorFlagBits"
     type: TYPE_ENUM
     enum_value: {
-        scalar_type: "uint64_t"
+        scalar_type: "uint32_t"
 
-        enumerator: "SENSOR_FLAG_WAKE_UP"
+        enumerator: "WAKE_UP"
         scalar_value: {
-            uint64_t: 1
+            uint32_t: 1
         }
-        enumerator: "SENSOR_FLAG_CONTINUOUS_MODE"
+        enumerator: "CONTINUOUS_MODE"
         scalar_value: {
-            uint64_t: 0
+            uint32_t: 0
         }
-        enumerator: "SENSOR_FLAG_ON_CHANGE_MODE"
+        enumerator: "ON_CHANGE_MODE"
         scalar_value: {
-            uint64_t: 2
+            uint32_t: 2
         }
-        enumerator: "SENSOR_FLAG_ONE_SHOT_MODE"
+        enumerator: "ONE_SHOT_MODE"
         scalar_value: {
-            uint64_t: 4
+            uint32_t: 4
         }
-        enumerator: "SENSOR_FLAG_SPECIAL_REPORTING_MODE"
+        enumerator: "SPECIAL_REPORTING_MODE"
         scalar_value: {
-            uint64_t: 6
+            uint32_t: 6
         }
-        enumerator: "SENSOR_FLAG_SUPPORTS_DATA_INJECTION"
+        enumerator: "DATA_INJECTION"
         scalar_value: {
-            uint64_t: 16
+            uint32_t: 16
         }
-        enumerator: "SENSOR_FLAG_DYNAMIC_SENSOR"
+        enumerator: "DYNAMIC_SENSOR"
         scalar_value: {
-            uint64_t: 32
+            uint32_t: 32
         }
-        enumerator: "SENSOR_FLAG_ADDITIONAL_INFO"
+        enumerator: "ADDITIONAL_INFO"
         scalar_value: {
-            uint64_t: 64
+            uint32_t: 64
+        }
+        enumerator: "DIRECT_CHANNEL_ASHMEM"
+        scalar_value: {
+            uint32_t: 1024
+        }
+        enumerator: "DIRECT_CHANNEL_GRALLOC"
+        scalar_value: {
+            uint32_t: 2048
+        }
+        enumerator: "MASK_REPORTING_MODE"
+        scalar_value: {
+            uint32_t: 14
+        }
+        enumerator: "MASK_DIRECT_REPORT"
+        scalar_value: {
+            uint32_t: 896
+        }
+        enumerator: "MASK_DIRECT_CHANNEL"
+        scalar_value: {
+            uint32_t: 3072
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::sensors::V1_0::SensorFlagShift"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint8_t"
+
+        enumerator: "REPORTING_MODE"
+        scalar_value: {
+            uint8_t: 1
+        }
+        enumerator: "DATA_INJECTION"
+        scalar_value: {
+            uint8_t: 4
+        }
+        enumerator: "DYNAMIC_SENSOR"
+        scalar_value: {
+            uint8_t: 5
+        }
+        enumerator: "ADDITIONAL_INFO"
+        scalar_value: {
+            uint8_t: 6
+        }
+        enumerator: "DIRECT_REPORT"
+        scalar_value: {
+            uint8_t: 7
+        }
+        enumerator: "DIRECT_CHANNEL"
+        scalar_value: {
+            uint8_t: 10
         }
     }
 }
@@ -312,8 +373,8 @@
     }
     struct_value: {
         name: "flags"
-        type: TYPE_SCALAR
-        scalar_type: "uint64_t"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::sensors::V1_0::SensorFlagBits"
     }
 }
 
@@ -323,23 +384,23 @@
     enum_value: {
         scalar_type: "int8_t"
 
-        enumerator: "SENSOR_STATUS_NO_CONTACT"
+        enumerator: "NO_CONTACT"
         scalar_value: {
             int8_t: -1
         }
-        enumerator: "SENSOR_STATUS_UNRELIABLE"
+        enumerator: "UNRELIABLE"
         scalar_value: {
             int8_t: 0
         }
-        enumerator: "SENSOR_STATUS_ACCURACY_LOW"
+        enumerator: "ACCURACY_LOW"
         scalar_value: {
             int8_t: 1
         }
-        enumerator: "SENSOR_STATUS_ACCURACY_MEDIUM"
+        enumerator: "ACCURACY_MEDIUM"
         scalar_value: {
             int8_t: 2
         }
-        enumerator: "SENSOR_STATUS_ACCURACY_HIGH"
+        enumerator: "ACCURACY_HIGH"
         scalar_value: {
             int8_t: 3
         }
@@ -551,6 +612,26 @@
         scalar_value: {
             uint32_t: 131077
         }
+        enumerator: "AINFO_LOCAL_GEOMAGNETIC_FIELD"
+        scalar_value: {
+            uint32_t: 196608
+        }
+        enumerator: "AINFO_LOCAL_GRAVITY"
+        scalar_value: {
+            uint32_t: 196609
+        }
+        enumerator: "AINFO_DOCK_STATE"
+        scalar_value: {
+            uint32_t: 196610
+        }
+        enumerator: "AINFO_HIGH_PERFORMANCE_MODE"
+        scalar_value: {
+            uint32_t: 196611
+        }
+        enumerator: "AINFO_MAGNETIC_FIELD_CALIBRATION"
+        scalar_value: {
+            uint32_t: 196612
+        }
         enumerator: "AINFO_CUSTOM_START"
         scalar_value: {
             uint32_t: 268435456
@@ -697,3 +778,123 @@
     }
 }
 
+attribute: {
+    name: "::android::hardware::sensors::V1_0::RateLevel"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "STOP"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "NORMAL"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "FAST"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "VERY_FAST"
+        scalar_value: {
+            int32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::sensors::V1_0::SharedMemType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ASHMEM"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "GRALLOC"
+        scalar_value: {
+            int32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::sensors::V1_0::SharedMemFormat"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SENSORS_EVENT"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::sensors::V1_0::SensorsEventFormatOffset"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint16_t"
+
+        enumerator: "SIZE_FIELD"
+        scalar_value: {
+            uint16_t: 0
+        }
+        enumerator: "REPORT_TOKEN"
+        scalar_value: {
+            uint16_t: 4
+        }
+        enumerator: "SENSOR_TYPE"
+        scalar_value: {
+            uint16_t: 8
+        }
+        enumerator: "ATOMIC_COUNTER"
+        scalar_value: {
+            uint16_t: 12
+        }
+        enumerator: "TIMESTAMP"
+        scalar_value: {
+            uint16_t: 16
+        }
+        enumerator: "DATA"
+        scalar_value: {
+            uint16_t: 24
+        }
+        enumerator: "RESERVED"
+        scalar_value: {
+            uint16_t: 88
+        }
+        enumerator: "TOTAL_LENGTH"
+        scalar_value: {
+            uint16_t: 104
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::sensors::V1_0::SharedMemInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::sensors::V1_0::SharedMemType"
+    }
+    struct_value: {
+        name: "format"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::sensors::V1_0::SharedMemFormat"
+    }
+    struct_value: {
+        name: "size"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "memoryHandle"
+        type: TYPE_HANDLE
+    }
+}
+
diff --git a/sensors/Android.mk b/sensors/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/sensors/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index 00fb57e..5b50f39 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/soundtrigger/2.0/types.h",
         "android/hardware/soundtrigger/2.0/ISoundTriggerHw.h",
         "android/hardware/soundtrigger/2.0/IHwSoundTriggerHw.h",
-        "android/hardware/soundtrigger/2.0/BnSoundTriggerHw.h",
-        "android/hardware/soundtrigger/2.0/BpSoundTriggerHw.h",
+        "android/hardware/soundtrigger/2.0/BnHwSoundTriggerHw.h",
+        "android/hardware/soundtrigger/2.0/BpHwSoundTriggerHw.h",
         "android/hardware/soundtrigger/2.0/BsSoundTriggerHw.h",
         "android/hardware/soundtrigger/2.0/ISoundTriggerHwCallback.h",
         "android/hardware/soundtrigger/2.0/IHwSoundTriggerHwCallback.h",
-        "android/hardware/soundtrigger/2.0/BnSoundTriggerHwCallback.h",
-        "android/hardware/soundtrigger/2.0/BpSoundTriggerHwCallback.h",
+        "android/hardware/soundtrigger/2.0/BnHwSoundTriggerHwCallback.h",
+        "android/hardware/soundtrigger/2.0/BpHwSoundTriggerHwCallback.h",
         "android/hardware/soundtrigger/2.0/BsSoundTriggerHwCallback.h",
     ],
 }
@@ -64,3 +64,159 @@
         "android.hidl.base@1.0",
     ],
 }
+
+genrule {
+    name: "android.hardware.soundtrigger.vts.driver@2.0_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "types.hal",
+        "ISoundTriggerHw.hal",
+        "ISoundTriggerHwCallback.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/types.vts.cpp",
+        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
+        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.soundtrigger.vts.driver@2.0_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "types.hal",
+        "ISoundTriggerHw.hal",
+        "ISoundTriggerHwCallback.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/types.vts.h",
+        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
+        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.soundtrigger.vts.driver@2.0",
+    generated_sources: ["android.hardware.soundtrigger.vts.driver@2.0_genc++"],
+    generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "libvts_common",
+        "libvts_datatype",
+        "libvts_measurement",
+        "libvts_multidevice_proto",
+        "libcamera_metadata",
+        "libprotobuf-cpp-full",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+        "android.hardware.soundtrigger@2.0",
+    ],
+    export_shared_lib_headers: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "ISoundTriggerHw.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
+        "android/hardware/soundtrigger/2.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "ISoundTriggerHw.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
+        "android/hardware/soundtrigger/2.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler",
+    generated_sources: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+        "android.hardware.soundtrigger@2.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "ISoundTriggerHwCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
+        "android/hardware/soundtrigger/2.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+    srcs: [
+        "ISoundTriggerHwCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
+        "android/hardware/soundtrigger/2.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler",
+    generated_sources: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+        "android.hardware.soundtrigger@2.0",
+    ],
+}
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
index 73066e6..afda739 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
@@ -295,7 +295,7 @@
 }
 
 SoundTriggerHalImpl::SoundTriggerHalImpl(const char *moduleName)
-    : mModuleName(moduleName), mNextModelId(1)
+    : mModuleName(moduleName), mHwDevice(NULL), mNextModelId(1)
 {
 }
 
diff --git a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
index e5bf086..cb00ad5 100644
--- a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
+++ b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
@@ -40,9 +40,8 @@
 class SoundTriggerHidlTest : public ::testing::Test {
  public:
   virtual void SetUp() override {
-    mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary", false);
+    mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary");
     ASSERT_NE(nullptr, mSoundTriggerHal.get());
-    ASSERT_TRUE(mSoundTriggerHal->isRemote());
     mCallback = new MyCallback();
     ASSERT_NE(nullptr, mCallback.get());
   }
@@ -104,7 +103,7 @@
       halProperties = res;
   });
 
-  EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+  EXPECT_TRUE(hidlReturn.isOk());
   EXPECT_EQ(0, ret);
   EXPECT_GT(halProperties.maxSoundModels, 0u);
   EXPECT_GT(halProperties.maxKeyPhrases, 0u);
@@ -136,7 +135,7 @@
       handle = res;
   });
 
-  EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+  EXPECT_TRUE(hidlReturn.isOk());
   EXPECT_NE(0, ret);
 }
 
@@ -154,7 +153,7 @@
 
   hidlReturn = mSoundTriggerHal->unloadSoundModel(halHandle);
 
-  EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+  EXPECT_TRUE(hidlReturn.isOk());
   EXPECT_NE(0, hidlReturn);
 }
 
@@ -184,7 +183,7 @@
 
     hidlReturn = mSoundTriggerHal->startRecognition(handle, config, mCallback, 0);
 
-    EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlReturn.isOk());
     EXPECT_NE(0, hidlReturn);
 }
 
@@ -202,7 +201,7 @@
 
     hidlReturn = mSoundTriggerHal->stopRecognition(handle);
 
-    EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlReturn.isOk());
     EXPECT_NE(0, hidlReturn);
 }
 
@@ -219,7 +218,7 @@
 
     hidlReturn = mSoundTriggerHal->stopAllRecognitions();
 
-    EXPECT_EQ(Status::EX_NONE, hidlReturn.getStatus().exceptionCode());
+    EXPECT_TRUE(hidlReturn.isOk());
     EXPECT_TRUE(hidlReturn == 0 || hidlReturn == -ENOSYS);
 }
 
diff --git a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/AndroidTest.xml b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/AndroidTest.xml
index b75d97e..ca8ecdb 100644
--- a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/AndroidTest.xml
+++ b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/AndroidTest.xml
@@ -24,6 +24,7 @@
             _32bit::DATA/nativetest/soundtrigger_hidl_hal_test/soundtrigger_hidl_hal_test,
             _64bit::DATA/nativetest64/soundtrigger_hidl_hal_test/soundtrigger_hidl_hal_test,
             "/>
+        <option name="test-config-path" value="vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config" />
         <option name="binary-test-type" value="gtest" />
         <option name="test-timeout" value="1m" />
     </test>
diff --git a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config
new file mode 100644
index 0000000..5c12d13
--- /dev/null
+++ b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config
@@ -0,0 +1,41 @@
+{
+    "use_gae_db": true,
+    "coverage": true,
+    "modules": [
+        {
+            "module_name": "system/lib/hw/sound_trigger.primary.bullhead",
+            "git_project": {
+                "name": "platform/vendor/lge/bullhead",
+                "path": "vendor/lge/bullhead"
+            }
+        },
+        {
+            "module_name": "system/lib/hw/sound_trigger.primary.angler",
+            "git_project": {
+                "name": "platform/vendor/huawei/angler",
+                "path": "vendor/huawei/angler"
+            }
+        },
+        {
+            "module_name": "system/lib/hw/sound_trigger.primary.marlin",
+            "git_project": {
+                "name": "platform/vendor/google_devices/marlin",
+                "path": "vendor/google_devices/marlin"
+            }
+        },
+        {
+            "module_name": "system/lib/hw/sound_trigger.primary.sailfish",
+            "git_project": {
+                "name": "platform/vendor/google_devices/marlin",
+                "path": "vendor/google_devices/marlin"
+            }
+        },
+        {
+            "module_name": "system/lib/hw/android.hardware.soundtrigger@2.0-impl",
+            "git_project": {
+                "name": "platform/hardware/interfaces",
+                "path": "hardware/interfaces"
+            }
+        }
+    ]
+}
diff --git a/boot/Android.mk b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/Android.mk
similarity index 75%
copy from boot/Android.mk
copy to soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/Android.mk
index f9e3276..fc0f9c4 100644
--- a/boot/Android.mk
+++ b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalSoundTriggerHidlTargetBasicProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/soundtrigger/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/AndroidTest.xml b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..e95a406
--- /dev/null
+++ b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS sound trigger HIDL HAL's basic target-side, profiling test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalSoundTriggerHidlTargetBasicTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/soundtrigger_hidl_hal_test/soundtrigger_hidl_hal_test,
+            _64bit::DATA/nativetest64/soundtrigger_hidl_hal_test/soundtrigger_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/soundtrigger/Android.mk b/soundtrigger/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/soundtrigger/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index e4c79fa..fbec8d1 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -5,13 +5,19 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
     srcs: [
+        "types.hal",
         "IBar.hal",
         "IComplicated.hal",
+        "IFooCallback.hal",
+        "IImportRules.hal",
         "IImportTypes.hal",
     ],
     out: [
+        "android/hardware/tests/bar/1.0/types.cpp",
         "android/hardware/tests/bar/1.0/BarAll.cpp",
         "android/hardware/tests/bar/1.0/ComplicatedAll.cpp",
+        "android/hardware/tests/bar/1.0/FooCallbackAll.cpp",
+        "android/hardware/tests/bar/1.0/ImportRulesAll.cpp",
         "android/hardware/tests/bar/1.0/ImportTypesAll.cpp",
     ],
 }
@@ -21,25 +27,39 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
     srcs: [
+        "types.hal",
         "IBar.hal",
         "IComplicated.hal",
+        "IFooCallback.hal",
+        "IImportRules.hal",
         "IImportTypes.hal",
     ],
     out: [
+        "android/hardware/tests/bar/1.0/types.h",
         "android/hardware/tests/bar/1.0/IBar.h",
         "android/hardware/tests/bar/1.0/IHwBar.h",
-        "android/hardware/tests/bar/1.0/BnBar.h",
-        "android/hardware/tests/bar/1.0/BpBar.h",
+        "android/hardware/tests/bar/1.0/BnHwBar.h",
+        "android/hardware/tests/bar/1.0/BpHwBar.h",
         "android/hardware/tests/bar/1.0/BsBar.h",
         "android/hardware/tests/bar/1.0/IComplicated.h",
         "android/hardware/tests/bar/1.0/IHwComplicated.h",
-        "android/hardware/tests/bar/1.0/BnComplicated.h",
-        "android/hardware/tests/bar/1.0/BpComplicated.h",
+        "android/hardware/tests/bar/1.0/BnHwComplicated.h",
+        "android/hardware/tests/bar/1.0/BpHwComplicated.h",
         "android/hardware/tests/bar/1.0/BsComplicated.h",
+        "android/hardware/tests/bar/1.0/IFooCallback.h",
+        "android/hardware/tests/bar/1.0/IHwFooCallback.h",
+        "android/hardware/tests/bar/1.0/BnHwFooCallback.h",
+        "android/hardware/tests/bar/1.0/BpHwFooCallback.h",
+        "android/hardware/tests/bar/1.0/BsFooCallback.h",
+        "android/hardware/tests/bar/1.0/IImportRules.h",
+        "android/hardware/tests/bar/1.0/IHwImportRules.h",
+        "android/hardware/tests/bar/1.0/BnHwImportRules.h",
+        "android/hardware/tests/bar/1.0/BpHwImportRules.h",
+        "android/hardware/tests/bar/1.0/BsImportRules.h",
         "android/hardware/tests/bar/1.0/IImportTypes.h",
         "android/hardware/tests/bar/1.0/IHwImportTypes.h",
-        "android/hardware/tests/bar/1.0/BnImportTypes.h",
-        "android/hardware/tests/bar/1.0/BpImportTypes.h",
+        "android/hardware/tests/bar/1.0/BnHwImportTypes.h",
+        "android/hardware/tests/bar/1.0/BpHwImportTypes.h",
         "android/hardware/tests/bar/1.0/BsImportTypes.h",
     ],
 }
diff --git a/tests/bar/1.0/IFooCallback.hal b/tests/bar/1.0/IFooCallback.hal
new file mode 100644
index 0000000..f42ce85
--- /dev/null
+++ b/tests/bar/1.0/IFooCallback.hal
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+interface IFooCallback {
+};
diff --git a/tests/bar/1.0/IImportRules.hal b/tests/bar/1.0/IImportRules.hal
new file mode 100644
index 0000000..db454b0
--- /dev/null
+++ b/tests/bar/1.0/IImportRules.hal
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+import android.hardware.tests.foo@1.0;
+
+interface IImportRules {
+    // Note that there is a android.hardware.tests.foo@1.0::Outer in types.hal
+    struct Outer {
+        struct Inner {
+            int32_t data;
+        };
+        string data;
+    };
+
+    rule0a(Outer o); // should be resolved to Outer above
+    rule0a1(IImportRules.Outer o); // should be resolved to Outer above
+    rule0b(@1.0::IImportRules.Outer o);
+    rule0c(android.hardware.tests.foo@1.0::Outer o);
+    rule0d(@1.0::Outer o); // android.hardware.tests.foo@1.0::Outer
+    rule0e(Outer.Inner o); // should be resolved to Outer above
+    rule0f(@1.0::IImportRules.Outer.Inner o);
+    rule0g(android.hardware.tests.foo@1.0::Outer.Inner o);
+    rule0h(@1.0::Outer.Inner o); // android.hardware.tests.foo@1.0::Outer.Inner
+
+    rule1a(Def abc); // should be resolved to Def in types.hal in this package
+    rule1b(android.hardware.tests.foo@1.0::Def abc);
+
+    rule2a(Unrelated related);
+
+    // android.hardware.tests.foo@1.0::IFooCallback, since bar@1.0::IFooCallback is not imported.
+    rule2b(IFooCallback fooCallback);
+};
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 4152bb9..6a8a360 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -2,9 +2,11 @@
 #define LOG_TAG "hidl_test"
 
 #include "Bar.h"
-#include <android/log.h>
+
 #include <inttypes.h>
 
+#include <log/log.h>
+
 namespace android {
 namespace hardware {
 namespace tests {
@@ -165,10 +167,8 @@
     return Void();
 }
 
-Return<void> Bar::haveAInterface(const sp<ISimple> &in,
-            haveAInterface_cb _hidl_cb) {
-    _hidl_cb(in);
-    return Void();
+Return<sp<ISimple>> Bar::haveAInterface(const sp<ISimple> &in) {
+    return in;
 }
 
 
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
index 70bffe7..b276823 100644
--- a/tests/bar/1.0/default/Bar.h
+++ b/tests/bar/1.0/default/Bar.h
@@ -71,8 +71,7 @@
 
     Return<void> takeAMask(BitField bf, uint8_t first, const MyMask& second, uint8_t third,
             takeAMask_cb _hidl_cb) override;
-    Return<void> haveAInterface(const sp<ISimple> &in,
-            haveAInterface_cb _hidl_cb) override;
+    Return<sp<ISimple>> haveAInterface(const sp<ISimple> &in);
 
 private:
     sp<IFoo> mFoo;
diff --git a/tests/bar/1.0/types.hal b/tests/bar/1.0/types.hal
new file mode 100644
index 0000000..30022ad
--- /dev/null
+++ b/tests/bar/1.0/types.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+struct Def {
+    vec<string> vs;
+};
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 9caf809..4106838 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -32,18 +32,18 @@
         "android/hardware/tests/baz/1.0/types.h",
         "android/hardware/tests/baz/1.0/IBase.h",
         "android/hardware/tests/baz/1.0/IHwBase.h",
-        "android/hardware/tests/baz/1.0/BnBase.h",
-        "android/hardware/tests/baz/1.0/BpBase.h",
+        "android/hardware/tests/baz/1.0/BnHwBase.h",
+        "android/hardware/tests/baz/1.0/BpHwBase.h",
         "android/hardware/tests/baz/1.0/BsBase.h",
         "android/hardware/tests/baz/1.0/IBaz.h",
         "android/hardware/tests/baz/1.0/IHwBaz.h",
-        "android/hardware/tests/baz/1.0/BnBaz.h",
-        "android/hardware/tests/baz/1.0/BpBaz.h",
+        "android/hardware/tests/baz/1.0/BnHwBaz.h",
+        "android/hardware/tests/baz/1.0/BpHwBaz.h",
         "android/hardware/tests/baz/1.0/BsBaz.h",
         "android/hardware/tests/baz/1.0/IBazCallback.h",
         "android/hardware/tests/baz/1.0/IHwBazCallback.h",
-        "android/hardware/tests/baz/1.0/BnBazCallback.h",
-        "android/hardware/tests/baz/1.0/BpBazCallback.h",
+        "android/hardware/tests/baz/1.0/BnHwBazCallback.h",
+        "android/hardware/tests/baz/1.0/BpHwBazCallback.h",
         "android/hardware/tests/baz/1.0/BsBazCallback.h",
     ],
 }
diff --git a/tests/baz/1.0/IBaz.hal b/tests/baz/1.0/IBaz.hal
index a2d961a..40e4024 100644
--- a/tests/baz/1.0/IBaz.hal
+++ b/tests/baz/1.0/IBaz.hal
@@ -40,6 +40,11 @@
         int32_t[3][5] matrix3x5;
     };
 
+    struct NestedStruct {
+        int32_t a;
+        vec<T> matrices;
+    };
+
     @Fragile @NoReally(very="yes", array={"a","b","c"})
     oneway doThis(float param);
 
@@ -64,4 +69,6 @@
     returnABitField() generates (bitfield<BitField> good);
 
     size(uint32_t size) generates (uint32_t size);
+
+    getNestedStructs() generates(vec<NestedStruct> data);
 };
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index 80c4b3e..bb7aedd 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -25,13 +25,13 @@
     out: [
         "android/hardware/tests/expression/1.0/IExpression.h",
         "android/hardware/tests/expression/1.0/IHwExpression.h",
-        "android/hardware/tests/expression/1.0/BnExpression.h",
-        "android/hardware/tests/expression/1.0/BpExpression.h",
+        "android/hardware/tests/expression/1.0/BnHwExpression.h",
+        "android/hardware/tests/expression/1.0/BpHwExpression.h",
         "android/hardware/tests/expression/1.0/BsExpression.h",
         "android/hardware/tests/expression/1.0/IExpressionExt.h",
         "android/hardware/tests/expression/1.0/IHwExpressionExt.h",
-        "android/hardware/tests/expression/1.0/BnExpressionExt.h",
-        "android/hardware/tests/expression/1.0/BpExpressionExt.h",
+        "android/hardware/tests/expression/1.0/BnHwExpressionExt.h",
+        "android/hardware/tests/expression/1.0/BpHwExpressionExt.h",
         "android/hardware/tests/expression/1.0/BsExpressionExt.h",
     ],
 }
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 171ea84..8294c65 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -38,28 +38,28 @@
         "android/hardware/tests/foo/1.0/types.h",
         "android/hardware/tests/foo/1.0/IFoo.h",
         "android/hardware/tests/foo/1.0/IHwFoo.h",
-        "android/hardware/tests/foo/1.0/BnFoo.h",
-        "android/hardware/tests/foo/1.0/BpFoo.h",
+        "android/hardware/tests/foo/1.0/BnHwFoo.h",
+        "android/hardware/tests/foo/1.0/BpHwFoo.h",
         "android/hardware/tests/foo/1.0/BsFoo.h",
         "android/hardware/tests/foo/1.0/IFooCallback.h",
         "android/hardware/tests/foo/1.0/IHwFooCallback.h",
-        "android/hardware/tests/foo/1.0/BnFooCallback.h",
-        "android/hardware/tests/foo/1.0/BpFooCallback.h",
+        "android/hardware/tests/foo/1.0/BnHwFooCallback.h",
+        "android/hardware/tests/foo/1.0/BpHwFooCallback.h",
         "android/hardware/tests/foo/1.0/BsFooCallback.h",
         "android/hardware/tests/foo/1.0/IMyTypes.h",
         "android/hardware/tests/foo/1.0/IHwMyTypes.h",
-        "android/hardware/tests/foo/1.0/BnMyTypes.h",
-        "android/hardware/tests/foo/1.0/BpMyTypes.h",
+        "android/hardware/tests/foo/1.0/BnHwMyTypes.h",
+        "android/hardware/tests/foo/1.0/BpHwMyTypes.h",
         "android/hardware/tests/foo/1.0/BsMyTypes.h",
         "android/hardware/tests/foo/1.0/ISimple.h",
         "android/hardware/tests/foo/1.0/IHwSimple.h",
-        "android/hardware/tests/foo/1.0/BnSimple.h",
-        "android/hardware/tests/foo/1.0/BpSimple.h",
+        "android/hardware/tests/foo/1.0/BnHwSimple.h",
+        "android/hardware/tests/foo/1.0/BpHwSimple.h",
         "android/hardware/tests/foo/1.0/BsSimple.h",
         "android/hardware/tests/foo/1.0/ITheirTypes.h",
         "android/hardware/tests/foo/1.0/IHwTheirTypes.h",
-        "android/hardware/tests/foo/1.0/BnTheirTypes.h",
-        "android/hardware/tests/foo/1.0/BpTheirTypes.h",
+        "android/hardware/tests/foo/1.0/BnHwTheirTypes.h",
+        "android/hardware/tests/foo/1.0/BpHwTheirTypes.h",
         "android/hardware/tests/foo/1.0/BsTheirTypes.h",
     ],
 }
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index fc76c1c..76aefcf 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -98,6 +98,29 @@
 
     typedef bitfield<BitField> Mask;
 
+    struct Everything {
+        union U {
+            int8_t number;
+            int8_t[1][2] multidimArray;
+            pointer p;
+            Fumble anotherStruct;
+            bitfield<BitField> bf;
+        } u;
+
+        int8_t number;
+        handle h;
+        fmq_sync<uint8_t> descSync;
+        fmq_unsync<uint8_t> descUnsync;
+        memory mem;
+        pointer p;
+        string s;
+        vec<string> vs;
+        string[2][2] multidimArray;
+        string[3] sArray;
+        Quux anotherStruct;
+        bitfield<BitField> bf;
+    };
+
     doThis(float param);
     doThatAndReturnSomething(int64_t param) generates (int32_t result);
     doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
diff --git a/tests/foo/1.0/default/Android.bp b/tests/foo/1.0/default/Android.bp
index 76a4656..952f25d 100644
--- a/tests/foo/1.0/default/Android.bp
+++ b/tests/foo/1.0/default/Android.bp
@@ -5,7 +5,6 @@
     relative_install_path: "hw",
     srcs: [
         "Foo.cpp",
-        "FooCallback.cpp",
     ],
 
     shared_libs: [
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index cdfdecc..a860ce7 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -2,7 +2,6 @@
 #define LOG_TAG "hidl_test"
 
 #include "Foo.h"
-#include "FooCallback.h"
 #include <android-base/logging.h>
 #include <hidl-test/FooHelper.h>
 #include <inttypes.h>
diff --git a/tests/foo/1.0/default/FooCallback.cpp b/tests/foo/1.0/default/FooCallback.cpp
deleted file mode 100644
index ff3a545..0000000
--- a/tests/foo/1.0/default/FooCallback.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-
-#define LOG_TAG "hidl_test"
-
-#include "FooCallback.h"
-#include <android/log.h>
-#include <hidl-test/FooHelper.h>
-#include <inttypes.h>
-#include <utils/Timers.h>
-
-namespace android {
-namespace hardware {
-namespace tests {
-namespace foo {
-namespace V1_0 {
-namespace implementation {
-
-enum {
-    NOT_REPORTED = -1LL
-};
-
-FooCallback::FooCallback()
-        : mLock{}, mCond{} {
-    for (size_t i = 0; i < invokeInfo.size(); i++) {
-        invokeInfo[i].invoked = false;
-        invokeInfo[i].timeNs = NOT_REPORTED;
-        invokeInfo[i].callerBlockedNs = NOT_REPORTED;
-    }
-}
-
-Return<void> FooCallback::heyItsYou(
-        const sp<IFooCallback> &_cb) {
-    nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) 1: heyItsYou cb = %p", _cb.get());
-    nsecs_t end = systemTime();
-    {
-        Mutex::Autolock lock(mLock);
-        invokeInfo[0].invoked = true;
-        invokeInfo[0].timeNs = end - start;
-        mCond.signal();
-    }
-    ALOGI("SERVER(FooCallback) 2: heyItsYou returned");
-    return Void();
-}
-
-Return<bool> FooCallback::heyItsYouIsntIt(const sp<IFooCallback> &_cb) {
-    nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) 3: heyItsYouIsntIt cb = %p sleeping for %" PRId64 " seconds", _cb.get(), DELAY_S);
-    sleep(DELAY_S);
-    ALOGI("SERVER(FooCallback) 4: heyItsYouIsntIt cb = %p responding", _cb.get());
-    nsecs_t end = systemTime();
-    {
-        Mutex::Autolock lock(mLock);
-        invokeInfo[1].invoked = true;
-        invokeInfo[1].timeNs = end - start;
-        mCond.signal();
-    }
-    ALOGI("SERVER(FooCallback) 5: heyItsYouIsntIt cb = %p responding", _cb.get());
-    return true;
-}
-
-Return<void> FooCallback::heyItsTheMeaningOfLife(uint8_t tmol) {
-    nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) 6.1: heyItsTheMeaningOfLife = %d sleeping for %" PRId64 " seconds", tmol, DELAY_S);
-    sleep(DELAY_S);
-    ALOGI("SERVER(FooCallback) 6.2: heyItsTheMeaningOfLife = %d done sleeping", tmol);
-    nsecs_t end = systemTime();
-    {
-        Mutex::Autolock lock(mLock);
-        invokeInfo[2].invoked = true;
-        invokeInfo[2].timeNs = end - start;
-        mCond.signal();
-    }
-    ALOGI("SERVER(FooCallback) 6.3: heyItsTheMeaningOfLife returned");
-    return Void();
-}
-
-Return<void> FooCallback::reportResults(int64_t ns, reportResults_cb cb) {
-    ALOGI("SERVER(FooCallback) 8.1: reportResults(%" PRId64 " seconds)", nanoseconds_to_seconds(ns));
-    nsecs_t leftToWaitNs = ns;
-    bool cond;
-    {
-        Mutex::Autolock lock(mLock);
-        while ((cond = ((!invokeInfo[0].invoked ||
-                !invokeInfo[1].invoked ||
-                !invokeInfo[2].invoked ||
-                invokeInfo[0].callerBlockedNs == NOT_REPORTED ||
-                invokeInfo[1].callerBlockedNs == NOT_REPORTED ||
-                invokeInfo[2].callerBlockedNs == NOT_REPORTED)   &&
-               leftToWaitNs > 0))) {
-            nsecs_t start = systemTime();
-            ::android::status_t rc = mCond.waitRelative(mLock, leftToWaitNs);
-            if (rc != ::android::OK) {
-                ALOGW("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative(%" PRId64 ") returned error (%d)", ns, leftToWaitNs, rc);
-                if (rc == -ETIMEDOUT) {
-                    // time's up
-                    leftToWaitNs = -1;
-                }
-                break;
-            }
-            ALOGI("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative was signalled", ns);
-            leftToWaitNs -= systemTime() - start;
-        }
-    }
-    ALOGI("SERVER(FooCallback) 8.2: reportResults returned;"
-            "invoked? %d, %d, %d; leftToWaitNs = %" PRId64 "; cond = %d",
-            invokeInfo[0].invoked, invokeInfo[1].invoked, invokeInfo[2].invoked,
-            leftToWaitNs, cond);
-    cb(leftToWaitNs, invokeInfo);
-    return Void();
-}
-
-Return<void> FooCallback::youBlockedMeFor(const hidl_array<int64_t, 3> &ns) {
-    ALOGI("SERVER(FooCallback) 7.1: youBlockedMeFor");
-    {
-        Mutex::Autolock lock(mLock);
-        for (size_t i = 0; i < 3; i++) {
-            invokeInfo[i].callerBlockedNs = ns[i];
-        }
-        mCond.signal();
-    }
-    ALOGI("SERVER(FooCallback) 7.2: returned");
-    return Void();
-}
-
-IFooCallback* HIDL_FETCH_IFooCallback(const char* /* name */) {
-    return new FooCallback();
-}
-
-} // namespace implementation
-}  // namespace V1_0
-}  // namespace foo
-}  // namespace tests
-}  // namespace hardware
-}  // namespace android
diff --git a/tests/foo/1.0/default/FooCallback.h b/tests/foo/1.0/default/FooCallback.h
deleted file mode 100644
index 3164a9d..0000000
--- a/tests/foo/1.0/default/FooCallback.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef ANDROID_HARDWARE_TESTS_FOO_V1_0_FOOCALLBACK_H
-#define ANDROID_HARDWARE_TESTS_FOO_V1_0_FOOCALLBACK_H
-
-#include <android/hardware/tests/foo/1.0/IFooCallback.h>
-#include <hidl/Status.h>
-#include <hidl/MQDescriptor.h>
-
-#include <utils/Condition.h>
-namespace android {
-namespace hardware {
-namespace tests {
-namespace foo {
-namespace V1_0 {
-namespace implementation {
-
-using ::android::hardware::tests::foo::V1_0::IFooCallback;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::hidl_string;
-using ::android::sp;
-
-struct FooCallback : public IFooCallback {
-    FooCallback();
-    // Methods from ::android::hardware::tests::foo::V1_0::IFooCallback follow.
-    Return<void> heyItsYou(const sp<IFooCallback>& cb)  override;
-    Return<bool> heyItsYouIsntIt(const sp<IFooCallback>& cb)  override;
-    Return<void> heyItsTheMeaningOfLife(uint8_t tmol)  override;
-    Return<void> reportResults(int64_t ns, reportResults_cb _hidl_cb)  override;
-    Return<void> youBlockedMeFor(const hidl_array<int64_t, 3 /* 3 */>& callerBlockedInfo)  override;
-
-    hidl_array<InvokeInfo, 3> invokeInfo;
-    Mutex mLock;
-    Condition mCond;
-};
-
-extern "C" IFooCallback* HIDL_FETCH_IFooCallback(const char* name);
-
-}  // namespace implementation
-}  // namespace V1_0
-}  // namespace foo
-}  // namespace tests
-}  // namespace hardware
-}  // namespace android
-
-#endif  // ANDROID_HARDWARE_TESTS_FOO_V1_0_FOOCALLBACK_H
diff --git a/tests/foo/1.0/types.hal b/tests/foo/1.0/types.hal
index a01fc2d..6b4b697 100644
--- a/tests/foo/1.0/types.hal
+++ b/tests/foo/1.0/types.hal
@@ -22,6 +22,10 @@
     handle z;
 };
 
+struct Def {
+    string g;
+};
+
 struct Outer {
     struct Inner {
         struct Deep {
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index 2a6860b..4389147 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -31,23 +31,23 @@
     out: [
         "android/hardware/tests/inheritance/1.0/IChild.h",
         "android/hardware/tests/inheritance/1.0/IHwChild.h",
-        "android/hardware/tests/inheritance/1.0/BnChild.h",
-        "android/hardware/tests/inheritance/1.0/BpChild.h",
+        "android/hardware/tests/inheritance/1.0/BnHwChild.h",
+        "android/hardware/tests/inheritance/1.0/BpHwChild.h",
         "android/hardware/tests/inheritance/1.0/BsChild.h",
         "android/hardware/tests/inheritance/1.0/IFetcher.h",
         "android/hardware/tests/inheritance/1.0/IHwFetcher.h",
-        "android/hardware/tests/inheritance/1.0/BnFetcher.h",
-        "android/hardware/tests/inheritance/1.0/BpFetcher.h",
+        "android/hardware/tests/inheritance/1.0/BnHwFetcher.h",
+        "android/hardware/tests/inheritance/1.0/BpHwFetcher.h",
         "android/hardware/tests/inheritance/1.0/BsFetcher.h",
         "android/hardware/tests/inheritance/1.0/IGrandparent.h",
         "android/hardware/tests/inheritance/1.0/IHwGrandparent.h",
-        "android/hardware/tests/inheritance/1.0/BnGrandparent.h",
-        "android/hardware/tests/inheritance/1.0/BpGrandparent.h",
+        "android/hardware/tests/inheritance/1.0/BnHwGrandparent.h",
+        "android/hardware/tests/inheritance/1.0/BpHwGrandparent.h",
         "android/hardware/tests/inheritance/1.0/BsGrandparent.h",
         "android/hardware/tests/inheritance/1.0/IParent.h",
         "android/hardware/tests/inheritance/1.0/IHwParent.h",
-        "android/hardware/tests/inheritance/1.0/BnParent.h",
-        "android/hardware/tests/inheritance/1.0/BpParent.h",
+        "android/hardware/tests/inheritance/1.0/BnHwParent.h",
+        "android/hardware/tests/inheritance/1.0/BpHwParent.h",
         "android/hardware/tests/inheritance/1.0/BsParent.h",
     ],
 }
diff --git a/tests/inheritance/1.0/default/Child.cpp b/tests/inheritance/1.0/default/Child.cpp
index fd6608c..d4e82c0 100644
--- a/tests/inheritance/1.0/default/Child.cpp
+++ b/tests/inheritance/1.0/default/Child.cpp
@@ -1,5 +1,6 @@
 #define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "Child.h"
 
diff --git a/tests/inheritance/1.0/default/Fetcher.cpp b/tests/inheritance/1.0/default/Fetcher.cpp
index f3b576b..7094f07 100644
--- a/tests/inheritance/1.0/default/Fetcher.cpp
+++ b/tests/inheritance/1.0/default/Fetcher.cpp
@@ -17,8 +17,7 @@
     CHECK(!mPrecious->isRemote());
 }
 
-template <typename CB>
-Return<void> selectService(bool sendRemote, CB &_hidl_cb, sp<IChild> &local) {
+sp<IChild> selectService(bool sendRemote, sp<IChild> &local) {
     sp<IChild> toSend;
     if (sendRemote) {
         toSend = IChild::getService("child");
@@ -29,21 +28,20 @@
         toSend = local;
     }
     LOG(INFO) << "SERVER(Fetcher) selectService returning " << toSend.get();
-    _hidl_cb(toSend);
-    return Void();
+    return toSend;
 }
 
 // Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
-Return<void> Fetcher::getGrandparent(bool sendRemote, getGrandparent_cb _hidl_cb)  {
-    return selectService(sendRemote, _hidl_cb, mPrecious);
+Return<sp<IGrandparent>> Fetcher::getGrandparent(bool sendRemote)  {
+    return selectService(sendRemote, mPrecious);
 }
 
-Return<void> Fetcher::getParent(bool sendRemote, getParent_cb _hidl_cb)  {
-    return selectService(sendRemote, _hidl_cb, mPrecious);
+Return<sp<IParent>> Fetcher::getParent(bool sendRemote)  {
+    return selectService(sendRemote, mPrecious);
 }
 
-Return<void> Fetcher::getChild(bool sendRemote, getChild_cb _hidl_cb)  {
-    return selectService(sendRemote, _hidl_cb, mPrecious);
+Return<sp<IChild>> Fetcher::getChild(bool sendRemote)  {
+    return selectService(sendRemote, mPrecious);
 }
 
 IFetcher* HIDL_FETCH_IFetcher(const char* /* name */) {
diff --git a/tests/inheritance/1.0/default/Fetcher.h b/tests/inheritance/1.0/default/Fetcher.h
index da9b153..979b47f 100644
--- a/tests/inheritance/1.0/default/Fetcher.h
+++ b/tests/inheritance/1.0/default/Fetcher.h
@@ -25,9 +25,9 @@
     Fetcher();
 
     // Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
-    Return<void> getGrandparent(bool sendRemote, getGrandparent_cb _hidl_cb)  override;
-    Return<void> getParent(bool sendRemote, getParent_cb _hidl_cb)  override;
-    Return<void> getChild(bool sendRemote, getChild_cb _hidl_cb)  override;
+    Return<sp<IGrandparent>> getGrandparent(bool sendRemote)  override;
+    Return<sp<IParent>> getParent(bool sendRemote)  override;
+    Return<sp<IChild>> getChild(bool sendRemote)  override;
 
 private:
     sp<IChild> mPrecious;
diff --git a/tests/inheritance/1.0/default/Parent.cpp b/tests/inheritance/1.0/default/Parent.cpp
index a6fd911..d3f1932 100644
--- a/tests/inheritance/1.0/default/Parent.cpp
+++ b/tests/inheritance/1.0/default/Parent.cpp
@@ -1,5 +1,6 @@
 #define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
 
 #include "Parent.h"
 
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 8730665..8c27225 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/tests/libhwbinder/1.0/IBenchmark.h",
         "android/hardware/tests/libhwbinder/1.0/IHwBenchmark.h",
-        "android/hardware/tests/libhwbinder/1.0/BnBenchmark.h",
-        "android/hardware/tests/libhwbinder/1.0/BpBenchmark.h",
+        "android/hardware/tests/libhwbinder/1.0/BnHwBenchmark.h",
+        "android/hardware/tests/libhwbinder/1.0/BpHwBenchmark.h",
         "android/hardware/tests/libhwbinder/1.0/BsBenchmark.h",
     ],
 }
diff --git a/tests/memory/1.0/Android.bp b/tests/memory/1.0/Android.bp
index 155677f..d8fe811 100644
--- a/tests/memory/1.0/Android.bp
+++ b/tests/memory/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/tests/memory/1.0/IMemoryTest.h",
         "android/hardware/tests/memory/1.0/IHwMemoryTest.h",
-        "android/hardware/tests/memory/1.0/BnMemoryTest.h",
-        "android/hardware/tests/memory/1.0/BpMemoryTest.h",
+        "android/hardware/tests/memory/1.0/BnHwMemoryTest.h",
+        "android/hardware/tests/memory/1.0/BpHwMemoryTest.h",
         "android/hardware/tests/memory/1.0/BsMemoryTest.h",
     ],
 }
diff --git a/tests/memory/1.0/IMemoryTest.hal b/tests/memory/1.0/IMemoryTest.hal
index c20c536..4d6de3f 100644
--- a/tests/memory/1.0/IMemoryTest.hal
+++ b/tests/memory/1.0/IMemoryTest.hal
@@ -17,5 +17,6 @@
 package android.hardware.tests.memory@1.0;
 
 interface IMemoryTest {
+    haveSomeMemory(memory mem) generates(memory mem);
     fillMemory(memory memory_in, uint8_t filler);
 };
diff --git a/tests/memory/1.0/default/MemoryTest.cpp b/tests/memory/1.0/default/MemoryTest.cpp
index 1f804ca..37a2a60 100644
--- a/tests/memory/1.0/default/MemoryTest.cpp
+++ b/tests/memory/1.0/default/MemoryTest.cpp
@@ -18,12 +18,12 @@
 
 #include "MemoryTest.h"
 
+#include <log/log.h>
+
 #include <hidlmemory/mapping.h>
 
 #include <android/hidl/memory/1.0/IMemory.h>
 
-#include <android/log.h>
-
 using android::hidl::memory::V1_0::IMemory;
 
 namespace android {
@@ -34,6 +34,11 @@
 namespace implementation {
 
 // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+Return<void> Memory::haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) {
+    _hidl_cb(mem);
+    return Void();
+}
+
 Return<void> Memory::fillMemory(const hidl_memory& memory_in, uint8_t filler) {
     sp<IMemory> memory = mapMemory(memory_in);
 
diff --git a/tests/memory/1.0/default/MemoryTest.h b/tests/memory/1.0/default/MemoryTest.h
index 5cab494..0d903f1 100644
--- a/tests/memory/1.0/default/MemoryTest.h
+++ b/tests/memory/1.0/default/MemoryTest.h
@@ -39,6 +39,8 @@
 
 struct Memory : public IMemoryTest {
     // Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+    Return<void> haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) override;
+
     Return<void> fillMemory(const hidl_memory& memory_in, uint8_t filler) override;
 
 };
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index f2e257b..669722e 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/tests/msgq/1.0/ITestMsgQ.h",
         "android/hardware/tests/msgq/1.0/IHwTestMsgQ.h",
-        "android/hardware/tests/msgq/1.0/BnTestMsgQ.h",
-        "android/hardware/tests/msgq/1.0/BpTestMsgQ.h",
+        "android/hardware/tests/msgq/1.0/BnHwTestMsgQ.h",
+        "android/hardware/tests/msgq/1.0/BpHwTestMsgQ.h",
         "android/hardware/tests/msgq/1.0/BsTestMsgQ.h",
     ],
 }
diff --git a/tests/msgq/1.0/ITestMsgQ.hal b/tests/msgq/1.0/ITestMsgQ.hal
index 933e39b..3ed1b37 100644
--- a/tests/msgq/1.0/ITestMsgQ.hal
+++ b/tests/msgq/1.0/ITestMsgQ.hal
@@ -91,4 +91,23 @@
      *
      */
     oneway requestBlockingRead(int32_t count);
+
+    /*
+     * This method requests the service to trigger a blocking read using
+     * default Event Flag notification bits defined by the MessageQueue class.
+     *
+     * @param count Number of messages to read.
+     *
+     */
+    oneway requestBlockingReadDefaultEventFlagBits(int32_t count);
+
+    /*
+     * This method requests the service to repeatedly trigger blocking reads.
+     *
+     * @param count Number of messages to read in a single blocking read.
+     * @param numIter Number of blocking reads to trigger.
+     *
+     */
+    oneway requestBlockingReadRepeat(int32_t count, int32_t numIter);
+
 };
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index d1ffda6..be7f873 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -25,13 +25,13 @@
     out: [
         "android/hardware/tests/pointer/1.0/IGraph.h",
         "android/hardware/tests/pointer/1.0/IHwGraph.h",
-        "android/hardware/tests/pointer/1.0/BnGraph.h",
-        "android/hardware/tests/pointer/1.0/BpGraph.h",
+        "android/hardware/tests/pointer/1.0/BnHwGraph.h",
+        "android/hardware/tests/pointer/1.0/BpHwGraph.h",
         "android/hardware/tests/pointer/1.0/BsGraph.h",
         "android/hardware/tests/pointer/1.0/IPointer.h",
         "android/hardware/tests/pointer/1.0/IHwPointer.h",
-        "android/hardware/tests/pointer/1.0/BnPointer.h",
-        "android/hardware/tests/pointer/1.0/BpPointer.h",
+        "android/hardware/tests/pointer/1.0/BnHwPointer.h",
+        "android/hardware/tests/pointer/1.0/BpHwPointer.h",
         "android/hardware/tests/pointer/1.0/BsPointer.h",
     ],
 }
diff --git a/tests/pointer/1.0/default/Graph.cpp b/tests/pointer/1.0/default/Graph.cpp
index 9852407..5c8098b 100644
--- a/tests/pointer/1.0/default/Graph.cpp
+++ b/tests/pointer/1.0/default/Graph.cpp
@@ -1,7 +1,9 @@
 #define LOG_TAG "hidl_test"
 
 #include "Graph.h"
-#include <android/log.h>
+
+#include <log/log.h>
+
 #include <hidl-test/PointerHelper.h>
 
 #define PUSH_ERROR_IF(__cond__) if(__cond__) { errors.push_back(std::to_string(__LINE__) + ": " + #__cond__); }
diff --git a/tests/pointer/1.0/default/Pointer.cpp b/tests/pointer/1.0/default/Pointer.cpp
index 2b4a323..52712d4 100644
--- a/tests/pointer/1.0/default/Pointer.cpp
+++ b/tests/pointer/1.0/default/Pointer.cpp
@@ -1,7 +1,8 @@
 #define LOG_TAG "hidl_test"
 
 #include "Pointer.h"
-#include <android/log.h>
+
+#include <log/log.h>
 
 namespace android {
 namespace hardware {
diff --git a/tests/pointer/1.0/default/lib/PointerHelper.cpp b/tests/pointer/1.0/default/lib/PointerHelper.cpp
index 3bc82c2..0a64cc3 100644
--- a/tests/pointer/1.0/default/lib/PointerHelper.cpp
+++ b/tests/pointer/1.0/default/lib/PointerHelper.cpp
@@ -1,6 +1,9 @@
 #define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
+
 #include "PointerHelper.h"
+
 namespace android {
 
 void simpleGraph(IGraph::Graph& g) {
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index f2c60da..e80bedc 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/thermal/1.0/types.h",
         "android/hardware/thermal/1.0/IThermal.h",
         "android/hardware/thermal/1.0/IHwThermal.h",
-        "android/hardware/thermal/1.0/BnThermal.h",
-        "android/hardware/thermal/1.0/BpThermal.h",
+        "android/hardware/thermal/1.0/BnHwThermal.h",
+        "android/hardware/thermal/1.0/BpHwThermal.h",
         "android/hardware/thermal/1.0/BsThermal.h",
     ],
 }
diff --git a/thermal/1.0/default/Thermal.cpp b/thermal/1.0/default/Thermal.cpp
index 580b540..2dd0090 100644
--- a/thermal/1.0/default/Thermal.cpp
+++ b/thermal/1.0/default/Thermal.cpp
@@ -15,12 +15,16 @@
  */
 
 #define LOG_TAG "android.hardware.thermal@1.0-impl"
-#include <android/log.h>
 
 #include <errno.h>
+#include <math.h>
+
+#include <vector>
+
+#include <log/log.h>
+
 #include <hardware/hardware.h>
 #include <hardware/thermal.h>
-#include <vector>
 
 #include "Thermal.h"
 
@@ -30,6 +34,14 @@
 namespace V1_0 {
 namespace implementation {
 
+namespace {
+
+float finalizeTemperature(float temperature) {
+    return temperature == UNKNOWN_TEMPERATURE ? NAN : temperature;
+}
+
+}
+
 Thermal::Thermal(thermal_module_t* module) : mModule(module) {}
 
 // Methods from ::android::hardware::thermal::V1_0::IThermal follow.
@@ -73,10 +85,11 @@
             ;
         }
         temperatures[i].name = list[i].name;
-        temperatures[i].currentValue = list[i].current_value;
-        temperatures[i].throttlingThreshold = list[i].throttling_threshold;
-        temperatures[i].shutdownThreshold = list[i].shutdown_threshold;
-        temperatures[i].vrThrottlingThreshold = list[i].vr_throttling_threshold;
+        temperatures[i].currentValue = finalizeTemperature(list[i].current_value);
+        temperatures[i].throttlingThreshold = finalizeTemperature(list[i].throttling_threshold);
+        temperatures[i].shutdownThreshold = finalizeTemperature(list[i].shutdown_threshold);
+        temperatures[i].vrThrottlingThreshold =
+                finalizeTemperature(list[i].vr_throttling_threshold);
       }
     }
   }
diff --git a/thermal/1.0/types.hal b/thermal/1.0/types.hal
index 8864f43..eb5d7c7 100644
--- a/thermal/1.0/types.hal
+++ b/thermal/1.0/types.hal
@@ -45,28 +45,27 @@
     string name;
 
     /**
-     * Current temperature in Celsius. If not available set by HAL to
-     * UNKNOWN_TEMPERATURE.
+     * Current temperature in Celsius. If not available set by HAL to NAN.
      * Current temperature can be in any units if type=UNKNOWN.
      */
     float currentValue;
 
     /**
      * Throttling temperature constant for this temperature.
-     * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+     * If not available, set by HAL to NAN.
      */
     float throttlingThreshold;
 
     /**
      * Shutdown temperature constant for this temperature.
-     * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+     * If not available, set by HAL to NAN.
      */
     float shutdownThreshold;
 
     /**
      * Threshold temperature above which the VR mode clockrate minimums cannot
      * be maintained for this device.
-     * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+     * If not available, set by HAL to NAN.
      */
     float vrThrottlingThreshold;
 
@@ -135,7 +134,3 @@
      */
     string debugMessage;
 };
-
-/**
- * TODO(pbond): add float constant UNDEFINED_TEMPERATURE.
- */
diff --git a/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
index 8a5ea2c..d922169 100644
--- a/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
+++ b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
@@ -43,8 +43,6 @@
 #define THERMAL_SERVICE_NAME "thermal"
 #define MONITORING_OPERATION_NUMBER 10
 
-#define UNDEFINED_TEMPERATURE (-FLT_MAX)
-
 #define MAX_DEVICE_TEMPERATURE 200
 #define MAX_FAN_SPEED 20000
 
@@ -127,21 +125,18 @@
     // .currentValue of known type is in Celsius and must be reasonable.
     EXPECT_TRUE(temperature.type == TemperatureType::UNKNOWN ||
                 std::abs(temperature.currentValue) < MAX_DEVICE_TEMPERATURE ||
-                temperature.currentValue == UNDEFINED_TEMPERATURE);
+                isnan(temperature.currentValue));
 
     // .name must not be empty.
     EXPECT_LT(0u, temperature.name.size());
 
     // .currentValue must not exceed .shutdwonThreshold if defined.
     EXPECT_TRUE(temperature.currentValue < temperature.shutdownThreshold ||
-                temperature.currentValue == UNDEFINED_TEMPERATURE ||
-                temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+                isnan(temperature.currentValue) || isnan(temperature.shutdownThreshold));
 
     // .throttlingThreshold must not exceed .shutdownThreshold if defined.
-    EXPECT_TRUE(temperature.throttlingThreshold <
-                    temperature.shutdownThreshold ||
-                temperature.throttlingThreshold == UNDEFINED_TEMPERATURE ||
-                temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+    EXPECT_TRUE(temperature.throttlingThreshold < temperature.shutdownThreshold ||
+                isnan(temperature.throttlingThreshold) || isnan(temperature.shutdownThreshold));
   }
 
   // Check validity of CPU usage returned by Thermal HAL.
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
index 3594745..169264d 100644
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
+++ b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
@@ -26,8 +26,6 @@
             "/>
         <option name="binary-test-type" value="gtest" />
         <option name="test-timeout" value="5m" />
-        <option name="test-config-path"
-            value="vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config" />
     </test>
 </configuration>
 
diff --git a/thermal/Android.mk b/thermal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/thermal/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/Android.mk b/tv/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index 4c98cb9..21233ab 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/tv/cec/1.0/types.h",
         "android/hardware/tv/cec/1.0/IHdmiCec.h",
         "android/hardware/tv/cec/1.0/IHwHdmiCec.h",
-        "android/hardware/tv/cec/1.0/BnHdmiCec.h",
-        "android/hardware/tv/cec/1.0/BpHdmiCec.h",
+        "android/hardware/tv/cec/1.0/BnHwHdmiCec.h",
+        "android/hardware/tv/cec/1.0/BpHwHdmiCec.h",
         "android/hardware/tv/cec/1.0/BsHdmiCec.h",
         "android/hardware/tv/cec/1.0/IHdmiCecCallback.h",
         "android/hardware/tv/cec/1.0/IHwHdmiCecCallback.h",
-        "android/hardware/tv/cec/1.0/BnHdmiCecCallback.h",
-        "android/hardware/tv/cec/1.0/BpHdmiCecCallback.h",
+        "android/hardware/tv/cec/1.0/BnHwHdmiCecCallback.h",
+        "android/hardware/tv/cec/1.0/BpHwHdmiCecCallback.h",
         "android/hardware/tv/cec/1.0/BsHdmiCecCallback.h",
     ],
 }
diff --git a/tv/cec/1.0/vts/Android.mk b/tv/cec/1.0/vts/Android.mk
index 60cc723..fc636f7 100644
--- a/tv/cec/1.0/vts/Android.mk
+++ b/tv/cec/1.0/vts/Android.mk
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_cec/hidl/Android.mk
diff --git a/tv/cec/1.0/vts/functional/Android.mk b/tv/cec/1.0/vts/functional/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/Android.mk b/tv/cec/1.0/vts/functional/vts/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/hidl/host/TvCecHidlTest.py b/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/hidl/host/TvCecHidlTest.py
index cd2374a..5f7aaf1 100644
--- a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/hidl/host/TvCecHidlTest.py
+++ b/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/hidl/host/TvCecHidlTest.py
@@ -17,6 +17,7 @@
 
 import logging
 
+from vts.proto import ComponentSpecificationMessage_pb2 as CompSpecMsg
 from vts.runners.host import asserts
 from vts.runners.host import base_test_with_webdb
 from vts.runners.host import const
@@ -37,13 +38,14 @@
         self.dut.shell.one.Execute(
             "setprop vts.hal.vts.hidl.get_stub true")
 
-        self.dut.hal.InitHidlHal(target_type="tv_cec",
-                                 target_basepaths=["/system/lib64"],
-                                 target_version=1.0,
-                                 target_package="android.hardware.tv.cec",
-                                 target_component_name="IHdmiCec",
-                                 hw_binder_service_name="tv.cec",
-                                 bits=64)
+        self.dut.hal.InitHidlHal(
+            target_type="tv_cec",
+            target_basepaths=self.dut.libPaths,
+            target_version=1.0,
+            target_package="android.hardware.tv.cec",
+            target_component_name="IHdmiCec",
+            hw_binder_service_name="cec-hal-1-0",
+            bits=64 if self.dut.is64Bit else 32)
 
     def testGetCecVersion1(self):
         """A simple test case which queries the cec version."""
@@ -51,6 +53,20 @@
         version = self.dut.hal.tv_cec.getCecVersion()
         logging.info('Cec version: %s', version)
 
+    def testSendRandomMessage(self):
+        """A test case which sends a random message."""
+        self.vtypes = self.dut.hal.tv_cec.GetHidlTypeInterface("types")
+        logging.info("tv_cec types: %s", self.vtypes)
+
+        cec_message = {
+            "initiator": self.vtypes.TV,
+            "destination": self.vtypes.PLAYBACK_1,
+            "body": [1, 2, 3]
+        }
+        message = self.vtypes.Py2Pb("CecMessage", cec_message)
+        logging.info("message: %s", message)
+        result = self.dut.hal.tv_cec.sendMessage(message)
+        logging.info('sendMessage result: %s', result)
 
 if __name__ == "__main__":
     test_runner.main()
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index 94dcdc9..6bcb985 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/tv/input/1.0/types.h",
         "android/hardware/tv/input/1.0/ITvInput.h",
         "android/hardware/tv/input/1.0/IHwTvInput.h",
-        "android/hardware/tv/input/1.0/BnTvInput.h",
-        "android/hardware/tv/input/1.0/BpTvInput.h",
+        "android/hardware/tv/input/1.0/BnHwTvInput.h",
+        "android/hardware/tv/input/1.0/BpHwTvInput.h",
         "android/hardware/tv/input/1.0/BsTvInput.h",
         "android/hardware/tv/input/1.0/ITvInputCallback.h",
         "android/hardware/tv/input/1.0/IHwTvInputCallback.h",
-        "android/hardware/tv/input/1.0/BnTvInputCallback.h",
-        "android/hardware/tv/input/1.0/BpTvInputCallback.h",
+        "android/hardware/tv/input/1.0/BnHwTvInputCallback.h",
+        "android/hardware/tv/input/1.0/BpHwTvInputCallback.h",
         "android/hardware/tv/input/1.0/BsTvInputCallback.h",
     ],
 }
@@ -128,3 +128,95 @@
         "android.hidl.base@1.0",
     ],
 }
+
+genrule {
+    name: "android.hardware.tv.input@1.0-ITvInput-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.input@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
+    srcs: [
+        "ITvInput.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/input/1.0/TvInput.vts.cpp",
+        "android/hardware/tv/input/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.input@1.0-ITvInput-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.input@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
+    srcs: [
+        "ITvInput.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/input/1.0/TvInput.vts.h",
+        "android/hardware/tv/input/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.tv.input@1.0-ITvInput-vts.profiler",
+    generated_sources: ["android.hardware.tv.input@1.0-ITvInput-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.tv.input@1.0-ITvInput-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.tv.input@1.0-ITvInput-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+        "android.hardware.tv.input@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.input@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
+    srcs: [
+        "ITvInputCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/input/1.0/TvInputCallback.vts.cpp",
+        "android/hardware/tv/input/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.input@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
+    srcs: [
+        "ITvInputCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/input/1.0/TvInputCallback.vts.h",
+        "android/hardware/tv/input/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler",
+    generated_sources: ["android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.tv.input@1.0-ITvInputCallback-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hardware.audio.common@2.0",
+        "android.hidl.base@1.0",
+        "android.hardware.tv.input@1.0",
+    ],
+}
diff --git a/tv/input/1.0/vts/Android.mk b/tv/input/1.0/vts/Android.mk
index 040cfce..e0ad01e 100644
--- a/tv/input/1.0/vts/Android.mk
+++ b/tv/input/1.0/vts/Android.mk
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_input/hidl/host/Android.mk
+include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_input/hidl/Android.mk
diff --git a/tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/host/TvInputHidlTest.py b/tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/host/TvInputHidlTest.py
index c99c82c..9b49078 100644
--- a/tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/host/TvInputHidlTest.py
+++ b/tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/host/TvInputHidlTest.py
@@ -39,13 +39,14 @@
                                  target_version=1.0,
                                  target_package="android.hardware.tv.input",
                                  target_component_name="ITvInput",
-                                 bits=64)
+                                 hw_binder_service_name="tv-input-1-0",
+                                 bits=64 if self.dut.is64Bit else 32)
 
         self.dut.shell.InvokeTerminal("one")
 
     def testGetStreamConfigurations(self):
         configs = self.dut.hal.tv_input.getStreamConfigurations(0)
-        logging.info('tv input configs: %s', configs)
+        logging.info('return value of getStreamConfigurations(0): %s', configs)
 
 
 if __name__ == "__main__":
diff --git a/vehicle/2.0/Android.bp b/vehicle/2.0/Android.bp
index 04dfd5a..986fb74 100644
--- a/vehicle/2.0/Android.bp
+++ b/vehicle/2.0/Android.bp
@@ -29,13 +29,13 @@
         "android/hardware/vehicle/2.0/types.h",
         "android/hardware/vehicle/2.0/IVehicle.h",
         "android/hardware/vehicle/2.0/IHwVehicle.h",
-        "android/hardware/vehicle/2.0/BnVehicle.h",
-        "android/hardware/vehicle/2.0/BpVehicle.h",
+        "android/hardware/vehicle/2.0/BnHwVehicle.h",
+        "android/hardware/vehicle/2.0/BpHwVehicle.h",
         "android/hardware/vehicle/2.0/BsVehicle.h",
         "android/hardware/vehicle/2.0/IVehicleCallback.h",
         "android/hardware/vehicle/2.0/IHwVehicleCallback.h",
-        "android/hardware/vehicle/2.0/BnVehicleCallback.h",
-        "android/hardware/vehicle/2.0/BpVehicleCallback.h",
+        "android/hardware/vehicle/2.0/BnHwVehicleCallback.h",
+        "android/hardware/vehicle/2.0/BpHwVehicleCallback.h",
         "android/hardware/vehicle/2.0/BsVehicleCallback.h",
     ],
 }
diff --git a/vehicle/2.0/IVehicle.hal b/vehicle/2.0/IVehicle.hal
index 5b0df67..cab6ce0 100644
--- a/vehicle/2.0/IVehicle.hal
+++ b/vehicle/2.0/IVehicle.hal
@@ -99,9 +99,6 @@
    * primitives used (such as mutex locks or semaphores) must be acquired
    * with a timeout.
    *
-   * TODO(pavelm): we cannot use handle here due to Java compatibility, it's
-   * better to pass file descriptor and write debug data directly in vehicle HAL
-   * rather than passing back a string.
    */
   debugDump() generates (string s);
 };
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
index 77ee9d4..12c1c1b 100644
--- a/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -159,6 +159,18 @@
         .prop = VehicleProperty::IGNITION_STATE,
         .access = VehiclePropertyAccess::READ,
         .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+    },
+
+    {
+        .prop = VehicleProperty::OBD2_LIVE_FRAME,
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+    },
+
+    {
+        .prop = VehicleProperty::OBD2_FREEZE_FRAME,
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
     }
 };
 
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index 6cbcfe3..4541168 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -90,6 +90,14 @@
         case VehicleProperty::IGNITION_STATE:
             v = pool.obtainInt32(toInt(VehicleIgnitionState::ACC));
             break;
+        case VehicleProperty::OBD2_LIVE_FRAME:
+            v = pool.obtainComplex();
+            *outStatus = fillObd2LiveFrame(&v);
+            break;
+        case VehicleProperty::OBD2_FREEZE_FRAME:
+            v = pool.obtainComplex();
+            *outStatus = fillObd2FreezeFrame(&v);
+            break;
         default:
             *outStatus = StatusCode::INVALID_ARG;
     }
@@ -197,6 +205,78 @@
     return StatusCode::OK;
 }
 
+static std::vector<int32_t> fillObd2IntValues() {
+    std::vector<int32_t> intValues(toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX));
+#define SENSOR(name) toInt(Obd2IntegerSensorIndex:: name)
+    intValues[SENSOR(FUEL_SYSTEM_STATUS)] = toInt(FuelSystemStatus::CLOSED_LOOP);
+    intValues[SENSOR(MALFUNCTION_INDICATOR_LIGHT_ON)] = 0;
+    intValues[SENSOR(IGNITION_MONITORS_SUPPORTED)] = toInt(IgnitionMonitorKind::SPARK);
+    intValues[SENSOR(IGNITION_SPECIFIC_MONITORS)] =
+        CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
+        CommonIgnitionMonitors::MISFIRE_AVAILABLE |
+        SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
+        SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE;
+    intValues[SENSOR(INTAKE_AIR_TEMPERATURE)] = 35;
+    intValues[SENSOR(COMMANDED_SECONDARY_AIR_STATUS)] =
+        toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF);
+    intValues[SENSOR(NUM_OXYGEN_SENSORS_PRESENT)] = 1;
+    intValues[SENSOR(RUNTIME_SINCE_ENGINE_START)] = 500;
+    intValues[SENSOR(DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON)] = 0;
+    intValues[SENSOR(WARMUPS_SINCE_CODES_CLEARED)] = 51;
+    intValues[SENSOR(DISTANCE_TRAVELED_SINCE_CODES_CLEARED)] = 365;
+    intValues[SENSOR(ABSOLUTE_BAROMETRIC_PRESSURE)] = 30;
+    intValues[SENSOR(CONTROL_MODULE_VOLTAGE)] = 12;
+    intValues[SENSOR(AMBIENT_AIR_TEMPERATURE)] = 18;
+    intValues[SENSOR(MAX_FUEL_AIR_EQUIVALENCE_RATIO)] = 1;
+    intValues[SENSOR(FUEL_TYPE)] = toInt(FuelType::GASOLINE);
+#undef SENSOR
+    return intValues;
+}
+
+static std::vector<float> fillObd2FloatValues() {
+    std::vector<float> floatValues(toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX));
+#define SENSOR(name) toInt(Obd2FloatSensorIndex:: name)
+    floatValues[SENSOR(CALCULATED_ENGINE_LOAD)] = 0.153;
+    floatValues[SENSOR(SHORT_TERM_FUEL_TRIM_BANK1)] = -0.16;
+    floatValues[SENSOR(LONG_TERM_FUEL_TRIM_BANK1)] = -0.16;
+    floatValues[SENSOR(SHORT_TERM_FUEL_TRIM_BANK2)] = -0.16;
+    floatValues[SENSOR(LONG_TERM_FUEL_TRIM_BANK2)] = -0.16;
+    floatValues[SENSOR(INTAKE_MANIFOLD_ABSOLUTE_PRESSURE)] = 7.5;
+    floatValues[SENSOR(ENGINE_RPM)] = 1250.;
+    floatValues[SENSOR(VEHICLE_SPEED)] = 40.;
+    floatValues[SENSOR(TIMING_ADVANCE)] = 2.5;
+    floatValues[SENSOR(THROTTLE_POSITION)] = 19.75;
+    floatValues[SENSOR(OXYGEN_SENSOR1_VOLTAGE)] = 0.265;
+    floatValues[SENSOR(FUEL_TANK_LEVEL_INPUT)] = 0.824;
+    floatValues[SENSOR(EVAPORATION_SYSTEM_VAPOR_PRESSURE)] = -0.373;
+    floatValues[SENSOR(CATALYST_TEMPERATURE_BANK1_SENSOR1)] = 190.;
+    floatValues[SENSOR(RELATIVE_THROTTLE_POSITION)] = 3.;
+    floatValues[SENSOR(ABSOLUTE_THROTTLE_POSITION_B)] = 0.306;
+    floatValues[SENSOR(ACCELERATOR_PEDAL_POSITION_D)] = 0.188;
+    floatValues[SENSOR(ACCELERATOR_PEDAL_POSITION_E)] = 0.094;
+    floatValues[SENSOR(COMMANDED_THROTTLE_ACTUATOR)] = 0.024;
+#undef SENSOR
+    return floatValues;
+}
+
+StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValuePtr* v) {
+    static std::vector<int32_t> intValues(fillObd2IntValues());
+    static std::vector<float> floatValues(fillObd2FloatValues());
+    (*v)->value.int32Values = intValues;
+    (*v)->value.floatValues = floatValues;
+    return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::fillObd2FreezeFrame(VehiclePropValuePtr* v) {
+    static std::vector<int32_t> intValues(fillObd2IntValues());
+    static std::vector<float> floatValues(fillObd2FloatValues());
+    (*v)->value.int32Values = intValues;
+    (*v)->value.floatValues = floatValues;
+    (*v)->value.stringValue = "P0010";
+    return StatusCode::OK;
+}
+
+
 }  // impl
 
 }  // namespace V2_0
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.h b/vehicle/2.0/default/impl/DefaultVehicleHal.h
index 231f2b2..15a4789 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -57,6 +57,8 @@
     StatusCode setHvacTemperature(int32_t areaId, float value);
     StatusCode getHvacDefroster(int32_t areaId, bool* outValue);
     StatusCode setHvacDefroster(int32_t areaId, bool value);
+    StatusCode fillObd2LiveFrame (VehiclePropValuePtr* v);
+    StatusCode fillObd2FreezeFrame (VehiclePropValuePtr* v);
 private:
     int32_t mFanSpeed = 3;
     int32_t mBrightness = 7;
diff --git a/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index e1e355e..b6a5c31 100644
--- a/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -205,7 +205,7 @@
 }
 
 template <typename T>
-inline std::string toString(const hidl_vec<T>& vec) {
+inline std::string vecToString(const hidl_vec<T>& vec) {
     std::stringstream ss("[");
     for (size_t i = 0; i < vec.size(); i++) {
         if (i != 0) ss << ",";
@@ -222,10 +222,10 @@
        << "  areaId: " << hexString(v.areaId) << ",\n"
        << "  timestamp: " << v.timestamp << ",\n"
        << "  value {\n"
-       << "    int32Values: " << toString(v.value.int32Values) << ",\n"
-       << "    floatValues: " << toString(v.value.floatValues) << ",\n"
-       << "    int64Values: " << toString(v.value.int64Values) << ",\n"
-       << "    bytes: " << toString(v.value.bytes) << ",\n"
+       << "    int32Values: " << vecToString(v.value.int32Values) << ",\n"
+       << "    floatValues: " << vecToString(v.value.floatValues) << ",\n"
+       << "    int64Values: " << vecToString(v.value.int64Values) << ",\n"
+       << "    bytes: " << vecToString(v.value.bytes) << ",\n"
        << "    string: " << v.value.stringValue.c_str() << ",\n"
        << "  }\n"
        << "}\n";
diff --git a/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp b/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
index d6458c2..063a16d 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
@@ -19,10 +19,10 @@
 #include "AccessControlConfigParser.h"
 
 #include <fstream>
-#include <sstream>
 #include <iostream>
+#include <sstream>
 
-#include <android/log.h>
+#include <log/log.h>
 
 namespace android {
 namespace hardware {
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
index 463b333..e9dd68d 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
@@ -18,7 +18,7 @@
 
 #include "VehicleObjectPool.h"
 
-#include <android/log.h>
+#include <log/log.h>
 
 #include "VehicleUtils.h"
 
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
index ab1d908..5a00631 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
@@ -18,7 +18,7 @@
 
 #include "VehicleUtils.h"
 
-#include <android/log.h>
+#include <log/log.h>
 
 namespace android {
 namespace hardware {
diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal
index d98a982..a9b706d 100644
--- a/vehicle/2.0/types.hal
+++ b/vehicle/2.0/types.hal
@@ -332,7 +332,6 @@
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
-     * @data_enum TODO
      * @allow_out_of_range_value : OFF
      */
     HVAC_FAN_SPEED = (
@@ -346,7 +345,7 @@
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
-     * @data_enum TODO
+     * @data_enum VehicleHvacFanDirection
      * @allow_out_of_range_value : OFF
      */
     HVAC_FAN_DIRECTION = (
@@ -721,6 +720,23 @@
         | VehicleArea:GLOBAL),
 
     /*
+     * A property to allow external component to control audio focus. Depending on
+     * H/W architecture, audio HAL may need to control audio focus while vehicle
+     * HAL is still interacting with upper layer. In such case, audio HAL may set
+     * this property and vehicle HAL may use this property value to decide
+     * response sent through AUDIO_FOCUS property.
+     * Data format is the same as AUDIO_FOCUS property.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ_WRITE
+     */
+    AUDIO_FOCUS_EXT_SYNC = (
+        0x0910
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:INT32_VEC
+        | VehicleArea:GLOBAL),
+
+    /*
      * Property to control audio volume of each audio context.
      *
      * VehiclePropConfig
@@ -758,6 +774,22 @@
         | VehicleArea:GLOBAL),
 
     /*
+     * Property to allow audio volume sync from external components like audio HAL.
+     * Some vehicle HAL implementation may get volume control from audio HAL and in such
+     * case, setting AUDIO_VOLUME_EXT_SYNC property may trigger event in AUDIO_VOLUME property.
+     * Data format for this property is the same as AUDIO_VOLUME property.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ_WRITE
+     * @config_flags all audio contexts supported.
+     */
+    AUDIO_VOLUME_EXT_SYNC = (
+        0x0911
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:INT32_VEC
+        | VehicleArea:GLOBAL),
+
+    /*
      * Property for handling volume limit set by user. This limits maximum
      * volume that can be set per each context or physical stream.
      *
@@ -891,6 +923,53 @@
         | VehiclePropertyType:INT32_VEC
         | VehicleArea:GLOBAL),
 
+    /**
+     * Represents state of audio stream. Audio HAL should set this when a stream is starting or
+     * ending. Car service can request focus for audio played without focus. If such feature
+     * is not required, this property does not need to be implemented.
+     * Car service only monitors setting of this property. It is up to each vehicle HAL
+     * implementation to add necessary action but default implementation will be doing nothing on
+     * this propery's set from audio HAL.
+     * Actual streaming of data should be done only after getting focus for the given stream from
+     * car audio module. Focus can be already granted when stream is started. Focus state can be
+     * monitored by monitoring AUDIO_FOCUS property. If car does not support
+     * AUDIO_FOCUS property, there is no need to monitor focus as focus is assumed to be
+     * granted always.
+     * Data has the following format:
+     *   int32_array[0] : vehicle_audio_stream_state, 0: stopped, 1: started
+     *   int32_array[1] : stream number like 0, 1, 2, ...
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ_WRITE
+     */
+    AUDIO_STREAM_STATE  = (
+        0x0906
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:INT32_VEC
+        | VehicleArea:GLOBAL),
+
+    /**
+     * Property to control car specific audio parameters. Each parameter is defined as string key-
+     * value pair.
+     * set and event notification can pass multiple parameters using the
+     * following format:
+     *   key1=value1;key2=value2;...
+     * get call can request multiple parameters using the following format:
+     *   key1;key2;...
+     * Response for get call has the same format as set.
+     *
+     * VehiclePropConfig
+     *   configString: give list of all supported keys with ; as separator. For example:
+     *     key1;key2;...
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ_WRITE
+    AUDIO_PARAMETERS = (
+        0x907
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:STRING
+        | VehicleArea:GLOBAL),
+
     /*
      * Index in int32Values for AP_POWER_STATE property.
      */
@@ -1644,6 +1723,59 @@
         | VehiclePropertyGroup:SYSTEM
         | VehiclePropertyType:COMPLEX
         | VehicleArea:GLOBAL),
+
+    /*
+     * OBD2 Live Sensor Data
+     *
+     * This property uses COMPLEX data to send a snapshot of the current (live)
+     * values of the OBD2 sensors provided by the vehicle.
+     *
+     * Its contents are to be interpreted as follows:
+     * the indices defined in Obd2IntegerSensorIndex are to be used to
+     * read from int32Values;
+     * the indices defined in Obd2FloatSensorIndex are to be used to
+     * read from floatValues.
+     *
+     * For example, int32Values[0] corresponds to FUEL_SYSTEM_STATUS, and
+     * floatValues[0] corresponds to CALCULATED_ENGINE_LOAD.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ
+     */
+    OBD2_LIVE_FRAME = (
+        0x0D00
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
+
+    /*
+     * OBD2 Freeze Frame Sensor Data
+     *
+     * This property uses COMPLEX data to send a snapshot of the values of the
+     * OBD2 sensors provided by the vehicle at the time that a diagnostic
+     * troubleshooting code (DTC) was recorded by the vehicle.
+     *
+     * Its contents are to be interpreted as follows:
+     * the indices defined in Obd2IntegerSensorIndex are to be used to
+     * read from int32Values;
+     * the indices defined in Obd2FloatSensorIndex are to be used to
+     * read from floatValues;
+     * stringValue is the DTC that caused this freeze frame to be recorded.
+     *
+     * For example, int32Values[0] corresponds to FUEL_SYSTEM_STATUS, and
+     * floatValues[0] corresponds to CALCULATED_ENGINE_LOAD, and a possible
+     * valid stringValue is "P0176" to indicate a malfunction of the fuel
+     * composition sensor circuit.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ
+     */
+    OBD2_FREEZE_FRAME = (
+        0x0D01
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
+
 };
 
 /*
@@ -2693,7 +2825,7 @@
    * tests are available and whether they are complete. The semantics of the individual
    * bits in this value are given by, respectively, SparkIgnitionMonitors and
    * CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED.
-  /*
+   */
   IGNITION_SPECIFIC_MONITORS = 3,
 
   INTAKE_AIR_TEMPERATURE = 4,
diff --git a/vehicle/2.0/vts/Android.mk b/vehicle/2.0/vts/Android.mk
index df5dac8..31fa999 100644
--- a/vehicle/2.0/vts/Android.mk
+++ b/vehicle/2.0/vts/Android.mk
@@ -16,4 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
\ No newline at end of file
+include $(LOCAL_PATH)/functional/vts/testcases/hal/vehicle/hidl/Android.mk
\ No newline at end of file
diff --git a/vehicle/2.0/vts/functional/Android.mk b/vehicle/2.0/vts/functional/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vehicle/2.0/vts/functional/vts/Android.mk b/vehicle/2.0/vts/functional/vts/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vehicle/2.0/vts/functional/vts/testcases/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
index 8da36d1..5faf78a 100644
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
@@ -35,34 +35,94 @@
         self.dut.shell.InvokeTerminal("one")
         self.dut.shell.one.Execute("setenforce 0")  # SELinux permissive mode
 
-        if self.enable_profiling:
-            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
         self.dut.hal.InitHidlHal(
             target_type="vehicle",
-            target_basepaths=["/system/lib64"],
+            target_basepaths=self.dut.libPaths,
             target_version=2.0,
             target_package="android.hardware.vehicle",
             target_component_name="IVehicle",
-            bits=64)
+            hw_binder_service_name="Vehicle",
+            bits=64 if self.dut.is64Bit else 32)
+
+        self.vehicle = self.dut.hal.vehicle  # shortcut
+        self.vtypes = self.dut.hal.vehicle.GetHidlTypeInterface("types")
+        logging.info("vehicle types: %s", self.vtypes)
 
     def tearDownClass(self):
-        """ If profiling is enabled for the test, collect the profiling data
-            and disable profiling after the test is done.
+        """Disables the profiling.
+
+        If profiling is enabled for the test, collect the profiling data
+        and disable profiling after the test is done.
         """
         if self.enable_profiling:
+            self.ProcessAndUploadTraceData()
+
+    def setUpTest(self):
+        if self.enable_profiling:
+            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+    def tearDownTest(self):
+        if self.enable_profiling:
             profiling_trace_path = getattr(
                 self, self.VTS_PROFILING_TRACING_PATH, "")
-            self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+            self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
             profiling_utils.DisableVTSProfiling(self.dut.shell.one)
 
     def testListProperties(self):
-        logging.info("vehicle_types")
-        vehicle_types = self.dut.hal.vehicle.GetHidlTypeInterface("types")
-        logging.info("vehicle_types: %s", vehicle_types)
+        """Checks whether some PropConfigs are returned.
 
-        allConfigs = self.dut.hal.vehicle.getAllPropConfigs()
+        Verifies that call to getAllPropConfigs is not failing and
+        it returns at least 1 vehicle property config.
+        """
+        allConfigs = self.vehicle.getAllPropConfigs()
         logging.info("all supported properties: %s", allConfigs)
+        asserts.assertLess(0, len(allConfigs))
+
+    def testMandatoryProperties(self):
+        """Verifies that all mandatory properties are supported."""
+        mandatoryProps = set([self.vtypes.DRIVING_STATUS])  # 1 property so far
+        logging.info(self.vtypes.DRIVING_STATUS)
+        allConfigs = self.dut.hal.vehicle.getAllPropConfigs()
+
+        for config in allConfigs:
+            mandatoryProps.discard(config['prop'])
+
+        asserts.assertEqual(0, len(mandatoryProps))
+
+    def getSupportInfo(self):
+        """Check whether OBD2_{LIVE|FREEZE}_FRAME is supported."""
+        isLiveSupported, isFreezeSupported = False, False
+        allConfigs = self.vehicle.getAllPropConfigs()
+        for config in allConfigs:
+            if config['prop'] == self.vtypes.OBD2_LIVE_FRAME:
+                isLiveSupported = True
+            elif config['prop'] == self.vtypes.OBD2_FREEZE_FRAME:
+                isFreezeSupported = True
+            if isLiveSupported and isFreezeSupported:
+                break
+        return isLiveSupported, isFreezeSupported
+
+    def testObd2SensorProperties(self):
+        """Test reading the live and freeze OBD2 frame properties.
+
+        OBD2 (On-Board Diagnostics 2) is the industry standard protocol
+        for retrieving diagnostic sensor information from vehicles.
+        """
+        def checkLiveFrameRead():
+            """Validates reading the OBD2_LIVE_FRAME (if available)."""
+            logging.info("checkLiveFrameRead no-op pass")
+
+        def checkFreezeFrameRead():
+            """Validates reading the OBD2_FREEZE_FRAME (if available)."""
+            logging.info("checkLiveFrameRead no-op pass")
+
+        isLiveSupported, isFreezeSupported = self.getSupportInfo()
+        logging.info("isLiveSupported = %s, isFreezeSupported = %s",
+                     isLiveSupported, isFreezeSupported)
+        if isLiveSupported:
+            checkLiveFrameRead()
+        if isFreezeSupported:
+            checkFreezeFrameRead()
 
 if __name__ == "__main__":
     test_runner.main()
diff --git a/vehicle/2.0/vts/types.vts b/vehicle/2.0/vts/types.vts
index 99fa6e7..fa7d892 100644
--- a/vehicle/2.0/vts/types.vts
+++ b/vehicle/2.0/vts/types.vts
@@ -43,6 +43,10 @@
         scalar_value: {
             int32_t: 7340032
         }
+        enumerator: "COMPLEX"
+        scalar_value: {
+            int32_t: 14680064
+        }
         enumerator: "MASK"
         scalar_value: {
             int32_t: 16711680
@@ -186,6 +190,10 @@
         scalar_value: {
             int32_t: 289408008
         }
+        enumerator: "IGNITION_STATE"
+        scalar_value: {
+            int32_t: 289408009
+        }
         enumerator: "HVAC_FAN_SPEED"
         scalar_value: {
             int32_t: 306185472
@@ -486,6 +494,18 @@
         scalar_value: {
             int32_t: 287312836
         }
+        enumerator: "VEHICLE_MAPS_DATA_SERVICE"
+        scalar_value: {
+            int32_t: 299895808
+        }
+        enumerator: "OBD2_LIVE_FRAME"
+        scalar_value: {
+            int32_t: 299896064
+        }
+        enumerator: "OBD2_FREEZE_FRAME"
+        scalar_value: {
+            int32_t: 299896065
+        }
     }
 }
 
@@ -1686,6 +1706,39 @@
 }
 
 attribute: {
+    name: "::android::hardware::vehicle::V2_0::VehicleIgnitionState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UNDEFINED"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "LOCK"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "OFF"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ACC"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ON"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "START"
+        scalar_value: {
+            int32_t: 5
+        }
+    }
+}
+
+attribute: {
     name: "::android::hardware::vehicle::V2_0::VehiclePropertyOperation"
     type: TYPE_ENUM
     enum_value: {
@@ -1793,3 +1846,828 @@
     }
 }
 
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::FuelSystemStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "OPEN_INSUFFICIENT_ENGINE_TEMPERATURE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "CLOSED_LOOP"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "OPEN_ENGINE_LOAD_OR_DECELERATION"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "OPEN_SYSTEM_FAILURE"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "CLOSED_LOOP_BUT_FEEDBACK_FAULT"
+        scalar_value: {
+            int32_t: 16
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::IgnitionMonitorKind"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SPARK"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "COMPRESSION"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::CommonIgnitionMonitors"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "COMPONENTS_AVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "COMPONENTS_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FUEL_SYSTEM_AVAILABLE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "FUEL_SYSTEM_INCOMPLETE"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "MISFIRE_AVAILABLE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "MISFIRE_INCOMPLETE"
+        scalar_value: {
+            int32_t: 32
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::SparkIgnitionMonitors"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "COMPONENTS_AVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "COMPONENTS_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FUEL_SYSTEM_AVAILABLE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "FUEL_SYSTEM_INCOMPLETE"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "MISFIRE_AVAILABLE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "MISFIRE_INCOMPLETE"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "EGR_AVAILABLE"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "EGR_INCOMPLETE"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "OXYGEN_SENSOR_HEATER_AVAILABLE"
+        scalar_value: {
+            int32_t: 256
+        }
+        enumerator: "OXYGEN_SENSOR_HEATER_INCOMPLETE"
+        scalar_value: {
+            int32_t: 512
+        }
+        enumerator: "OXYGEN_SENSOR_AVAILABLE"
+        scalar_value: {
+            int32_t: 1024
+        }
+        enumerator: "OXYGEN_SENSOR_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2048
+        }
+        enumerator: "AC_REFRIGERANT_AVAILABLE"
+        scalar_value: {
+            int32_t: 4096
+        }
+        enumerator: "AC_REFRIGERANT_INCOMPLETE"
+        scalar_value: {
+            int32_t: 8192
+        }
+        enumerator: "SECONDARY_AIR_SYSTEM_AVAILABLE"
+        scalar_value: {
+            int32_t: 16384
+        }
+        enumerator: "SECONDARY_AIR_SYSTEM_INCOMPLETE"
+        scalar_value: {
+            int32_t: 32768
+        }
+        enumerator: "EVAPORATIVE_SYSTEM_AVAILABLE"
+        scalar_value: {
+            int32_t: 65536
+        }
+        enumerator: "EVAPORATIVE_SYSTEM_INCOMPLETE"
+        scalar_value: {
+            int32_t: 131072
+        }
+        enumerator: "HEATED_CATALYST_AVAILABLE"
+        scalar_value: {
+            int32_t: 262144
+        }
+        enumerator: "HEATED_CATALYST_INCOMPLETE"
+        scalar_value: {
+            int32_t: 524288
+        }
+        enumerator: "CATALYST_AVAILABLE"
+        scalar_value: {
+            int32_t: 1048576
+        }
+        enumerator: "CATALYST_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2097152
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::CompressionIgnitionMonitors"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "COMPONENTS_AVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "COMPONENTS_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FUEL_SYSTEM_AVAILABLE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "FUEL_SYSTEM_INCOMPLETE"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "MISFIRE_AVAILABLE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "MISFIRE_INCOMPLETE"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "EGR_OR_VVT_AVAILABLE"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "EGR_OR_VVT_INCOMPLETE"
+        scalar_value: {
+            int32_t: 128
+        }
+        enumerator: "PM_FILTER_AVAILABLE"
+        scalar_value: {
+            int32_t: 256
+        }
+        enumerator: "PM_FILTER_INCOMPLETE"
+        scalar_value: {
+            int32_t: 512
+        }
+        enumerator: "EXHAUST_GAS_SENSOR_AVAILABLE"
+        scalar_value: {
+            int32_t: 1024
+        }
+        enumerator: "EXHAUST_GAS_SENSOR_INCOMPLETE"
+        scalar_value: {
+            int32_t: 2048
+        }
+        enumerator: "BOOST_PRESSURE_AVAILABLE"
+        scalar_value: {
+            int32_t: 4096
+        }
+        enumerator: "BOOST_PRESSURE_INCOMPLETE"
+        scalar_value: {
+            int32_t: 8192
+        }
+        enumerator: "NOx_SCR__AVAILABLE"
+        scalar_value: {
+            int32_t: 16384
+        }
+        enumerator: "NOx_SCR_INCOMPLETE"
+        scalar_value: {
+            int32_t: 32768
+        }
+        enumerator: "NMHC_CATALYST_AVAILABLE"
+        scalar_value: {
+            int32_t: 65536
+        }
+        enumerator: "NMHC_CATALYST_INCOMPLETE"
+        scalar_value: {
+            int32_t: 131072
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::SecondaryAirStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "UPSTREAM"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "DOWNSTREAM_OF_CATALYCIC_CONVERTER"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "FROM_OUTSIDE_OR_OFF"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "PUMP_ON_FOR_DIAGNOSTICS"
+        scalar_value: {
+            int32_t: 8
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::FuelType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "NOT_AVAILABLE"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "GASOLINE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "METHANOL"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ETHANOL"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "DIESEL"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "LPG"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "CNG"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "PROPANE"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "ELECTRIC"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "BIFUEL_RUNNING_GASOLINE"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "BIFUEL_RUNNING_METHANOL"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "BIFUEL_RUNNING_ETHANOL"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "BIFUEL_RUNNING_LPG"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "BIFUEL_RUNNING_CNG"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "BIFUEL_RUNNING_PROPANE"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "BIFUEL_RUNNING_ELECTRIC"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "HYBRID_GASOLINE"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "HYBRID_ETHANOL"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "HYBRID_DIESEL"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "HYBRID_ELECTRIC"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "HYBRID_REGENERATIVE"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "BIFUEL_RUNNING_DIESEL"
+        scalar_value: {
+            int32_t: 23
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::Obd2IntegerSensorIndex"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "FUEL_SYSTEM_STATUS"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "MALFUNCTION_INDICATOR_LIGHT_ON"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "IGNITION_MONITORS_SUPPORTED"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "COMMANDED_SECONDARY_AIR_STATUS"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "NUM_OXYGEN_SENSORS_PRESENT"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "RUNTIME_SINCE_ENGINE_START"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "WARMUPS_SINCE_CODES_CLEARED"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "DISTANCE_TRAVELED_SINCE_CODES_CLEARED"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "ABSOLUTE_BAROMETRIC_PRESSURE"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "CONTROL_MODULE_VOLTAGE"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "AMBIENT_AIR_TEMPERATURE"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "TIME_WITH_MALFUNCTION_LIGHT_ON"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "TIME_SINCE_TROUBLE_CODES_CLEARED"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "MAX_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "MAX_OXYGEN_SENSOR_VOLTAGE"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "MAX_OXYGEN_SENSOR_CURRENT"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "FUEL_TYPE"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "FUEL_RAIL_ABSOLUTE_PRESSURE"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "ENGINE_OIL_TEMPERATURE"
+        scalar_value: {
+            int32_t: 23
+        }
+        enumerator: "DRIVER_DEMAND_PERCENT_TORQUE"
+        scalar_value: {
+            int32_t: 24
+        }
+        enumerator: "ENGINE_ACTUAL_PERCENT_TORQUE"
+        scalar_value: {
+            int32_t: 25
+        }
+        enumerator: "ENGINE_REFERENCE_PERCENT_TORQUE"
+        scalar_value: {
+            int32_t: 26
+        }
+        enumerator: "ENGINE_PERCENT_TORQUE_DATA_IDLE"
+        scalar_value: {
+            int32_t: 27
+        }
+        enumerator: "ENGINE_PERCENT_TORQUE_DATA_POINT1"
+        scalar_value: {
+            int32_t: 28
+        }
+        enumerator: "ENGINE_PERCENT_TORQUE_DATA_POINT2"
+        scalar_value: {
+            int32_t: 29
+        }
+        enumerator: "ENGINE_PERCENT_TORQUE_DATA_POINT3"
+        scalar_value: {
+            int32_t: 30
+        }
+        enumerator: "ENGINE_PERCENT_TORQUE_DATA_POINT4"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "LAST_SYSTEM_INDEX"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "VENDOR_START_INDEX"
+        scalar_value: {
+            int32_t: 32
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::vehicle::V2_0::Obd2FloatSensorIndex"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "CALCULATED_ENGINE_LOAD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ENGINE_COOLANT_TEMPERATURE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SHORT_TERM_FUEL_TRIM_BANK1"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "LONG_TERM_FUEL_TRIM_BANK1"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "SHORT_TERM_FUEL_TRIM_BANK2"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "LONG_TERM_FUEL_TRIM_BANK2"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "FUEL_PRESSURE"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "INTAKE_MANIFOLD_ABSOLUTE_PRESSURE"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "ENGINE_RPM"
+        scalar_value: {
+            int32_t: 8
+        }
+        enumerator: "VEHICLE_SPEED"
+        scalar_value: {
+            int32_t: 9
+        }
+        enumerator: "TIMING_ADVANCE"
+        scalar_value: {
+            int32_t: 10
+        }
+        enumerator: "MAF_AIR_FLOW_RATE"
+        scalar_value: {
+            int32_t: 11
+        }
+        enumerator: "THROTTLE_POSITION"
+        scalar_value: {
+            int32_t: 12
+        }
+        enumerator: "OXYGEN_SENSOR1_VOLTAGE"
+        scalar_value: {
+            int32_t: 13
+        }
+        enumerator: "OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 14
+        }
+        enumerator: "OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 15
+        }
+        enumerator: "OXYGEN_SENSOR2_VOLTAGE"
+        scalar_value: {
+            int32_t: 16
+        }
+        enumerator: "OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 17
+        }
+        enumerator: "OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 18
+        }
+        enumerator: "OXYGEN_SENSOR3_VOLTAGE"
+        scalar_value: {
+            int32_t: 19
+        }
+        enumerator: "OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 20
+        }
+        enumerator: "OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 21
+        }
+        enumerator: "OXYGEN_SENSOR4_VOLTAGE"
+        scalar_value: {
+            int32_t: 22
+        }
+        enumerator: "OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 23
+        }
+        enumerator: "OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 24
+        }
+        enumerator: "OXYGEN_SENSOR5_VOLTAGE"
+        scalar_value: {
+            int32_t: 25
+        }
+        enumerator: "OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 26
+        }
+        enumerator: "OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 27
+        }
+        enumerator: "OXYGEN_SENSOR6_VOLTAGE"
+        scalar_value: {
+            int32_t: 28
+        }
+        enumerator: "OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 29
+        }
+        enumerator: "OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 30
+        }
+        enumerator: "OXYGEN_SENSOR7_VOLTAGE"
+        scalar_value: {
+            int32_t: 31
+        }
+        enumerator: "OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 32
+        }
+        enumerator: "OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 33
+        }
+        enumerator: "OXYGEN_SENSOR8_VOLTAGE"
+        scalar_value: {
+            int32_t: 34
+        }
+        enumerator: "OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM"
+        scalar_value: {
+            int32_t: 35
+        }
+        enumerator: "OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 36
+        }
+        enumerator: "FUEL_RAIL_PRESSURE"
+        scalar_value: {
+            int32_t: 37
+        }
+        enumerator: "FUEL_RAIL_GAUGE_PRESSURE"
+        scalar_value: {
+            int32_t: 38
+        }
+        enumerator: "COMMANDED_EXHAUST_GAS_RECIRCULATION"
+        scalar_value: {
+            int32_t: 39
+        }
+        enumerator: "EXHAUST_GAS_RECIRCULATION_ERROR"
+        scalar_value: {
+            int32_t: 40
+        }
+        enumerator: "COMMANDED_EVAPORATIVE_PURGE"
+        scalar_value: {
+            int32_t: 41
+        }
+        enumerator: "FUEL_TANK_LEVEL_INPUT"
+        scalar_value: {
+            int32_t: 42
+        }
+        enumerator: "EVAPORATION_SYSTEM_VAPOR_PRESSURE"
+        scalar_value: {
+            int32_t: 43
+        }
+        enumerator: "CATALYST_TEMPERATURE_BANK1_SENSOR1"
+        scalar_value: {
+            int32_t: 44
+        }
+        enumerator: "CATALYST_TEMPERATURE_BANK2_SENSOR1"
+        scalar_value: {
+            int32_t: 45
+        }
+        enumerator: "CATALYST_TEMPERATURE_BANK1_SENSOR2"
+        scalar_value: {
+            int32_t: 46
+        }
+        enumerator: "CATALYST_TEMPERATURE_BANK2_SENSOR2"
+        scalar_value: {
+            int32_t: 47
+        }
+        enumerator: "ABSOLUTE_LOAD_VALUE"
+        scalar_value: {
+            int32_t: 48
+        }
+        enumerator: "FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO"
+        scalar_value: {
+            int32_t: 49
+        }
+        enumerator: "RELATIVE_THROTTLE_POSITION"
+        scalar_value: {
+            int32_t: 50
+        }
+        enumerator: "ABSOLUTE_THROTTLE_POSITION_B"
+        scalar_value: {
+            int32_t: 51
+        }
+        enumerator: "ABSOLUTE_THROTTLE_POSITION_C"
+        scalar_value: {
+            int32_t: 52
+        }
+        enumerator: "ACCELERATOR_PEDAL_POSITION_D"
+        scalar_value: {
+            int32_t: 53
+        }
+        enumerator: "ACCELERATOR_PEDAL_POSITION_E"
+        scalar_value: {
+            int32_t: 54
+        }
+        enumerator: "ACCELERATOR_PEDAL_POSITION_F"
+        scalar_value: {
+            int32_t: 55
+        }
+        enumerator: "COMMANDED_THROTTLE_ACTUATOR"
+        scalar_value: {
+            int32_t: 56
+        }
+        enumerator: "ETHANOL_FUEL_PERCENTAGE"
+        scalar_value: {
+            int32_t: 57
+        }
+        enumerator: "ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE"
+        scalar_value: {
+            int32_t: 58
+        }
+        enumerator: "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1"
+        scalar_value: {
+            int32_t: 59
+        }
+        enumerator: "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2"
+        scalar_value: {
+            int32_t: 60
+        }
+        enumerator: "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3"
+        scalar_value: {
+            int32_t: 61
+        }
+        enumerator: "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4"
+        scalar_value: {
+            int32_t: 62
+        }
+        enumerator: "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1"
+        scalar_value: {
+            int32_t: 63
+        }
+        enumerator: "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2"
+        scalar_value: {
+            int32_t: 64
+        }
+        enumerator: "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3"
+        scalar_value: {
+            int32_t: 65
+        }
+        enumerator: "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4"
+        scalar_value: {
+            int32_t: 66
+        }
+        enumerator: "RELATIVE_ACCELERATOR_PEDAL_POSITION"
+        scalar_value: {
+            int32_t: 67
+        }
+        enumerator: "HYBRID_BATTERY_PACK_REMAINING_LIFE"
+        scalar_value: {
+            int32_t: 68
+        }
+        enumerator: "FUEL_INJECTION_TIMING"
+        scalar_value: {
+            int32_t: 69
+        }
+        enumerator: "ENGINE_FUEL_RATE"
+        scalar_value: {
+            int32_t: 70
+        }
+        enumerator: "LAST_SYSTEM_INDEX"
+        scalar_value: {
+            int32_t: 70
+        }
+        enumerator: "VENDOR_START_INDEX"
+        scalar_value: {
+            int32_t: 71
+        }
+    }
+}
+
diff --git a/vehicle/Android.mk b/vehicle/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index cea74bb..497274b 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -26,8 +26,8 @@
         "android/hardware/vibrator/1.0/types.h",
         "android/hardware/vibrator/1.0/IVibrator.h",
         "android/hardware/vibrator/1.0/IHwVibrator.h",
-        "android/hardware/vibrator/1.0/BnVibrator.h",
-        "android/hardware/vibrator/1.0/BpVibrator.h",
+        "android/hardware/vibrator/1.0/BnHwVibrator.h",
+        "android/hardware/vibrator/1.0/BpHwVibrator.h",
         "android/hardware/vibrator/1.0/BsVibrator.h",
     ],
 }
diff --git a/vibrator/1.0/default/Vibrator.cpp b/vibrator/1.0/default/Vibrator.cpp
index ee3a458..e86e681 100644
--- a/vibrator/1.0/default/Vibrator.cpp
+++ b/vibrator/1.0/default/Vibrator.cpp
@@ -15,9 +15,12 @@
  */
 
 #define LOG_TAG "VibratorService"
+
+#include <log/log.h>
+
 #include <hardware/hardware.h>
 #include <hardware/vibrator.h>
-#include <android/log.h>
+
 #include "Vibrator.h"
 
 namespace android {
diff --git a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
index b36f47a..498ea06 100644
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
+++ b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
@@ -39,26 +39,31 @@
         self.dut.shell.one.Execute(
             "setprop vts.hal.vts.hidl.get_stub true")
 
-        if self.enable_profiling:
-            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
         self.dut.hal.InitHidlHal(
             target_type="vibrator",
-            target_basepaths=["/system/lib64"],
+            target_basepaths=self.dut.libPaths,
             target_version=1.0,
             target_package="android.hardware.vibrator",
             target_component_name="IVibrator",
             hw_binder_service_name="vibrator",
-            bits=64)
+            bits=64 if self.dut.is64Bit else 32)
 
     def tearDownClass(self):
         """ If profiling is enabled for the test, collect the profiling data
             and disable profiling after the test is done.
         """
         if self.enable_profiling:
+            self.ProcessAndUploadTraceData()
+
+    def setUpTest(self):
+        if self.enable_profiling:
+            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+    def tearDownTest(self):
+        if self.enable_profiling:
             profiling_trace_path = getattr(
                 self, self.VTS_PROFILING_TRACING_PATH, "")
-            self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+            self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
             profiling_utils.DisableVTSProfiling(self.dut.shell.one)
 
     def testVibratorBasic(self):
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index 3397bff..f175610 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -22,8 +22,8 @@
     out: [
         "android/hardware/vr/1.0/IVr.h",
         "android/hardware/vr/1.0/IHwVr.h",
-        "android/hardware/vr/1.0/BnVr.h",
-        "android/hardware/vr/1.0/BpVr.h",
+        "android/hardware/vr/1.0/BnHwVr.h",
+        "android/hardware/vr/1.0/BpHwVr.h",
         "android/hardware/vr/1.0/BsVr.h",
     ],
 }
diff --git a/vr/1.0/default/Vr.cpp b/vr/1.0/default/Vr.cpp
index 2b2372b..a0de998 100644
--- a/vr/1.0/default/Vr.cpp
+++ b/vr/1.0/default/Vr.cpp
@@ -16,9 +16,11 @@
 
 #define LOG_TAG "VrService"
 
+#include <log/log.h>
+
 #include <hardware/hardware.h>
 #include <hardware/vr.h>
-#include <android/log.h>
+
 #include "Vr.h"
 
 namespace android {
diff --git a/vr/1.0/vts/functional/Android.bp b/vr/1.0/vts/functional/Android.bp
index 2929fe7..551f27c 100644
--- a/vr/1.0/vts/functional/Android.bp
+++ b/vr/1.0/vts/functional/Android.bp
@@ -26,7 +26,11 @@
     ],
     static_libs: ["libgtest"],
     cflags: [
-        "-O0",
+       "--coverage",
+       "-O0",
         "-g",
     ],
+    ldflags: [
+        "--coverage"
+    ]
 }
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
index 9ed378f..d20e9ce 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
@@ -39,15 +39,13 @@
         self.dut.shell.one.Execute(
             "setprop vts.hal.vts.hidl.get_stub true")
 
-        if self.enable_profiling:
-            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
         self.dut.hal.InitHidlHal(
             target_type="vr",
             target_basepaths=["/system/lib64"],
             target_version=1.0,
             target_package="android.hardware.vr",
             target_component_name="IVr",
+            hw_binder_service_name=None,
             bits=64)
 
     def tearDownClass(self):
@@ -55,9 +53,17 @@
             and disable profiling after the test is done.
         """
         if self.enable_profiling:
+            self.ProcessAndUploadTraceData()
+
+    def setUpTest(self):
+        if self.enable_profiling:
+            profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+    def tearDownTest(self):
+        if self.enable_profiling:
             profiling_trace_path = getattr(
                 self, self.VTS_PROFILING_TRACING_PATH, "")
-            self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+            self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
             profiling_utils.DisableVTSProfiling(self.dut.shell.one)
 
     def testVrBasic(self):
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
index a29c23b..aa5a48f 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
@@ -24,8 +24,10 @@
             _32bit::DATA/nativetest/vr_hidl_hal_test/vr_hidl_hal_test,
             _64bit::DATA/nativetest64/vr_hidl_hal_test/vr_hidl_hal_test,
             "/>
-        <option name="binary-test-type" value="gtest" />
+        <option name="binary-test-type" value="hal_hidl_gtest" />
+        <option name="hwbinder-service" value="android.hardware.vr" />
         <option name="test-timeout" value="1m" />
-    </test>
+        <option name="test-config-path" value="vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config" />
+</test>
 </configuration>
 
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config
similarity index 69%
rename from thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config
rename to vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config
index 0d19619..ec01b5f 100644
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config
@@ -2,21 +2,21 @@
     "use_gae_db": true,
     "coverage": true,
     "modules": [{
-                    "module_name": "system/lib64/hw/thermal.bullhead",
-                    "git_project": {
-                        "name": "device/lge/bullhead",
-                        "path": "device/lge/bullhead"
-                    }
-                },
-                {
-                    "module_name": "system/lib64/hw/thermal.marlin",
+                    "module_name": "system/lib64/hw/vr.marlin",
                     "git_project": {
                         "name": "device/google/marlin",
                         "path": "device/google/marlin"
                     }
                 },
                 {
-                    "module_name": "system/lib64/hw/android.hardware.thermal@1.0-impl",
+                    "module_name": "system/lib64/hw/vr.sailfish",
+                    "git_project": {
+                        "name": "device/google/marlin",
+                        "path": "device/google/marlin"
+                    }
+                },
+                {
+                    "module_name": "system/lib64/hw/android.hardware.vr@1.0-impl",
                     "git_project": {
                         "name": "platform/hardware/interfaces",
                         "path": "hardware/interfaces"
diff --git a/boot/Android.mk b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/Android.mk
similarity index 77%
copy from boot/Android.mk
copy to vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/Android.mk
index f9e3276..6f60af3 100644
--- a/boot/Android.mk
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/Android.mk
@@ -16,4 +16,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-include $(call all-subdir-makefiles)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := VrHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/vr/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/AndroidTest.xml b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..3bc711a
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS VR HIDL HAL's target-side, profiling test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="VrHidlTargetTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/vr_hidl_hal_test/vr_hidl_hal_test,
+            _64bit::DATA/nativetest64/vr_hidl_hal_test/vr_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+        <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
+
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index f031183..049d5d7 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -62,68 +62,68 @@
         "android/hardware/wifi/1.0/types.h",
         "android/hardware/wifi/1.0/IWifi.h",
         "android/hardware/wifi/1.0/IHwWifi.h",
-        "android/hardware/wifi/1.0/BnWifi.h",
-        "android/hardware/wifi/1.0/BpWifi.h",
+        "android/hardware/wifi/1.0/BnHwWifi.h",
+        "android/hardware/wifi/1.0/BpHwWifi.h",
         "android/hardware/wifi/1.0/BsWifi.h",
         "android/hardware/wifi/1.0/IWifiApIface.h",
         "android/hardware/wifi/1.0/IHwWifiApIface.h",
-        "android/hardware/wifi/1.0/BnWifiApIface.h",
-        "android/hardware/wifi/1.0/BpWifiApIface.h",
+        "android/hardware/wifi/1.0/BnHwWifiApIface.h",
+        "android/hardware/wifi/1.0/BpHwWifiApIface.h",
         "android/hardware/wifi/1.0/BsWifiApIface.h",
         "android/hardware/wifi/1.0/IWifiChip.h",
         "android/hardware/wifi/1.0/IHwWifiChip.h",
-        "android/hardware/wifi/1.0/BnWifiChip.h",
-        "android/hardware/wifi/1.0/BpWifiChip.h",
+        "android/hardware/wifi/1.0/BnHwWifiChip.h",
+        "android/hardware/wifi/1.0/BpHwWifiChip.h",
         "android/hardware/wifi/1.0/BsWifiChip.h",
         "android/hardware/wifi/1.0/IWifiChipEventCallback.h",
         "android/hardware/wifi/1.0/IHwWifiChipEventCallback.h",
-        "android/hardware/wifi/1.0/BnWifiChipEventCallback.h",
-        "android/hardware/wifi/1.0/BpWifiChipEventCallback.h",
+        "android/hardware/wifi/1.0/BnHwWifiChipEventCallback.h",
+        "android/hardware/wifi/1.0/BpHwWifiChipEventCallback.h",
         "android/hardware/wifi/1.0/BsWifiChipEventCallback.h",
         "android/hardware/wifi/1.0/IWifiEventCallback.h",
         "android/hardware/wifi/1.0/IHwWifiEventCallback.h",
-        "android/hardware/wifi/1.0/BnWifiEventCallback.h",
-        "android/hardware/wifi/1.0/BpWifiEventCallback.h",
+        "android/hardware/wifi/1.0/BnHwWifiEventCallback.h",
+        "android/hardware/wifi/1.0/BpHwWifiEventCallback.h",
         "android/hardware/wifi/1.0/BsWifiEventCallback.h",
         "android/hardware/wifi/1.0/IWifiIface.h",
         "android/hardware/wifi/1.0/IHwWifiIface.h",
-        "android/hardware/wifi/1.0/BnWifiIface.h",
-        "android/hardware/wifi/1.0/BpWifiIface.h",
+        "android/hardware/wifi/1.0/BnHwWifiIface.h",
+        "android/hardware/wifi/1.0/BpHwWifiIface.h",
         "android/hardware/wifi/1.0/BsWifiIface.h",
         "android/hardware/wifi/1.0/IWifiNanIface.h",
         "android/hardware/wifi/1.0/IHwWifiNanIface.h",
-        "android/hardware/wifi/1.0/BnWifiNanIface.h",
-        "android/hardware/wifi/1.0/BpWifiNanIface.h",
+        "android/hardware/wifi/1.0/BnHwWifiNanIface.h",
+        "android/hardware/wifi/1.0/BpHwWifiNanIface.h",
         "android/hardware/wifi/1.0/BsWifiNanIface.h",
         "android/hardware/wifi/1.0/IWifiNanIfaceEventCallback.h",
         "android/hardware/wifi/1.0/IHwWifiNanIfaceEventCallback.h",
-        "android/hardware/wifi/1.0/BnWifiNanIfaceEventCallback.h",
-        "android/hardware/wifi/1.0/BpWifiNanIfaceEventCallback.h",
+        "android/hardware/wifi/1.0/BnHwWifiNanIfaceEventCallback.h",
+        "android/hardware/wifi/1.0/BpHwWifiNanIfaceEventCallback.h",
         "android/hardware/wifi/1.0/BsWifiNanIfaceEventCallback.h",
         "android/hardware/wifi/1.0/IWifiP2pIface.h",
         "android/hardware/wifi/1.0/IHwWifiP2pIface.h",
-        "android/hardware/wifi/1.0/BnWifiP2pIface.h",
-        "android/hardware/wifi/1.0/BpWifiP2pIface.h",
+        "android/hardware/wifi/1.0/BnHwWifiP2pIface.h",
+        "android/hardware/wifi/1.0/BpHwWifiP2pIface.h",
         "android/hardware/wifi/1.0/BsWifiP2pIface.h",
         "android/hardware/wifi/1.0/IWifiRttController.h",
         "android/hardware/wifi/1.0/IHwWifiRttController.h",
-        "android/hardware/wifi/1.0/BnWifiRttController.h",
-        "android/hardware/wifi/1.0/BpWifiRttController.h",
+        "android/hardware/wifi/1.0/BnHwWifiRttController.h",
+        "android/hardware/wifi/1.0/BpHwWifiRttController.h",
         "android/hardware/wifi/1.0/BsWifiRttController.h",
         "android/hardware/wifi/1.0/IWifiRttControllerEventCallback.h",
         "android/hardware/wifi/1.0/IHwWifiRttControllerEventCallback.h",
-        "android/hardware/wifi/1.0/BnWifiRttControllerEventCallback.h",
-        "android/hardware/wifi/1.0/BpWifiRttControllerEventCallback.h",
+        "android/hardware/wifi/1.0/BnHwWifiRttControllerEventCallback.h",
+        "android/hardware/wifi/1.0/BpHwWifiRttControllerEventCallback.h",
         "android/hardware/wifi/1.0/BsWifiRttControllerEventCallback.h",
         "android/hardware/wifi/1.0/IWifiStaIface.h",
         "android/hardware/wifi/1.0/IHwWifiStaIface.h",
-        "android/hardware/wifi/1.0/BnWifiStaIface.h",
-        "android/hardware/wifi/1.0/BpWifiStaIface.h",
+        "android/hardware/wifi/1.0/BnHwWifiStaIface.h",
+        "android/hardware/wifi/1.0/BpHwWifiStaIface.h",
         "android/hardware/wifi/1.0/BsWifiStaIface.h",
         "android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h",
         "android/hardware/wifi/1.0/IHwWifiStaIfaceEventCallback.h",
-        "android/hardware/wifi/1.0/BnWifiStaIfaceEventCallback.h",
-        "android/hardware/wifi/1.0/BpWifiStaIfaceEventCallback.h",
+        "android/hardware/wifi/1.0/BnHwWifiStaIfaceEventCallback.h",
+        "android/hardware/wifi/1.0/BpHwWifiStaIfaceEventCallback.h",
         "android/hardware/wifi/1.0/BsWifiStaIfaceEventCallback.h",
     ],
 }
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index bb8d144..1058cc7 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -36,9 +36,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -48,7 +48,26 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanAvailDuration
+        android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.NanBandSpecificConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -74,25 +93,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanBeaconSdfPayloadRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -112,9 +112,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -124,16 +124,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+        android.hardware.wifi@1.0::types.NanCapabilities
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -143,16 +143,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+        android.hardware.wifi@1.0::types.NanCipherSuiteType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -162,7 +162,26 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanChannelIndex
+        android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.NanClusterEventType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -188,63 +207,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanDataPathChannelCfg)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -283,82 +245,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanDataPathRequestInd)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -378,9 +264,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -390,16 +276,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponse
+        android.hardware.wifi@1.0::types.NanDebugConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -409,102 +295,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDiscEngEventType
+        android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -530,9 +321,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -542,16 +333,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanFollowupInd
+        android.hardware.wifi@1.0::types.NanFollowupReceivedInd
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -561,7 +352,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+        android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -587,25 +378,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanMatchInd)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -625,44 +397,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanPublishRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -682,63 +416,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanPublishType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -758,9 +435,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -770,16 +447,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+        android.hardware.wifi@1.0::types.NanRangingIndication
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -789,64 +466,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSrfIncludeType
+        android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -891,25 +511,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanSubscribeRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -929,63 +530,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanSubscribeType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -1005,25 +549,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanTransmitFollowupRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -1043,63 +568,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanTxType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -1974,6 +1442,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (WifiRateInfo)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
@@ -2407,9 +1894,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2419,7 +1906,26 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanAvailDuration
+        android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.NanBandSpecificConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -2445,25 +1951,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanBeaconSdfPayloadRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -2483,9 +1970,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2495,16 +1982,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+        android.hardware.wifi@1.0::types.NanCapabilities
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2514,16 +2001,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+        android.hardware.wifi@1.0::types.NanCipherSuiteType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2533,7 +2020,26 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanChannelIndex
+        android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.NanClusterEventType
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -2559,63 +2065,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanDataPathChannelCfg)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -2654,82 +2103,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanDataPathRequestInd)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -2749,9 +2122,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2761,16 +2134,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponse
+        android.hardware.wifi@1.0::types.NanDebugConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2780,102 +2153,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanDiscEngEventType
+        android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -2901,9 +2179,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2913,16 +2191,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanFollowupInd
+        android.hardware.wifi@1.0::types.NanFollowupReceivedInd
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2932,7 +2210,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+        android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -2958,25 +2236,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanMatchInd)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -2996,44 +2255,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanPublishRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -3053,63 +2274,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanPublishType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -3129,9 +2293,9 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3141,16 +2305,16 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+        android.hardware.wifi@1.0::types.NanRangingIndication
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
 #
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
 $(GEN): $(HIDL)
 $(GEN): PRIVATE_HIDL := $(HIDL)
 $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3160,64 +2324,7 @@
         -Ljava \
         -randroid.hardware:hardware/interfaces \
         -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSrfIncludeType
+        android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
 
 $(GEN): $(LOCAL_PATH)/types.hal
 	$(transform-generated-source)
@@ -3262,25 +2369,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanSubscribeRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -3300,63 +2388,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanSubscribeType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -3376,25 +2407,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanTransmitFollowupRequest)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -3414,63 +2426,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanTxType)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -4345,6 +3300,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (WifiRateInfo)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal
index d790404..b0598a4 100644
--- a/wifi/1.0/IWifiChip.hal
+++ b/wifi/1.0/IWifiChip.hal
@@ -205,7 +205,8 @@
    *         |WifiStatusCode.ERROR_UNKNOWN|
    * @return capabilities Bitset of |ChipCapabilityMask| values.
    */
-  getCapabilities() generates (WifiStatus status, uint32_t capabilities);
+  getCapabilities()
+      generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities);
 
   /**
    * Get the set of operation modes that the chip supports.
diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal
index 2926c4f..3362339 100644
--- a/wifi/1.0/IWifiNanIface.hal
+++ b/wifi/1.0/IWifiNanIface.hal
@@ -39,7 +39,22 @@
       generates (WifiStatus status);
 
   /**
-   * Enable NAN functionality.
+   * Get NAN capabilities.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  getCapabilitiesRequest(CommandIdShort cmdId) generates (WifiStatus status);
+
+  /**
+   * Enable NAN: configures and activates NAN clustering (does not start
+   * a discovery session or set up data-interfaces or data-paths). Use the
+   * |configureRequest| method to change the configuration of an already enabled
+   * NAN interface.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanEnableRequest|.
@@ -50,7 +65,23 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  enableRequest(CommandId cmdId, NanEnableRequest msg)
+  enableRequest(CommandIdShort cmdId, NanEnableRequest msg)
+      generates (WifiStatus status);
+
+  /**
+   * Configure NAN: configures an existing NAN functionality (i.e. assumes
+   * |enableRequest| already submitted and succeeded).
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @param msg Instance of |NanConfigRequest|.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  configRequest(CommandIdShort cmdId, NanConfigRequest msg)
       generates (WifiStatus status);
 
   /**
@@ -63,10 +94,10 @@
    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  disableRequest(CommandId cmdId) generates (WifiStatus status);
+  disableRequest(CommandIdShort cmdId) generates (WifiStatus status);
 
   /**
-   * Publish request to advertize a service.
+   * Publish request to start advertising a discovery service.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanPublishRequest|.
@@ -77,26 +108,25 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  publishRequest(CommandId cmdId, NanPublishRequest msg)
+  startPublishRequest(CommandIdShort cmdId, NanPublishRequest msg)
       generates (WifiStatus status);
 
   /**
-   * Cancel previous publish requests.
+   * Stop publishing a discovery service.
    *
    * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanPublishCancelRequest|.
+   * @param sessionId ID of the publish discovery session to be stopped.
    * @return status WifiStatus of the operation.
    *         Possible status codes:
    *         |WifiStatusCode.SUCCESS|,
    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  publishCancelRequest(CommandId cmdId, NanPublishCancelRequest msg)
+  stopPublishRequest(CommandIdShort cmdId, uint16_t sessionId)
       generates (WifiStatus status);
 
   /**
-   * Subscribe request to search for a service.
+   * Subscribe request to start searching for a discovery service.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanSubscribeRequest|.
@@ -107,26 +137,25 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  subscribeRequest(CommandId cmdId, NanSubscribeRequest msg)
+  startSubscribeRequest(CommandIdShort cmdId, NanSubscribeRequest msg)
       generates (WifiStatus status);
 
   /**
-   * Cancel previous subscribe requests.
+   * Stop subscribing to a discovery service.
    *
    * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanSubscribeCancelRequest|.
+   * @param sessionId ID of the subscribe discovery session to be stopped.
    * @return status WifiStatus of the operation.
    *         Possible status codes:
    *         |WifiStatusCode.SUCCESS|,
    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  subscribeCancelRequest(CommandId cmdId, NanSubscribeCancelRequest msg)
+  stopSubscribeRequest(CommandIdShort cmdId, uint16_t sessionId)
       generates (WifiStatus status);
 
   /**
-   * NAN transmit follow up request.
+   * NAN transmit follow up message request.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanTransmitFollowupRequest|.
@@ -137,14 +166,40 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  transmitFollowupRequest(CommandId cmdId, NanTransmitFollowupRequest msg)
+  transmitFollowupRequest(CommandIdShort cmdId, NanTransmitFollowupRequest msg)
       generates (WifiStatus status);
 
   /**
-   * NAN configuration request.
+   * Create a NAN Data Interface.
    *
    * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanConfigRequest|.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  createDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+      generates (WifiStatus status);
+
+  /**
+   * Delete a NAN Data Interface.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  deleteDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+      generates (WifiStatus status);
+
+  /**
+   * Initiate a data-path (NDP) setup operation: Initiator.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @param msg Instance of |NanInitiateDataPathRequest|.
    * @return status WifiStatus of the operation.
    *         Possible status codes:
    *         |WifiStatusCode.SUCCESS|,
@@ -152,13 +207,42 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  configRequest(CommandId cmdId, NanConfigRequest msg)
+  initiateDataPathRequest(CommandIdShort cmdId, NanInitiateDataPathRequest msg)
       generates (WifiStatus status);
 
   /**
-   * Set NAN Beacon or sdf payload to discovery engine.
-   * This instructs the Discovery Engine to begin publishing the
-   * received payload in any Beacon or Service Discovery Frame transmitted
+   * Respond to a received data indication as part of a data-path (NDP) setup operation. An
+   * indication is received by the Responder from the Initiator.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  respondToDataPathIndicationRequest(CommandIdShort cmdId,
+                                     NanRespondToDataPathIndicationRequest msg)
+      generates (WifiStatus status);
+
+  /**
+   * Data-path (NDP) termination request: executed by either Initiator or Responder.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @param ndpInstanceId Data-path instance ID to be terminated.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  terminateDataPathRequest(CommandIdShort cmdId, uint32_t ndpInstanceId)
+      generates (WifiStatus status);
+
+  /**
+   * Configure NAN Beacon or SDF payload to include vendor-specific payload.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanBeaconSdfPayloadRequest|.
@@ -169,107 +253,6 @@
    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  beaconSdfPayloadRequest(CommandId cmdId, NanBeaconSdfPayloadRequest msg)
-      generates (WifiStatus status);
-
-  /**
-   * Get NAN HAL version.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @return version Instance of |NanVersion|.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  getVersion() generates (WifiStatus status, NanVersion version);
-
-  /**
-   * Get NAN capabilities.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  getCapabilities(CommandId cmdId) generates (WifiStatus status);
-
-  /**
-   * Create NAN Data Interface
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  dataInterfaceCreate(CommandId cmdId, string ifaceName)
-      generates (WifiStatus status);
-
-  /**
-   * Delete NAN Data Interface.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  dataInterfaceDelete(CommandId cmdId, string ifaceName)
-      generates (WifiStatus status);
-
-  /**
-   * Initiate a NDP session: Initiator
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanDataPathInitiatorRequest|.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  dataRequestInitiator(CommandId cmdId, NanDataPathInitiatorRequest msg)
-      generates (WifiStatus status);
-
-  /**
-   * Response to a data indication received corresponding to a NDP session. An indication
-   * is received with a data request and the responder will send a data response.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanDataPathIndicationResponse|.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  dataIndicationResponse(CommandId cmdId, NanDataPathIndicationResponse msg)
-      generates (WifiStatus status);
-
-  /**
-   * NDL termination request: from either Initiator/Responder.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanDataPathEndRequest|.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  dataEnd(CommandId cmdId, NanDataPathEndRequest msg)
+  beaconSdfPayloadRequest(CommandIdShort cmdId, NanBeaconSdfPayloadRequest msg)
       generates (WifiStatus status);
 };
diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal
index 2b90cba..906d673 100644
--- a/wifi/1.0/IWifiNanIfaceEventCallback.hal
+++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal
@@ -17,65 +17,297 @@
 package android.hardware.wifi@1.0;
 
 /**
- * NAN Response and Event Callbacks.
+ * NAN Response and Asynchronous Event Callbacks.
  */
 interface IWifiNanIfaceEventCallback {
   /**
-   * Callback invoked to notify the status of the Publish Request.
+   * Callback invoked in response to a capability request |getCapabilitiesRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
-   * @param rspData Message Data.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   * @param capabilities Capability data.
    */
-  oneway notifyPublishResponse(CommandId id, NanPublishResponseMsg rspData);
+  oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status,
+                                    NanCapabilities capabilities);
 
   /**
-   * Callback invoked to notify the status of the Subscribe Request.
+   * Callback invoked in response to an enable request |enableRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
-   * @param rspData Message Data.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.ALREADY_ENABLED|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.NAN_NOT_ALLOWED|
    */
-  oneway notifySubscribeResponse(CommandId id, NanSubscribeResponseMsg rspData);
+  oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked to notify the status of the Data Path Request.
+   * Callback invoked in response to a config request |configRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
-   * @param rspData Message Data.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.PROTOCOL_FAILURE|
    */
-  oneway notifyDataPathResponse(CommandId id, NanDataPathResponseMsg rspData);
+  oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked to notify the status of the Capability Request.
+   * Callback invoked in response to a disable request |disableRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
-   * @param rspData Message Data.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.PROTOCOL_FAILURE|
    */
-  oneway notifyCapabilitiesResponse(CommandId id, NanCapabilitiesResponseMsg rspData);
+  oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked to notify the status of the start publish request |startPublishRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.NO_RESOURCES_AVAILABLE|
+   *        |NanStatusType.INVALID_SESSION_ID|
+   * @param sessionId ID of the new publish session (if successfully created).
+   */
+  oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+  /**
+   * Callback invoked in response to a stop publish request |stopPublishRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_SESSION_ID|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   */
+  oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.NO_RESOURCES_AVAILABLE|
+   *        |NanStatusType.INVALID_SESSION_ID|
+   * @param sessionId ID of the new subscribe session (if successfully created).
+   */
+  oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+  /**
+   * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_SESSION_ID|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   */
+  oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.INVALID_SESSION_ID|
+   *        |NanStatusType.INVALID_PEER_ID|
+   */
+  oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   */
+  oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   */
+  oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.INVALID_PEER_ID|
+   */
+  oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to a respond to data path indication request
+   * |respondToDataPathIndicationRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.INVALID_NDP_ID|
+   * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
+   */
+  oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status,
+                                                   uint32_t ndpInstanceId);
+
+  /**
+   * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   *        |NanStatusType.PROTOCOL_FAILURE|
+   *        |NanStatusType.INVALID_NDP_ID|
+   */
+  oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+  /**
+   * Callback invoked in response to a request to include vendor-specific payload in beacon or SDF
+   * frames |beaconSdfPayloadRequest|.
+   *
+   * @param cmdId command Id corresponding to the original request.
+   * @param status WifiNanStatus of the operation. Possible status codes are:
+   *        |NanStatusType.SUCCESS|
+   *        |NanStatusType.INVALID_ARGS|
+   *        |NanStatusType.INTERNAL_FAILURE|
+   */
+  oneway notifyBeaconSdfPayloadResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
    * Callbacks for the various asynchornous NAN Events.
    */
-  oneway eventPublishTerminated(NanPublishTerminatedInd event);
 
+  /**
+   * Asynchronous callback indicating that a cluster event has been received.
+   *
+   * @param event: NanClusterEventInd containing event details.
+   */
+  oneway eventClusterEvent(NanClusterEventInd event);
+
+  /**
+   * Asynchronous callback indicating that a NAN has been disabled.
+   *
+   * @param status: WifiNanStatus describing the reason for the disable event.
+   *                Possible status codes are:
+   *                |NanStatusType.SUCCESS|
+   *                |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
+   */
+  oneway eventDisabled(WifiNanStatus status);
+
+  /**
+   * Asynchronous callback indicating that an active publish session has terminated.
+   *
+   * @param sessionId: The discovery session ID of the terminated session.
+   * @param status: WifiNanStatus describing the reason for the session termination.
+   *                Possible status codes are:
+   *                |NanStatusType.SUCCESS|
+   */
+  oneway eventPublishTerminated(uint16_t sessionId, WifiNanStatus status);
+
+  /**
+   * Asynchronous callback indicating that an active subscribe session has terminated.
+   *
+   * @param sessionId: The discovery session ID of the terminated session.
+   * @param status: WifiNanStatus describing the reason for the session termination.
+   *                 Possible status codes are:
+   *                |NanStatusType.SUCCESS|
+   */
+  oneway eventSubscribeTerminated(uint16_t sessionId, WifiNanStatus status);
+
+  /**
+   * Asynchronous callback indicating that a match has occurred: i.e. a service has been
+   * discovered.
+   *
+   * @param event: NanMatchInd containing event details.
+   */
   oneway eventMatch(NanMatchInd event);
 
-  oneway eventMatchExpired(NanMatchExpiredInd event);
+  /**
+   * Asynchronous callback indicating that a previously discovered match (service) has expired.
+   *
+   * @param discoverySessionId: The discovery session ID of the expired match.
+   * @param peerId: The peer ID of the expired match.
+   */
+  oneway eventMatchExpired(uint16_t discoverySessionId, uint32_t peerId);
 
-  oneway eventSubscribeTerminated(NanSubscribeTerminatedInd event);
+  /**
+   * Asynchronous callback indicating that a followup message has been received from a peer.
+   *
+   * @param event: NanFollowupReceivedInd containing event details.
+   */
+  oneway eventFollowupReceived(NanFollowupReceivedInd event);
 
-  oneway eventFollowup(NanFollowupInd event);
+  /**
+   * Asynchronous callback providing status on a completed followup message transmit operation.
+   *
+   * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
+   * @param status WifiNanStatus of the operation.  Possible status codes are:
+   *               |NanStatusType.NO_OTA_ACK|
+   *               |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
+   */
+  oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
 
-  oneway eventDiscEngEvent(NanDiscEngEventInd event);
+  /**
+   * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
+   * peer (received by the intended Respodner).
+   *
+   * @param event: NanDataPathRequestInd containing event details.
+   */
+  oneway eventDataPathRequest(NanDataPathRequestInd event);
 
-  oneway eventDisabled(NanDisabledInd event);
+  /**
+   * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
+   * both Initiator and Responder.
+   *
+   * @param event: NanDataPathConfirmInd containing event details.
+   */
+  oneway eventDataPathConfirm(NanDataPathConfirmInd event);
 
+  /**
+   * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
+   * both Initiator and Responder.
+   *
+   * @param ndpInstanceId: data-path ID of the terminated data-path.
+   */
+  oneway eventDataPathTerminated(uint32_t ndpInstanceId);
+
+  /**
+   * Asynchronous callback indicating vendor-specific payload received in NAN beacon or SDF frame.
+   *
+   * @param event: NanBeaconSdfPayloadInd containing event details.
+   */
   oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event);
-
-  oneway eventDataRequest(NanDataPathRequestInd event);
-
-  oneway eventDataConfirm(NanDataPathConfirmInd event);
-
-  oneway eventDataEnd(NanDataPathEndInd event);
-
-  oneway eventTransmitFollowup(NanTransmitFollowupInd event);
 };
diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal
index 98af043..6a738a9 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -81,9 +81,17 @@
      */
     TDLS_OFFCHANNEL = 1 << 11,
     /**
+     * Support for neighbour discovery offload.
+     */
+    ND_OFFLOAD = 1 << 12,
+    /**
+     * Support for keep alive packet offload.
+     */
+    KEEP_ALIVE = 1 << 13,
+    /**
      * Support for tracking connection packets' fate.
      */
-    DEBUG_PACKET_FATE = 1 << 12
+    DEBUG_PACKET_FATE = 1 << 14
   };
 
   /**
@@ -112,7 +120,9 @@
    *         |WifiStatusCode.ERROR_UNKNOWN|
    * @return capabilities Bitset of |StaIfaceCapabilityMask| values.
    */
-  getCapabilities() generates (WifiStatus status, uint32_t capabilities);
+  getCapabilities()
+      generates (WifiStatus status,
+                 bitfield<StaIfaceCapabilityMask> capabilities);
 
   /**
    * Used to query additional information about the chip's APF capabilities.
@@ -379,6 +389,55 @@
   setRoamingState(StaRoamingState state) generates (WifiStatus status);
 
   /**
+   * Enable/Disable Neighbour discovery offload functionality in the firmware.
+   *
+   * @param enable true to enable, false to disable.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  enableNdOffload(bool enable) generates (WifiStatus status);
+
+  /**
+   * Start sending the specified keep alive packets periodically.
+   *
+   * @param cmdId command Id to use for this invocation.
+   * @param ipPacketData IP packet contents to be transmitted.
+   * @param etherType 16 bit ether type to be set in the ethernet frame
+   *        transmitted.
+   * @param srcAddress Source MAC address of the packet.
+   * @param dstAddress Destination MAC address of the packet.
+   * @param periodInMs Interval at which this packet must be transmitted.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+   *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  startSendingKeepAlivePackets(
+      CommandId cmdId, vec<uint8_t> ipPacketData, uint16_t etherType,
+      MacAddress srcAddress, MacAddress dstAddress, uint32_t periodInMs)
+      generates (WifiStatus status);
+
+  /**
+   * Stop sending the specified keep alive packets.
+   *
+   * @param cmdId command Id corresponding to the request.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+   *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   */
+  stopSendingKeepAlivePackets(CommandId cmdId) generates (WifiStatus status);
+
+  /**
    * API to start packet fate monitoring.
    * - Once stared, monitoring must remain active until HAL is unloaded.
    * - When HAL is unloaded, all packet fate buffers must be cleared.
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index a94d812..bbb9346 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -82,6 +82,10 @@
       return HidlStaIfaceCaps::TDLS;
     case WIFI_FEATURE_TDLS_OFFCHANNEL:
       return HidlStaIfaceCaps::TDLS_OFFCHANNEL;
+    case WIFI_FEATURE_CONFIG_NDO:
+      return HidlStaIfaceCaps::ND_OFFLOAD;
+    case WIFI_FEATURE_MKEEP_ALIVE:
+      return HidlStaIfaceCaps::KEEP_ALIVE;
   };
   CHECK(false) << "Unknown legacy feature: " << feature;
   return {};
@@ -239,7 +243,9 @@
                              WIFI_FEATURE_HOTSPOT,
                              WIFI_FEATURE_PNO,
                              WIFI_FEATURE_TDLS,
-                             WIFI_FEATURE_TDLS_OFFCHANNEL}) {
+                             WIFI_FEATURE_TDLS_OFFCHANNEL,
+                             WIFI_FEATURE_CONFIG_NDO,
+                             WIFI_FEATURE_MKEEP_ALIVE}) {
     if (feature & legacy_feature_set) {
       *hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature);
     }
@@ -743,123 +749,10 @@
   CHECK(false);
 }
 
-legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy(
-    NanPublishType type) {
-  switch (type) {
-    case NanPublishType::UNSOLICITED:
-      return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED;
-    case NanPublishType::SOLICITED:
-      return legacy_hal::NAN_PUBLISH_TYPE_SOLICITED;
-    case NanPublishType::UNSOLICITED_SOLICITED:
-      return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED;
-  };
-  CHECK(false);
-}
-
-legacy_hal::NanTxType convertHidlNanTxTypeToLegacy(NanTxType type) {
-  switch (type) {
-    case NanTxType::BROADCAST:
-      return legacy_hal::NAN_TX_TYPE_BROADCAST;
-    case NanTxType::UNICAST:
-      return legacy_hal::NAN_TX_TYPE_UNICAST;
-  };
-  CHECK(false);
-}
-
-legacy_hal::NanMatchAlg convertHidlNanMatchAlgToLegacy(NanMatchAlg type) {
-  switch (type) {
-    case NanMatchAlg::MATCH_ONCE:
-      return legacy_hal::NAN_MATCH_ALG_MATCH_ONCE;
-    case NanMatchAlg::MATCH_CONTINUOUS:
-      return legacy_hal::NAN_MATCH_ALG_MATCH_CONTINUOUS;
-    case NanMatchAlg::MATCH_NEVER:
-      return legacy_hal::NAN_MATCH_ALG_MATCH_NEVER;
-  };
-  CHECK(false);
-}
-
-legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy(
-    NanSubscribeType type) {
-  switch (type) {
-    case NanSubscribeType::ACTIVE:
-      return legacy_hal::NAN_SUBSCRIBE_TYPE_ACTIVE;
-    case NanSubscribeType::PASSIVE:
-      return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE;
-  };
-  CHECK(false);
-}
-
-legacy_hal::NanSRFType convertHidlNanSrfTypeToLegacy(NanSrfType type) {
-  switch (type) {
-    case NanSrfType::BLOOM_FILTER:
-      return legacy_hal::NAN_SRF_ATTR_BLOOM_FILTER;
-    case NanSrfType::PARTIAL_MAC_ADDR:
-      return legacy_hal::NAN_SRF_ATTR_PARTIAL_MAC_ADDR;
-  };
-  CHECK(false);
-}
-
-legacy_hal::NanSRFIncludeType convertHidlNanSrfIncludeTypeToLegacy(
-    NanSrfIncludeType type) {
-  switch (type) {
-    case NanSrfIncludeType::DO_NOT_RESPOND:
-      return legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
-    case NanSrfIncludeType::RESPOND:
-      return legacy_hal::NAN_SRF_INCLUDE_RESPOND;
-  };
-  CHECK(false);
-}
-
 NanStatusType convertLegacyNanStatusTypeToHidl(
-    legacy_hal::NanStatusType /* type */) {
-  // TODO: The |NanStatusType| has changed in legacy HAL and no longer in sync
-  // with the HIDL interface.
-  return NanStatusType::SUCCESS;
-}
-
-NanResponseType convertLegacyNanResponseTypeToHidl(
-    legacy_hal::NanResponseType type) {
-  switch (type) {
-    case legacy_hal::NAN_RESPONSE_ENABLED:
-      return NanResponseType::ENABLED;
-    case legacy_hal::NAN_RESPONSE_DISABLED:
-      return NanResponseType::DISABLED;
-    case legacy_hal::NAN_RESPONSE_PUBLISH:
-      return NanResponseType::PUBLISH;
-    case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL:
-      return NanResponseType::PUBLISH_CANCEL;
-    case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP:
-      return NanResponseType::TRANSMIT_FOLLOWUP;
-    case legacy_hal::NAN_RESPONSE_SUBSCRIBE:
-      return NanResponseType::SUBSCRIBE;
-    case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL:
-      return NanResponseType::SUBSCRIBE_CANCEL;
-    case legacy_hal::NAN_RESPONSE_STATS:
-      // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
-      CHECK(0);
-    case legacy_hal::NAN_RESPONSE_CONFIG:
-      return NanResponseType::CONFIG;
-    case legacy_hal::NAN_RESPONSE_TCA:
-      // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
-      CHECK(0);
-    case legacy_hal::NAN_RESPONSE_ERROR:
-      return NanResponseType::ERROR;
-    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD:
-      return NanResponseType::BEACON_SDF_PAYLOAD;
-    case legacy_hal::NAN_GET_CAPABILITIES:
-      return NanResponseType::GET_CAPABILITIES;
-    case legacy_hal::NAN_DP_INTERFACE_CREATE:
-      return NanResponseType::DP_INTERFACE_CREATE;
-    case legacy_hal::NAN_DP_INTERFACE_DELETE:
-      return NanResponseType::DP_INTERFACE_DELETE;
-    case legacy_hal::NAN_DP_INITIATOR_RESPONSE:
-      return NanResponseType::DP_INITIATOR_RESPONSE;
-    case legacy_hal::NAN_DP_RESPONDER_RESPONSE:
-      return NanResponseType::DP_RESPONDER_RESPONSE;
-    case legacy_hal::NAN_DP_END:
-      return NanResponseType::DP_END;
-  };
-  CHECK(false) << "Unknown legacy type: " << type;
+    legacy_hal::NanStatusType type) {
+  // values are identical - may need to do a mapping if they diverge in the future
+  return (NanStatusType) type;
 }
 
 bool convertHidlNanEnableRequestToLegacy(
@@ -868,79 +761,123 @@
   if (!legacy_request) {
     return false;
   }
-  legacy_request->master_pref = hidl_request.masterPref;
-  legacy_request->cluster_low = hidl_request.clusterLow;
-  legacy_request->cluster_high = hidl_request.clusterHigh;
-  legacy_request->config_support_5g = hidl_request.validSupport5gVal;
-  legacy_request->support_5g_val = hidl_request.support5gVal;
-  legacy_request->config_sid_beacon = hidl_request.validSidBeaconVal;
-  legacy_request->sid_beacon_val = hidl_request.sidBeaconVal;
-  legacy_request->config_2dot4g_rssi_close =
-      hidl_request.valid2dot4gRssiCloseVal;
-  legacy_request->rssi_close_2dot4g_val = hidl_request.rssiClose2dot4gVal;
-  legacy_request->config_2dot4g_rssi_middle =
-      hidl_request.valid2dot4gRssiMiddleVal;
-  legacy_request->rssi_middle_2dot4g_val = hidl_request.rssiMiddle2dot4gVal;
-  legacy_request->config_2dot4g_rssi_proximity =
-      hidl_request.valid2dot4gRssiProximityVal;
+  memset(legacy_request, 0, sizeof(legacy_hal::NanEnableRequest));
+
+  // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+  legacy_request->config_2dot4g_support = 1;
+  legacy_request->support_2dot4g_val = hidl_request.operateInBand[
+        (size_t) NanBandIndex::NAN_BAND_24GHZ];
+  legacy_request->config_support_5g = 1;
+  legacy_request->support_5g_val = hidl_request.operateInBand[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+  legacy_request->config_hop_count_limit = 0; // TODO: don't know default yet
+  legacy_request->hop_count_limit_val = hidl_request.hopCountMax;
+  legacy_request->master_pref = hidl_request.configParams.masterPref;
+  legacy_request->discovery_indication_cfg = 0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
+  legacy_request->config_sid_beacon = 1;
+  if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
+    return false;
+  }
+  legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
+        | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
+  legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+  legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
+  legacy_request->config_disc_mac_addr_randomization = 1;
+  legacy_request->disc_mac_addr_rand_interval_sec =
+        hidl_request.configParams.macAddressRandomizationIntervalSec;
+  legacy_request->config_responder_auto_response = 1;
+  legacy_request->ranging_auto_response_cfg = hidl_request.configParams.acceptRangingRequests ?
+       legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+  legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->rssi_close_2dot4g_val =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+  legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->rssi_middle_2dot4g_val =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+  legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
   legacy_request->rssi_proximity_2dot4g_val =
-      hidl_request.rssiProximity2dot4gVal;
-  legacy_request->config_hop_count_limit = hidl_request.validHopCountLimitVal;
-  legacy_request->hop_count_limit_val = hidl_request.hopCountLimitVal;
-  legacy_request->config_2dot4g_support = hidl_request.valid2dot4gSupportVal;
-  legacy_request->support_2dot4g_val = hidl_request.support2dot4gVal;
-  legacy_request->config_2dot4g_beacons = hidl_request.valid2dot4gBeaconsVal;
-  legacy_request->beacon_2dot4g_val = hidl_request.beacon2dot4gVal;
-  legacy_request->config_2dot4g_sdf = hidl_request.valid2dot4gSdfVal;
-  legacy_request->sdf_2dot4g_val = hidl_request.sdf2dot4gVal;
-  legacy_request->config_5g_beacons = hidl_request.valid5gBeaconsVal;
-  legacy_request->beacon_5g_val = hidl_request.beacon5gVal;
-  legacy_request->config_5g_sdf = hidl_request.valid5gSdfVal;
-  legacy_request->sdf_5g_val = hidl_request.sdf5gVal;
-  legacy_request->config_5g_rssi_close = hidl_request.valid5gRssiCloseVal;
-  legacy_request->rssi_close_5g_val = hidl_request.rssiClose5gVal;
-  legacy_request->config_5g_rssi_middle = hidl_request.valid5gRssiMiddleVal;
-  legacy_request->rssi_middle_5g_val = hidl_request.rssiMiddle5gVal;
-  legacy_request->config_5g_rssi_close_proximity =
-      hidl_request.valid5gRssiCloseProximityVal;
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+  legacy_request->config_scan_params = 0; // TODO: don't know default yet
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+  legacy_request->config_dw.config_2dot4g_dw_band = hidl_request.configParams
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+  legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request.configParams
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+  legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->rssi_close_5g_val =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+  legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->rssi_middle_5g_val =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+  legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
   legacy_request->rssi_close_proximity_5g_val =
-      hidl_request.rssiCloseProximity5gVal;
-  legacy_request->config_rssi_window_size = hidl_request.validRssiWindowSizeVal;
-  legacy_request->rssi_window_size_val = hidl_request.rssiWindowSizeVal;
-  legacy_request->config_oui = hidl_request.validOuiVal;
-  legacy_request->oui_val = hidl_request.ouiVal;
-  legacy_request->config_intf_addr = hidl_request.validIntfAddrVal;
-  CHECK(hidl_request.intfAddrVal.size() ==
-        sizeof(legacy_request->intf_addr_val));
-  memcpy(legacy_request->intf_addr_val,
-         hidl_request.intfAddrVal.data(),
-         hidl_request.intfAddrVal.size());
-  legacy_request->config_cluster_attribute_val =
-      hidl_request.configClusterAttributeVal;
-  legacy_request->config_scan_params = hidl_request.validScanParamsVal;
-  if (hidl_request.scanParamsVal.dwellTime.size() >
-      sizeof(legacy_request->scan_params_val.dwell_time)) {
-    return false;
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+        hidl_request.configParams.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+  legacy_request->config_dw.config_5g_dw_band = hidl_request.configParams
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+  legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+  if (hidl_request.debugConfigs.validClusterIdVals) {
+    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
+    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
+  } else { // need 'else' since not configurable in legacy HAL
+    legacy_request->cluster_low = 0x0000;
+    legacy_request->cluster_high = 0xFFFF;
   }
-  memcpy(legacy_request->scan_params_val.dwell_time,
-         hidl_request.scanParamsVal.dwellTime.data(),
-         hidl_request.scanParamsVal.dwellTime.size());
-  if (hidl_request.scanParamsVal.scanPeriod.size() >
-      sizeof(legacy_request->scan_params_val.scan_period)) {
-    return false;
-  }
-  memcpy(legacy_request->scan_params_val.scan_period,
-         hidl_request.scanParamsVal.scanPeriod.data(),
-         hidl_request.scanParamsVal.scanPeriod.size());
-  legacy_request->config_random_factor_force =
-      hidl_request.validRandomFactorForceVal;
-  legacy_request->random_factor_force_val = hidl_request.randomFactorForceVal;
-  legacy_request->config_hop_count_force = hidl_request.validHopCountLimitVal;
-  legacy_request->hop_count_force_val = hidl_request.hopCountLimitVal;
-  legacy_request->config_24g_channel = hidl_request.valid24gChannelVal;
-  legacy_request->channel_24g_val = hidl_request.channel24gVal;
-  legacy_request->config_5g_channel = hidl_request.valid5gChannelVal;
-  legacy_request->channel_5g_val = hidl_request.channel5gVal;
+  legacy_request->config_intf_addr = hidl_request.debugConfigs.validIntfAddrVal;
+  memcpy(legacy_request->intf_addr_val, hidl_request.debugConfigs.intfAddrVal.data(), 6);
+  legacy_request->config_oui = hidl_request.debugConfigs.validOuiVal;
+  legacy_request->oui_val = hidl_request.debugConfigs.ouiVal;
+  legacy_request->config_random_factor_force = hidl_request.debugConfigs.validRandomFactorForceVal;
+  legacy_request->random_factor_force_val = hidl_request.debugConfigs.randomFactorForceVal;
+  legacy_request->config_hop_count_force = hidl_request.debugConfigs.validHopCountForceVal;
+  legacy_request->hop_count_force_val = hidl_request.debugConfigs.hopCountForceVal;
+  legacy_request->config_24g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+  legacy_request->channel_24g_val =
+        hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+  legacy_request->config_5g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+  legacy_request->channel_5g_val = hidl_request.debugConfigs
+        .discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+  legacy_request->config_2dot4g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+  legacy_request->beacon_2dot4g_val = hidl_request.debugConfigs
+        .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+  legacy_request->config_5g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+  legacy_request->beacon_5g_val = hidl_request.debugConfigs
+        .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+  legacy_request->config_2dot4g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+  legacy_request->sdf_2dot4g_val = hidl_request.debugConfigs
+        .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+  legacy_request->config_5g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+  legacy_request->sdf_5g_val = hidl_request.debugConfigs
+        .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+
   return true;
 }
 
@@ -950,57 +887,69 @@
   if (!legacy_request) {
     return false;
   }
-  legacy_request->publish_id = hidl_request.publishId;
-  legacy_request->ttl = hidl_request.ttl;
-  legacy_request->period = hidl_request.period;
-  legacy_request->publish_type =
-      convertHidlNanPublishTypeToLegacy(hidl_request.publishType);
-  legacy_request->tx_type = convertHidlNanTxTypeToLegacy(hidl_request.txType);
-  legacy_request->publish_count = hidl_request.publishCount;
-  if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
-    return false;
-  }
-  legacy_request->service_name_len = hidl_request.serviceName.size();
-  memcpy(legacy_request->service_name,
-         hidl_request.serviceName.c_str(),
-         hidl_request.serviceName.size());
-  legacy_request->publish_match_indicator =
-      convertHidlNanMatchAlgToLegacy(hidl_request.publishMatchIndicator);
-  if (hidl_request.serviceSpecificInfo.size() >
-      sizeof(legacy_request->service_specific_info)) {
-    return false;
-  }
-  legacy_request->service_specific_info_len =
-      hidl_request.serviceSpecificInfo.size();
-  memcpy(legacy_request->service_specific_info,
-         hidl_request.serviceSpecificInfo.data(),
-         hidl_request.serviceSpecificInfo.size());
-  if (hidl_request.rxMatchFilter.size() >
-      sizeof(legacy_request->rx_match_filter)) {
-    return false;
-  }
-  legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
-  memcpy(legacy_request->rx_match_filter,
-         hidl_request.rxMatchFilter.data(),
-         hidl_request.rxMatchFilter.size());
-  if (hidl_request.txMatchFilter.size() >
-      sizeof(legacy_request->tx_match_filter)) {
-    return false;
-  }
-  legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
-  memcpy(legacy_request->tx_match_filter,
-         hidl_request.txMatchFilter.data(),
-         hidl_request.txMatchFilter.size());
-  legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
-  legacy_request->connmap = hidl_request.connmap;
-  legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
-  return true;
-}
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanPublishRequest));
 
-bool convertHidlNanPublishCancelRequestToLegacy(
-    const NanPublishCancelRequest& hidl_request,
-    legacy_hal::NanPublishCancelRequest* legacy_request) {
-  legacy_request->publish_id = hidl_request.publishId;
+  legacy_request->publish_id = hidl_request.baseConfigs.sessionId;
+  legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+  legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+  legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount;
+  legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+  if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+        legacy_request->service_name_len);
+  legacy_request->publish_match_indicator =
+        (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+  legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+  if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->service_specific_info,
+        hidl_request.baseConfigs.serviceSpecificInfo.data(),
+        legacy_request->service_specific_info_len);
+  legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+  if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->rx_match_filter,
+        hidl_request.baseConfigs.rxMatchFilter.data(),
+        legacy_request->rx_match_filter_len);
+  legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+  if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->tx_match_filter,
+        hidl_request.baseConfigs.txMatchFilter.data(),
+        legacy_request->tx_match_filter_len);
+  legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+  legacy_request->recv_indication_cfg = 0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+  legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+  legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->pmk,
+        hidl_request.baseConfigs.pmk.data(),
+        legacy_request->pmk_len);
+  legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+        legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+  legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+        legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+  legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+  legacy_request->ranging_cfg.config_ranging_indications =
+        hidl_request.baseConfigs.configRangingIndications;
+  legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+  legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+  legacy_request->publish_type = (legacy_hal::NanPublishType) hidl_request.publishType;
+  legacy_request->tx_type = (legacy_hal::NanTxType) hidl_request.txType;
+
   return true;
 }
 
@@ -1010,225 +959,417 @@
   if (!legacy_request) {
     return false;
   }
-  legacy_request->subscribe_id = hidl_request.subscribeId;
-  legacy_request->ttl = hidl_request.ttl;
-  legacy_request->period = hidl_request.period;
-  legacy_request->subscribe_type =
-      convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType);
-  legacy_request->serviceResponseFilter =
-      convertHidlNanSrfTypeToLegacy(hidl_request.serviceResponseFilter);
-  legacy_request->serviceResponseInclude =
-      convertHidlNanSrfIncludeTypeToLegacy(hidl_request.serviceResponseInclude);
-  legacy_request->useServiceResponseFilter =
-      hidl_request.shouldUseServiceResponseFilter
-          ? legacy_hal::NAN_USE_SRF
-          : legacy_hal::NAN_DO_NOT_USE_SRF;
-  legacy_request->ssiRequiredForMatchIndication =
-      hidl_request.isSsiRequiredForMatchIndication
-          ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND
-          : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanSubscribeRequest));
+
+  legacy_request->subscribe_id = hidl_request.baseConfigs.sessionId;
+  legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+  legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+  legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount;
+  legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+  if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+        legacy_request->service_name_len);
   legacy_request->subscribe_match_indicator =
-      convertHidlNanMatchAlgToLegacy(hidl_request.subscribeMatchIndicator);
-  legacy_request->subscribe_count = hidl_request.subscribeCount;
-  if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
+        (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+  legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+  if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
     return false;
   }
-  legacy_request->service_name_len = hidl_request.serviceName.size();
-  memcpy(legacy_request->service_name,
-         hidl_request.serviceName.c_str(),
-         hidl_request.serviceName.size());
-  if (hidl_request.serviceSpecificInfo.size() >
-      sizeof(legacy_request->service_specific_info)) {
-    return false;
-  }
-  legacy_request->service_specific_info_len =
-      hidl_request.serviceSpecificInfo.size();
   memcpy(legacy_request->service_specific_info,
-         hidl_request.serviceSpecificInfo.data(),
-         hidl_request.serviceSpecificInfo.size());
-  if (hidl_request.rxMatchFilter.size() >
-      sizeof(legacy_request->rx_match_filter)) {
+        hidl_request.baseConfigs.serviceSpecificInfo.data(),
+        legacy_request->service_specific_info_len);
+  legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+  if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
     return false;
   }
-  legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
   memcpy(legacy_request->rx_match_filter,
-         hidl_request.rxMatchFilter.data(),
-         hidl_request.rxMatchFilter.size());
-  if (hidl_request.txMatchFilter.size() >
-      sizeof(legacy_request->tx_match_filter)) {
+        hidl_request.baseConfigs.rxMatchFilter.data(),
+        legacy_request->rx_match_filter_len);
+  legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+  if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
     return false;
   }
-  legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
   memcpy(legacy_request->tx_match_filter,
-         hidl_request.txMatchFilter.data(),
-         hidl_request.txMatchFilter.size());
-  legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
-  legacy_request->connmap = hidl_request.connmap;
-  if (hidl_request.intfAddr.size() > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+        hidl_request.baseConfigs.txMatchFilter.data(),
+        legacy_request->tx_match_filter_len);
+  legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+  legacy_request->recv_indication_cfg = 0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+  legacy_request->recv_indication_cfg |=
+        hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+  legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+  legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
     return false;
   }
+  memcpy(legacy_request->pmk,
+        hidl_request.baseConfigs.pmk.data(),
+        legacy_request->pmk_len);
+  legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+        legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+  legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+        legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+  legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+  legacy_request->ranging_cfg.config_ranging_indications =
+        hidl_request.baseConfigs.configRangingIndications;
+  legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+  legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+  legacy_request->subscribe_type = (legacy_hal::NanSubscribeType) hidl_request.subscribeType;
+  legacy_request->serviceResponseFilter = (legacy_hal::NanSRFType) hidl_request.srfType;
+  legacy_request->serviceResponseInclude = hidl_request.srfRespondIfInAddressSet ?
+        legacy_hal::NAN_SRF_INCLUDE_RESPOND : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
+  legacy_request->useServiceResponseFilter = hidl_request.shouldUseSrf ?
+        legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF;
+  legacy_request->ssiRequiredForMatchIndication = hidl_request.isSsiRequiredForMatch ?
+        legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
   legacy_request->num_intf_addr_present = hidl_request.intfAddr.size();
-  for (uint32_t i = 0; i < hidl_request.intfAddr.size(); i++) {
-    CHECK(hidl_request.intfAddr[i].size() ==
-          sizeof(legacy_request->intf_addr[i]));
-    memcpy(legacy_request->intf_addr[i],
-           hidl_request.intfAddr[i].data(),
-           hidl_request.intfAddr[i].size());
+  if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+    return false;
   }
-  legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
+  for (int i = 0; i < legacy_request->num_intf_addr_present; i++) {
+    memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), 6);
+  }
+
   return true;
 }
 
-bool convertHidlNanSubscribeCancelRequestToLegacy(
-    const NanSubscribeCancelRequest& /* hidl_request */,
-    legacy_hal::NanSubscribeCancelRequest* /* legacy_request */) {
-  return false;
-}
-
 bool convertHidlNanTransmitFollowupRequestToLegacy(
-    const NanTransmitFollowupRequest& /* hidl_request */,
-    legacy_hal::NanTransmitFollowupRequest* /* legacy_request */) {
-  return false;
+    const NanTransmitFollowupRequest& hidl_request,
+    legacy_hal::NanTransmitFollowupRequest* legacy_request) {
+  if (!legacy_request) {
+    return false;
+  }
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanTransmitFollowupRequest));
+
+  legacy_request->publish_subscribe_id = hidl_request.discoverySessionId;
+  legacy_request->requestor_instance_id = hidl_request.peerId;
+  memcpy(legacy_request->addr, hidl_request.addr.data(), 6);
+  legacy_request->priority = hidl_request.isHighPriority ?
+        legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
+  legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
+        legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
+  legacy_request->service_specific_info_len = hidl_request.message.size();
+  if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->service_specific_info,
+        hidl_request.message.data(),
+        legacy_request->service_specific_info_len);
+  legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;
+
+  return true;
 }
 
 bool convertHidlNanConfigRequestToLegacy(
-    const NanConfigRequest& /* hidl_request */,
-    legacy_hal::NanConfigRequest* /* legacy_request */) {
-  return false;
+    const NanConfigRequest& hidl_request,
+    legacy_hal::NanConfigRequest* legacy_request) {
+  if (!legacy_request) {
+    return false;
+  }
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanConfigRequest));
+
+  // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+  legacy_request->master_pref = hidl_request.masterPref;
+  legacy_request->discovery_indication_cfg = 0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.disableStartedClusterIndication ? 0x2 : 0x0;
+  legacy_request->discovery_indication_cfg |=
+        hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
+  legacy_request->config_sid_beacon = 1;
+  if (hidl_request.numberOfServiceIdsInBeacon > 127) {
+    return false;
+  }
+  legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
+        | (hidl_request.numberOfServiceIdsInBeacon << 1);
+  legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+  legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
+  legacy_request->config_disc_mac_addr_randomization = 1;
+  legacy_request->disc_mac_addr_rand_interval_sec =
+        hidl_request.macAddressRandomizationIntervalSec;
+  legacy_request->config_responder_auto_response = 1;
+  legacy_request->ranging_auto_response_cfg = hidl_request.acceptRangingRequests ?
+       legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+  /* TODO : missing
+  legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->rssi_close_2dot4g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+  legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->rssi_middle_2dot4g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+  legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
+  legacy_request->rssi_proximity_2dot4g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+  */
+  legacy_request->config_scan_params = 0; // TODO: don't know default yet
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+  legacy_request->config_dw.config_2dot4g_dw_band = hidl_request
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+  legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+  /* TODO: missing
+  legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+  legacy_request->rssi_close_5g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+  legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+  legacy_request->rssi_middle_5g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+  */
+  legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
+  legacy_request->rssi_close_proximity_5g_val =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+  legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+  legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+        hidl_request.bandSpecificConfig[
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+  legacy_request->config_dw.config_5g_dw_band = hidl_request
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+  legacy_request->config_dw.dw_5g_interval_val = hidl_request
+        .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+
+  return true;
 }
 
 bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
-    const NanBeaconSdfPayloadRequest& /* hidl_request */,
-    legacy_hal::NanBeaconSdfPayloadRequest* /* legacy_request */) {
-  return false;
+    const NanBeaconSdfPayloadRequest& hidl_request,
+    legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
+  if (!legacy_request) {
+    return false;
+  }
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
+
+  legacy_request->vsa.payload_transmit_flag = hidl_request.transmitInNext16dws ? 1 : 0;
+  legacy_request->vsa.tx_in_discovery_beacon = hidl_request.transmitInDiscoveryBeacon;
+  legacy_request->vsa.tx_in_sync_beacon = hidl_request.transmitInSyncBeacon;
+  legacy_request->vsa.tx_in_service_discovery = hidl_request.transmitInServiceDiscoveryFrame;
+  legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
+  legacy_request->vsa.vsa_len = hidl_request.vsa.size();
+  if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
+
+  return true;
 }
 
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
-    const NanDataPathInitiatorRequest& /* hidl_request */,
-    legacy_hal::NanDataPathInitiatorRequest* /* legacy_request */) {
-  return false;
+    const NanInitiateDataPathRequest& hidl_request,
+    legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
+  if (!legacy_request) {
+    return false;
+  }
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathInitiatorRequest));
+
+  legacy_request->requestor_instance_id = hidl_request.peerId;
+  memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6);
+  legacy_request->channel_request_type =
+        (legacy_hal::NanDataPathChannelCfg) hidl_request.channelRequestType;
+  legacy_request->channel = hidl_request.channel;
+  strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+  legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+        legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+  legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+  if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+        legacy_request->app_info.ndp_app_info_len);
+  legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+  legacy_request->pmk_len = hidl_request.pmk.size();
+  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+  return true;
 }
 
 bool convertHidlNanDataPathIndicationResponseToLegacy(
-    const NanDataPathIndicationResponse& /* hidl_response */,
-    legacy_hal::NanDataPathIndicationResponse* /* legacy_response */) {
-  return false;
-}
+    const NanRespondToDataPathIndicationRequest& hidl_request,
+    legacy_hal::NanDataPathIndicationResponse* legacy_request) {
+  if (!legacy_request) {
+    return false;
+  }
+  memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathIndicationResponse));
 
-bool convertHidlNanDataPathEndRequestToLegacy(
-    const NanDataPathEndRequest& /* hidl_request */,
-    legacy_hal::NanDataPathEndRequest* /* legacy_request */) {
-  return false;
+  legacy_request->rsp_code = hidl_request.acceptRequest ?
+        legacy_hal::NAN_DP_REQUEST_ACCEPT : legacy_hal::NAN_DP_REQUEST_REJECT;
+  legacy_request->ndp_instance_id = hidl_request.ndpInstanceId;
+  strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+  legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+        legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+  legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+  if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+        legacy_request->app_info.ndp_app_info_len);
+  legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+  legacy_request->pmk_len = hidl_request.pmk.size();
+  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+    return false;
+  }
+  memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+  return true;
 }
 
 bool convertLegacyNanResponseHeaderToHidl(
     const legacy_hal::NanResponseMsg& legacy_response,
-    NanResponseMsgHeader* hidl_response) {
-  if (!hidl_response) {
+    WifiNanStatus* wifiNanStatus) {
+  if (!wifiNanStatus) {
     return false;
   }
-  hidl_response->status =
-      convertLegacyNanStatusTypeToHidl(legacy_response.status);
-  hidl_response->value = legacy_response.value;
-  hidl_response->responseType =
-      convertLegacyNanResponseTypeToHidl(legacy_response.response_type);
+  wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
+  wifiNanStatus->description = legacy_response.nan_error;
+
   return true;
 }
 
-bool convertLegacyNanPublishResponseToHidl(
-    const legacy_hal::NanPublishResponse& /* legacy_response */,
-    NanPublishResponse* /* hidl_response */) {
-  return false;
-}
-
-bool convertLegacyNanSubscribeResponseToHidl(
-    const legacy_hal::NanSubscribeResponse& /* legacy_response */,
-    NanSubscribeResponse* /* hidl_response */) {
-  return false;
-}
-
-bool convertLegacyNanDataPathResponseToHidl(
-    const legacy_hal::NanDataPathRequestResponse& /* legacy_response */,
-    NanDataPathResponse* /* hidl_response */) {
-  return false;
-}
-
 bool convertLegacyNanCapabilitiesResponseToHidl(
-    const legacy_hal::NanCapabilities& /* legacy_response */,
-    NanCapabilitiesResponse* /* hidl_response */) {
-  return false;
-}
+    const legacy_hal::NanCapabilities& legacy_response,
+    NanCapabilities* hidl_response) {
+  if (!hidl_response) {
+    return false;
+  }
+  hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters;
+  hidl_response->maxPublishes = legacy_response.max_publishes;
+  hidl_response->maxSubscribes = legacy_response.max_subscribes;
+  hidl_response->maxServiceNameLen = legacy_response.max_service_name_len;
+  hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len;
+  hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len;
+  hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len;
+  hidl_response->maxVsaDataLen = legacy_response.max_vsa_data_len;
+  hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces;
+  hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions;
+  hidl_response->maxAppInfoLen = legacy_response.max_app_info_len;
+  hidl_response->maxQueuedTransmitFollowupMsgs = legacy_response.max_queued_transmit_followup_msgs;
+  // TODO: b/34059183 to add to underlying HAL
+  hidl_response->maxSubscribeInterfaceAddresses = NAN_MAX_SUBSCRIBE_MAX_ADDRESS;
+  hidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported;
 
-bool convertLegacyNanPublishTerminatedIndToHidl(
-    const legacy_hal::NanPublishTerminatedInd& /* legacy_ind */,
-    NanPublishTerminatedInd* /* hidl_ind */) {
-  return false;
+  return true;
 }
 
 bool convertLegacyNanMatchIndToHidl(
-    const legacy_hal::NanMatchInd& /* legacy_ind */,
-    NanMatchInd* /* hidl_ind */) {
-  return false;
-}
+    const legacy_hal::NanMatchInd& legacy_ind,
+    NanMatchInd* hidl_ind) {
+  if (!hidl_ind) {
+    return false;
+  }
+  hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+  hidl_ind->peerId = legacy_ind.requestor_instance_id;
+  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+  hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
+        legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
+  hidl_ind->matchFilter = std::vector<uint8_t>(legacy_ind.sdf_match_filter,
+        legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len);
+  hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1;
+  hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1;
+  hidl_ind->rssiValue = legacy_ind.rssi_value;
+  hidl_ind->peerSupportedCipherTypes = legacy_ind.peer_cipher_type;
+  hidl_ind->peerRequiresSecurityEnabledInNdp =
+        legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+  hidl_ind->peerRequiresRanging =
+        legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE;
+  hidl_ind->rangingMeasurementInCm = legacy_ind.range_result.range_measurement_cm;
+  hidl_ind->rangingIndicationType = legacy_ind.range_result.ranging_event_type;
 
-bool convertLegacyNanMatchExpiredIndToHidl(
-    const legacy_hal::NanMatchExpiredInd& /* legacy_ind */,
-    NanMatchExpiredInd* /* hidl_ind */) {
-  return false;
-}
-
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
-    const legacy_hal::NanSubscribeTerminatedInd& /* legacy_ind */,
-    NanSubscribeTerminatedInd* /* hidl_ind */) {
-  return false;
+  return true;
 }
 
 bool convertLegacyNanFollowupIndToHidl(
-    const legacy_hal::NanFollowupInd& /* legacy_ind */,
-    NanFollowupInd* /* hidl_ind */) {
-  return false;
-}
+    const legacy_hal::NanFollowupInd& legacy_ind,
+    NanFollowupReceivedInd* hidl_ind) {
+  if (!hidl_ind) {
+    return false;
+  }
+  hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+  hidl_ind->peerId = legacy_ind.requestor_instance_id;
+  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+  hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
+  hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
+        legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
 
-bool convertLegacyNanDiscEngEventIndToHidl(
-    const legacy_hal::NanDiscEngEventInd& /* legacy_ind */,
-    NanDiscEngEventInd* /* hidl_ind */) {
-  return false;
-}
-
-bool convertLegacyNanDisabledIndToHidl(
-    const legacy_hal::NanDisabledInd& /* legacy_ind */,
-    NanDisabledInd* /* hidl_ind */) {
-  return false;
+  return true;
 }
 
 bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& /* legacy_ind */,
-    NanBeaconSdfPayloadInd* /* hidl_ind */) {
-  return false;
+    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+    NanBeaconSdfPayloadInd* hidl_ind) {
+  if (!hidl_ind) {
+    return false;
+  }
+  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+  hidl_ind->isVsaReceived = legacy_ind.is_vsa_received == 1;
+  hidl_ind->vsaReceivedOnFrames = legacy_ind.vsa.vsa_received_on;
+  hidl_ind->vsaVendorOui = legacy_ind.vsa.vendor_oui;
+  hidl_ind->vsa = std::vector<uint8_t>(legacy_ind.vsa.vsa,
+        legacy_ind.vsa.vsa + legacy_ind.vsa.attr_len);
+  hidl_ind->isBeaconSdfPayloadReceived = legacy_ind.is_beacon_sdf_payload_received == 1;
+  hidl_ind->beaconSdfPayloadData = std::vector<uint8_t>(legacy_ind.data.frame_data,
+        legacy_ind.data.frame_data + legacy_ind.data.frame_len);
+
+  return true;
 }
 
 bool convertLegacyNanDataPathRequestIndToHidl(
-    const legacy_hal::NanDataPathRequestInd& /* legacy_ind */,
-    NanDataPathRequestInd* /* hidl_ind */) {
-  return false;
+    const legacy_hal::NanDataPathRequestInd& legacy_ind,
+    NanDataPathRequestInd* hidl_ind) {
+  if (!hidl_ind) {
+    return false;
+  }
+  hidl_ind->discoverySessionId = legacy_ind.service_instance_id;
+  hidl_ind->peerDiscMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_disc_mac_addr);
+  hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+  hidl_ind->securityRequired =
+        legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+  hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+        legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+
+  return true;
 }
 
 bool convertLegacyNanDataPathConfirmIndToHidl(
-    const legacy_hal::NanDataPathConfirmInd& /* legacy_ind */,
-    NanDataPathConfirmInd* /* hidl_ind */) {
-  return false;
-}
+    const legacy_hal::NanDataPathConfirmInd& legacy_ind,
+    NanDataPathConfirmInd* hidl_ind) {
+  if (!hidl_ind) {
+    return false;
+  }
+  hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+  hidl_ind->dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT;
+  hidl_ind->peerNdiMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_ndi_mac_addr);
+  hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+          legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+  hidl_ind->status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code);
+  hidl_ind->status.description = ""; // TODO: b/34059183
 
-bool convertLegacyNanDataPathEndIndToHidl(
-    const legacy_hal::NanDataPathEndInd& /* legacy_ind */,
-    NanDataPathEndInd* /* hidl_ind */) {
-  return false;
-}
-
-bool convertLegacyNanTransmitFollowupIndToHidl(
-    const legacy_hal::NanTransmitFollowupInd& /* legacy_ind */,
-    NanTransmitFollowupInd* /* hidl_ind */) {
-  return false;
+  return true;
 }
 
 legacy_hal::wifi_rtt_type convertHidlRttTypeToLegacy(RttType type) {
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 9086666..14bc77d 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -94,87 +94,50 @@
     std::vector<WifiDebugRxPacketFateReport>* hidl_fates);
 
 // NAN iface conversion methods.
+NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type);
 bool convertHidlNanEnableRequestToLegacy(
     const NanEnableRequest& hidl_request,
     legacy_hal::NanEnableRequest* legacy_request);
-bool convertHidlNanPublishRequestToLegacy(
-    const NanPublishRequest& hidl_request,
-    legacy_hal::NanPublishRequest* legacy_request);
-bool convertHidlNanPublishCancelRequestToLegacy(
-    const NanPublishCancelRequest& hidl_request,
-    legacy_hal::NanPublishCancelRequest* legacy_request);
-bool convertHidlNanSubscribeRequestToLegacy(
-    const NanSubscribeRequest& hidl_request,
-    legacy_hal::NanSubscribeRequest* legacy_request);
-bool convertHidlNanSubscribeCancelRequestToLegacy(
-    const NanSubscribeCancelRequest& hidl_request,
-    legacy_hal::NanSubscribeCancelRequest* legacy_request);
-bool convertHidlNanTransmitFollowupRequestToLegacy(
-    const NanTransmitFollowupRequest& hidl_request,
-    legacy_hal::NanTransmitFollowupRequest* legacy_request);
 bool convertHidlNanConfigRequestToLegacy(
     const NanConfigRequest& hidl_request,
     legacy_hal::NanConfigRequest* legacy_request);
+bool convertHidlNanPublishRequestToLegacy(
+    const NanPublishRequest& hidl_request,
+    legacy_hal::NanPublishRequest* legacy_request);
+bool convertHidlNanSubscribeRequestToLegacy(
+    const NanSubscribeRequest& hidl_request,
+    legacy_hal::NanSubscribeRequest* legacy_request);
+bool convertHidlNanTransmitFollowupRequestToLegacy(
+    const NanTransmitFollowupRequest& hidl_request,
+    legacy_hal::NanTransmitFollowupRequest* legacy_request);
 bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
     const NanBeaconSdfPayloadRequest& hidl_request,
     legacy_hal::NanBeaconSdfPayloadRequest* legacy_request);
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
-    const NanDataPathInitiatorRequest& hidl_request,
+    const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request);
 bool convertHidlNanDataPathIndicationResponseToLegacy(
-    const NanDataPathIndicationResponse& hidl_response,
+    const NanRespondToDataPathIndicationRequest& hidl_response,
     legacy_hal::NanDataPathIndicationResponse* legacy_response);
-bool convertHidlNanDataPathEndRequestToLegacy(
-    const NanDataPathEndRequest& hidl_request,
-    legacy_hal::NanDataPathEndRequest* legacy_request);
 bool convertLegacyNanResponseHeaderToHidl(
     const legacy_hal::NanResponseMsg& legacy_response,
-    NanResponseMsgHeader* hidl_response);
-bool convertLegacyNanPublishResponseToHidl(
-    const legacy_hal::NanPublishResponse& legacy_response,
-    NanPublishResponse* hidl_response);
-bool convertLegacyNanSubscribeResponseToHidl(
-    const legacy_hal::NanSubscribeResponse& legacy_response,
-    NanSubscribeResponse* hidl_response);
-bool convertLegacyNanDataPathResponseToHidl(
-    const legacy_hal::NanDataPathRequestResponse& legacy_response,
-    NanDataPathResponse* hidl_response);
+    WifiNanStatus* wifiNanStatus);
 bool convertLegacyNanCapabilitiesResponseToHidl(
     const legacy_hal::NanCapabilities& legacy_response,
-    NanCapabilitiesResponse* hidl_response);
-bool convertLegacyNanPublishTerminatedIndToHidl(
-    const legacy_hal::NanPublishTerminatedInd& legacy_ind,
-    NanPublishTerminatedInd* hidl_ind);
+    NanCapabilities* hidl_response);
 bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind,
                                     NanMatchInd* hidl_ind);
-bool convertLegacyNanMatchExpiredIndToHidl(
-    const legacy_hal::NanMatchExpiredInd& legacy_ind,
-    NanMatchExpiredInd* hidl_ind);
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
-    const legacy_hal::NanSubscribeTerminatedInd& legacy_ind,
-    NanSubscribeTerminatedInd* hidl_ind);
 bool convertLegacyNanFollowupIndToHidl(
-    const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupInd* hidl_ind);
-bool convertLegacyNanDiscEngEventIndToHidl(
-    const legacy_hal::NanDiscEngEventInd& legacy_ind,
-    NanDiscEngEventInd* hidl_ind);
-bool convertLegacyNanDisabledIndToHidl(
-    const legacy_hal::NanDisabledInd& legacy_ind, NanDisabledInd* hidl_ind);
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
-    NanBeaconSdfPayloadInd* hidl_ind);
+    const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupReceivedInd* hidl_ind);
 bool convertLegacyNanDataPathRequestIndToHidl(
     const legacy_hal::NanDataPathRequestInd& legacy_ind,
     NanDataPathRequestInd* hidl_ind);
 bool convertLegacyNanDataPathConfirmIndToHidl(
     const legacy_hal::NanDataPathConfirmInd& legacy_ind,
     NanDataPathConfirmInd* hidl_ind);
-bool convertLegacyNanDataPathEndIndToHidl(
-    const legacy_hal::NanDataPathEndInd& legacy_ind,
-    NanDataPathEndInd* hidl_ind);
-bool convertLegacyNanTransmitFollowupIndToHidl(
-    const legacy_hal::NanTransmitFollowupInd& legacy_ind,
-    NanTransmitFollowupInd* hidl_ind);
+bool convertLegacyNanBeaconSdfPayloadIndToHidl(
+    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+    NanBeaconSdfPayloadInd* hidl_ind);
 
 // RTT controller conversion methods.
 bool convertHidlVectorOfRttConfigToLegacy(
diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.0/default/wifi.cpp
index 332363d..c06abe8 100644
--- a/wifi/1.0/default/wifi.cpp
+++ b/wifi/1.0/default/wifi.cpp
@@ -103,18 +103,18 @@
     chip_ = new WifiChip(kChipId, legacy_hal_, mode_controller_);
     run_state_ = RunState::STARTED;
     for (const auto& callback : event_callbacks_) {
-      if (!callback->onStart().getStatus().isOk()) {
+      if (!callback->onStart().isOk()) {
         LOG(ERROR) << "Failed to invoke onStart callback";
       };
     }
     for (const auto& callback : event_callbacks_) {
-      if (!callback->onFailure(wifi_status).getStatus().isOk()) {
+      if (!callback->onFailure(wifi_status).isOk()) {
         LOG(ERROR) << "Failed to invoke onFailure callback";
       }
     }
   } else {
     for (const auto& callback : event_callbacks_) {
-      if (!callback->onFailure(wifi_status).getStatus().isOk()) {
+      if (!callback->onFailure(wifi_status).isOk()) {
         LOG(ERROR) << "Failed to invoke onFailure callback";
       }
     }
@@ -132,13 +132,13 @@
   WifiStatus wifi_status = stopLegacyHalAndDeinitializeModeController();
   if (wifi_status.code == WifiStatusCode::SUCCESS) {
     for (const auto& callback : event_callbacks_) {
-      if (!callback->onStop().getStatus().isOk()) {
+      if (!callback->onStop().isOk()) {
         LOG(ERROR) << "Failed to invoke onStop callback";
       };
     }
   } else {
     for (const auto& callback : event_callbacks_) {
-      if (!callback->onFailure(wifi_status).getStatus().isOk()) {
+      if (!callback->onFailure(wifi_status).isOk()) {
         LOG(ERROR) << "Failed to invoke onFailure callback";
       }
     }
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 3b99e60..3bfd2bb 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -633,15 +633,46 @@
   return {status, caps};
 }
 
+wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
+  wifi_roaming_config config_internal = config;
+  return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
+                                                   &config_internal);
+}
+
 wifi_error WifiLegacyHal::enableFirmwareRoaming(fw_roaming_state_t state) {
   return global_func_table_.wifi_enable_firmware_roaming(wlan_interface_handle_,
                                                          state);
 }
 
-wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
-  wifi_roaming_config config_internal = config;
-  return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
-                                                   &config_internal);
+wifi_error WifiLegacyHal::configureNdOffload(bool enable) {
+  return global_func_table_.wifi_configure_nd_offload(wlan_interface_handle_,
+                                                      enable);
+}
+
+wifi_error WifiLegacyHal::startSendingOffloadedPacket(
+    uint32_t cmd_id,
+    const std::vector<uint8_t>& ip_packet_data,
+    const std::array<uint8_t, 6>& src_address,
+    const std::array<uint8_t, 6>& dst_address,
+    uint32_t period_in_ms) {
+  std::vector<uint8_t> ip_packet_data_internal(ip_packet_data);
+  std::vector<uint8_t> src_address_internal(
+      src_address.data(), src_address.data() + src_address.size());
+  std::vector<uint8_t> dst_address_internal(
+      dst_address.data(), dst_address.data() + dst_address.size());
+  return global_func_table_.wifi_start_sending_offloaded_packet(
+      cmd_id,
+      wlan_interface_handle_,
+      ip_packet_data_internal.data(),
+      ip_packet_data_internal.size(),
+      src_address_internal.data(),
+      dst_address_internal.data(),
+      period_in_ms);
+}
+
+wifi_error WifiLegacyHal::stopSendingOffloadedPacket(uint32_t cmd_id) {
+  return global_func_table_.wifi_stop_sending_offloaded_packet(
+      cmd_id, wlan_interface_handle_);
 }
 
 std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index b585314..a3ac075 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -182,8 +182,16 @@
                                      on_threshold_breached_callback);
   wifi_error stopRssiMonitoring(wifi_request_id id);
   std::pair<wifi_error, wifi_roaming_capabilities> getRoamingCapabilities();
-  wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
   wifi_error configureRoaming(const wifi_roaming_config& config);
+  wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
+  wifi_error configureNdOffload(bool enable);
+  wifi_error startSendingOffloadedPacket(
+      uint32_t cmd_id,
+      const std::vector<uint8_t>& ip_packet_data,
+      const std::array<uint8_t, 6>& src_address,
+      const std::array<uint8_t, 6>& dst_address,
+      uint32_t period_in_ms);
+  wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
   // Logger/debug functions.
   std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
   wifi_error startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index a897520..5ac6fa8 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -36,35 +36,378 @@
   // of the object. Whenever the mode changes legacy HAL will remove
   // all of these callbacks.
   legacy_hal::NanCallbackHandlers callback_handlers;
+  android::wp<WifiNanIface> weak_ptr_this(this);
 
   // Callback for response.
-  callback_handlers.on_notify_response = [&](
+  callback_handlers.on_notify_response = [weak_ptr_this](
       legacy_hal::transaction_id id, const legacy_hal::NanResponseMsg& msg) {
-    NanResponseMsgHeader hidl_header;
+    const auto shared_ptr_this = weak_ptr_this.promote();
+    if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+      LOG(ERROR) << "Callback invoked on an invalid object";
+      return;
+    }
+    WifiNanStatus wifiNanStatus;
     if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl(msg,
-                                                                &hidl_header)) {
+                                                                &wifiNanStatus)) {
       LOG(ERROR) << "Failed to convert nan response header";
       return;
     }
-    // TODO: This is a union in the legacy HAL. Need to convert to appropriate
-    // callback based on type.
-    // Assuming |NanPublishResponseMsg| type here.
-    NanPublishResponse hidl_body;
-    if (!hidl_struct_util::convertLegacyNanPublishResponseToHidl(
-            msg.body.publish_response, &hidl_body)) {
-      LOG(ERROR) << "Failed to convert nan publish response";
-      return;
+
+    switch (msg.response_type) {
+    case legacy_hal::NAN_RESPONSE_ENABLED: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyEnableResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
     }
-    NanPublishResponseMsg hidl_msg;
-    hidl_msg.header = hidl_header;
-    hidl_msg.body = hidl_body;
-    for (const auto& callback : event_callbacks_) {
-      if (!callback->notifyPublishResponse(id, hidl_msg).getStatus().isOk()) {
-        LOG(ERROR) << "Failed to invoke the callback";
-      }
+    case legacy_hal::NAN_RESPONSE_DISABLED: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyDisableResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_PUBLISH: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyStartPublishResponse(id, wifiNanStatus,
+                        msg.body.publish_response.publish_id).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyStopPublishResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyTransmitFollowupResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_SUBSCRIBE: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyStartSubscribeResponse(id, wifiNanStatus,
+                        msg.body.subscribe_response.subscribe_id).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyStopSubscribeResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_CONFIG: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyConfigResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+     }
+    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyBeaconSdfPayloadResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+     }
+    case legacy_hal::NAN_GET_CAPABILITIES: {
+        NanCapabilities hidl_struct;
+        if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl(
+                msg.body.nan_capabilities, &hidl_struct)) {
+            LOG(ERROR) << "Failed to convert nan capabilities response";
+            return;
+        }
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyCapabilitiesResponse(id, wifiNanStatus,
+                                                    hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_DP_INTERFACE_CREATE: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyCreateDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_DP_INTERFACE_DELETE: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyDeleteDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_DP_INITIATOR_RESPONSE: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_DP_RESPONDER_RESPONSE: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus,
+                    msg.body.data_request_response.ndp_instance_id).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_DP_END: {
+        for (const auto& callback : shared_ptr_this->event_callbacks_) {
+          if (!callback->notifyTerminateDataPathResponse(id, wifiNanStatus).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+          }
+        }
+    }
+    case legacy_hal::NAN_RESPONSE_TCA:
+        /* fall through */
+    case legacy_hal::NAN_RESPONSE_STATS:
+        /* fall through */
+    case legacy_hal::NAN_RESPONSE_ERROR:
+        /* fall through */
+    default:
+        LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type;
+        return;
     }
   };
-  // TODO: Register the remaining callbacks.
+
+  callback_handlers.on_event_disc_eng_event = [weak_ptr_this](
+        const legacy_hal::NanDiscEngEventInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanClusterEventInd hidl_struct;
+      // event types defined identically - hence can be cast
+      hidl_struct.eventType = (NanClusterEventType) msg.event_type;
+      hidl_struct.addr = msg.data.mac_addr.addr;
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventClusterEvent(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_disabled = [weak_ptr_this](
+        const legacy_hal::NanDisabledInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      WifiNanStatus status;
+      status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+      status.description = msg.nan_reason;
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventDisabled(status).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_publish_terminated = [weak_ptr_this](
+        const legacy_hal::NanPublishTerminatedInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      WifiNanStatus status;
+      status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+      status.description = msg.nan_reason;
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_subscribe_terminated = [weak_ptr_this](
+        const legacy_hal::NanSubscribeTerminatedInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      WifiNanStatus status;
+      status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+      status.description = msg.nan_reason;
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_match = [weak_ptr_this](
+        const legacy_hal::NanMatchInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanMatchInd hidl_struct;
+      if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(
+            msg, &hidl_struct)) {
+          LOG(ERROR) << "Failed to convert nan capabilities response";
+          return;
+      }
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventMatch(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_match_expired = [weak_ptr_this](
+        const legacy_hal::NanMatchExpiredInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventMatchExpired(msg.publish_subscribe_id,
+                msg.requestor_instance_id).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_followup = [weak_ptr_this](
+        const legacy_hal::NanFollowupInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanFollowupReceivedInd hidl_struct;
+      if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl(
+            msg, &hidl_struct)) {
+          LOG(ERROR) << "Failed to convert nan capabilities response";
+          return;
+      }
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventFollowupReceived(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_transmit_follow_up = [weak_ptr_this](
+        const legacy_hal::NanTransmitFollowupInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      WifiNanStatus status;
+      status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+      status.description = msg.nan_reason;
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventTransmitFollowup(msg.id, status).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_data_path_request = [weak_ptr_this](
+        const legacy_hal::NanDataPathRequestInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanDataPathRequestInd hidl_struct;
+      if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl(
+            msg, &hidl_struct)) {
+          LOG(ERROR) << "Failed to convert nan capabilities response";
+          return;
+      }
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventDataPathRequest(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_data_path_confirm = [weak_ptr_this](
+        const legacy_hal::NanDataPathConfirmInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanDataPathConfirmInd hidl_struct;
+      if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(
+            msg, &hidl_struct)) {
+          LOG(ERROR) << "Failed to convert nan capabilities response";
+          return;
+      }
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventDataPathConfirm(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
+  callback_handlers.on_event_data_path_end = [weak_ptr_this](
+        const legacy_hal::NanDataPathEndInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        for (int i = 0; i < msg.num_ndp_instances; ++i) {
+            if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) {
+                LOG(ERROR) << "Failed to invoke the callback";
+            }
+        }
+      }
+  };
+
+  callback_handlers.on_event_beacon_sdf_payload = [weak_ptr_this](
+        const legacy_hal::NanBeaconSdfPayloadInd& msg) {
+      const auto shared_ptr_this = weak_ptr_this.promote();
+      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+        LOG(ERROR) << "Callback invoked on an invalid object";
+        return;
+      }
+      NanBeaconSdfPayloadInd hidl_struct;
+      if (!hidl_struct_util::convertLegacyNanBeaconSdfPayloadIndToHidl(
+            msg, &hidl_struct)) {
+          LOG(ERROR) << "Failed to convert nan capabilities response";
+          return;
+      }
+
+      for (const auto& callback : shared_ptr_this->event_callbacks_) {
+        if (!callback->eventBeaconSdfPayload(hidl_struct).isOk()) {
+            LOG(ERROR) << "Failed to invoke the callback";
+        }
+      }
+  };
+
   legacy_hal::wifi_error legacy_status =
       legacy_hal_.lock()->nanRegisterCallbackHandlers(callback_handlers);
   if (legacy_status != legacy_hal::WIFI_SUCCESS) {
@@ -90,6 +433,13 @@
                          hidl_status_cb);
 }
 
+Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::getTypeInternal,
+                         hidl_status_cb);
+}
+
 Return<void> WifiNanIface::registerEventCallback(
     const sp<IWifiNanIfaceEventCallback>& callback,
     registerEventCallback_cb hidl_status_cb) {
@@ -100,7 +450,16 @@
                          callback);
 }
 
-Return<void> WifiNanIface::enableRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::getCapabilitiesRequest(uint16_t cmd_id,
+                                                  getCapabilitiesRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::getCapabilitiesRequestInternal,
+                         hidl_status_cb,
+                         cmd_id);
+}
+
+Return<void> WifiNanIface::enableRequest(uint16_t cmd_id,
                                          const NanEnableRequest& msg,
                                          enableRequest_cb hidl_status_cb) {
   return validateAndCall(this,
@@ -111,75 +470,7 @@
                          msg);
 }
 
-Return<void> WifiNanIface::disableRequest(uint32_t cmd_id,
-                                          disableRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::disableRequestInternal,
-                         hidl_status_cb,
-                         cmd_id);
-}
-
-Return<void> WifiNanIface::publishRequest(uint32_t cmd_id,
-                                          const NanPublishRequest& msg,
-                                          publishRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::publishRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::publishCancelRequest(
-    uint32_t cmd_id,
-    const NanPublishCancelRequest& msg,
-    publishCancelRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::publishCancelRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::subscribeRequest(
-    uint32_t cmd_id,
-    const NanSubscribeRequest& msg,
-    subscribeRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::subscribeRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::subscribeCancelRequest(
-    uint32_t cmd_id,
-    const NanSubscribeCancelRequest& msg,
-    subscribeCancelRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::subscribeCancelRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::transmitFollowupRequest(
-    uint32_t cmd_id,
-    const NanTransmitFollowupRequest& msg,
-    transmitFollowupRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::transmitFollowupRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::configRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::configRequest(uint16_t cmd_id,
                                          const NanConfigRequest& msg,
                                          configRequest_cb hidl_status_cb) {
   return validateAndCall(this,
@@ -190,8 +481,134 @@
                          msg);
 }
 
+Return<void> WifiNanIface::disableRequest(uint16_t cmd_id,
+                                          disableRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::disableRequestInternal,
+                         hidl_status_cb,
+                         cmd_id);
+}
+
+Return<void> WifiNanIface::startPublishRequest(uint16_t cmd_id,
+                                               const NanPublishRequest& msg,
+                                               startPublishRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::startPublishRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         msg);
+}
+
+Return<void> WifiNanIface::stopPublishRequest(
+    uint16_t cmd_id,
+    uint16_t sessionId,
+    stopPublishRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::stopPublishRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         sessionId);
+}
+
+Return<void> WifiNanIface::startSubscribeRequest(
+    uint16_t cmd_id,
+    const NanSubscribeRequest& msg,
+    startSubscribeRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::startSubscribeRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         msg);
+}
+
+Return<void> WifiNanIface::stopSubscribeRequest(
+    uint16_t cmd_id,
+    uint16_t sessionId,
+    stopSubscribeRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::stopSubscribeRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         sessionId);
+}
+
+Return<void> WifiNanIface::transmitFollowupRequest(
+    uint16_t cmd_id,
+    const NanTransmitFollowupRequest& msg,
+    transmitFollowupRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::transmitFollowupRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         msg);
+}
+
+Return<void> WifiNanIface::createDataInterfaceRequest(
+    uint16_t cmd_id,
+    const hidl_string& iface_name,
+    createDataInterfaceRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::createDataInterfaceRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         iface_name);
+}
+
+Return<void> WifiNanIface::deleteDataInterfaceRequest(
+    uint16_t cmd_id,
+    const hidl_string& iface_name,
+    deleteDataInterfaceRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::deleteDataInterfaceRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         iface_name);
+}
+
+Return<void> WifiNanIface::initiateDataPathRequest(
+    uint16_t cmd_id,
+    const NanInitiateDataPathRequest& msg,
+    initiateDataPathRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::initiateDataPathRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         msg);
+}
+
+Return<void> WifiNanIface::respondToDataPathIndicationRequest(
+    uint16_t cmd_id,
+    const NanRespondToDataPathIndicationRequest& msg,
+    respondToDataPathIndicationRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::respondToDataPathIndicationRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         msg);
+}
+
+Return<void> WifiNanIface::terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId,
+    terminateDataPathRequest_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiNanIface::terminateDataPathRequestInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         ndpInstanceId);
+}
+
 Return<void> WifiNanIface::beaconSdfPayloadRequest(
-    uint32_t cmd_id,
+    uint16_t cmd_id,
     const NanBeaconSdfPayloadRequest& msg,
     beaconSdfPayloadRequest_cb hidl_status_cb) {
   return validateAndCall(this,
@@ -202,88 +619,6 @@
                          msg);
 }
 
-Return<void> WifiNanIface::getVersion(getVersion_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::getVersionInternal,
-                         hidl_status_cb);
-}
-
-Return<void> WifiNanIface::getCapabilities(uint32_t cmd_id,
-                                           getCapabilities_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::getCapabilitiesInternal,
-                         hidl_status_cb,
-                         cmd_id);
-}
-
-Return<void> WifiNanIface::dataInterfaceCreate(
-    uint32_t cmd_id,
-    const hidl_string& iface_name,
-    dataInterfaceCreate_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::dataInterfaceCreateInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         iface_name);
-}
-
-Return<void> WifiNanIface::dataInterfaceDelete(
-    uint32_t cmd_id,
-    const hidl_string& iface_name,
-    dataInterfaceDelete_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::dataInterfaceDeleteInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         iface_name);
-}
-
-Return<void> WifiNanIface::dataRequestInitiator(
-    uint32_t cmd_id,
-    const NanDataPathInitiatorRequest& msg,
-    dataRequestInitiator_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::dataRequestInitiatorInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::dataIndicationResponse(
-    uint32_t cmd_id,
-    const NanDataPathIndicationResponse& msg,
-    dataIndicationResponse_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::dataIndicationResponseInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::dataEnd(uint32_t cmd_id,
-                                   const NanDataPathEndRequest& msg,
-                                   dataEnd_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::dataEndInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
-Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::getTypeInternal,
-                         hidl_status_cb);
-}
-
 std::pair<WifiStatus, std::string> WifiNanIface::getNameInternal() {
   return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -294,16 +629,24 @@
 
 WifiStatus WifiNanIface::registerEventCallbackInternal(
     const sp<IWifiNanIfaceEventCallback>& callback) {
-  // TODO(b/31632518): remove the callback when the client is destroyed
+  // TODO(b/31632518): remove the callback when the client is destroyed and/or
+  // make sure that the same callback is only registered once (i.e. detect duplicates)
+  // OR: consider having a single listener - not clear why multiple listeners (managers) are
+  // necessary, nor how they would coordinate (at least command IDs).
   event_callbacks_.emplace_back(callback);
   return createWifiStatus(WifiStatusCode::SUCCESS);
 }
 
-WifiStatus WifiNanIface::enableRequestInternal(uint32_t cmd_id,
+WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t cmd_id) {
+  legacy_hal::wifi_error legacy_status =
+        legacy_hal_.lock()->nanGetCapabilities(cmd_id);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::enableRequestInternal(uint16_t cmd_id,
                                                const NanEnableRequest& msg) {
   legacy_hal::NanEnableRequest legacy_msg;
-  if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg,
-                                                             &legacy_msg)) {
+  if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg, &legacy_msg)) {
     return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
   }
   legacy_hal::wifi_error legacy_status =
@@ -311,14 +654,26 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiNanIface::disableRequestInternal(uint32_t cmd_id) {
+WifiStatus WifiNanIface::configRequestInternal(
+    uint16_t cmd_id, const NanConfigRequest& msg) {
+  legacy_hal::NanConfigRequest legacy_msg;
+  if (!hidl_struct_util::convertHidlNanConfigRequestToLegacy(msg,
+                                                             &legacy_msg)) {
+    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+  }
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanConfigRequest(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) {
   legacy_hal::wifi_error legacy_status =
       legacy_hal_.lock()->nanDisableRequest(cmd_id);
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiNanIface::publishRequestInternal(uint32_t cmd_id,
-                                                const NanPublishRequest& msg) {
+WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t cmd_id,
+                                                     const NanPublishRequest& msg) {
   legacy_hal::NanPublishRequest legacy_msg;
   if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg,
                                                               &legacy_msg)) {
@@ -329,20 +684,17 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiNanIface::publishCancelRequestInternal(
-    uint32_t cmd_id, const NanPublishCancelRequest& msg) {
+WifiStatus WifiNanIface::stopPublishRequestInternal(
+    uint16_t cmd_id, uint16_t sessionId) {
   legacy_hal::NanPublishCancelRequest legacy_msg;
-  if (!hidl_struct_util::convertHidlNanPublishCancelRequestToLegacy(
-          msg, &legacy_msg)) {
-    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
-  }
+  legacy_msg.publish_id = sessionId;
   legacy_hal::wifi_error legacy_status =
       legacy_hal_.lock()->nanPublishCancelRequest(cmd_id, legacy_msg);
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiNanIface::subscribeRequestInternal(
-    uint32_t cmd_id, const NanSubscribeRequest& msg) {
+WifiStatus WifiNanIface::startSubscribeRequestInternal(
+    uint16_t cmd_id, const NanSubscribeRequest& msg) {
   legacy_hal::NanSubscribeRequest legacy_msg;
   if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg,
                                                                 &legacy_msg)) {
@@ -353,59 +705,81 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiNanIface::subscribeCancelRequestInternal(
-    uint32_t /* cmd_id */, const NanSubscribeCancelRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
+WifiStatus WifiNanIface::stopSubscribeRequestInternal(
+    uint16_t cmd_id, uint16_t sessionId) {
+  legacy_hal::NanSubscribeCancelRequest legacy_msg;
+  legacy_msg.subscribe_id = sessionId;
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanSubscribeCancelRequest(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
 }
+
 WifiStatus WifiNanIface::transmitFollowupRequestInternal(
-    uint32_t /* cmd_id */, const NanTransmitFollowupRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
+    uint16_t cmd_id, const NanTransmitFollowupRequest& msg) {
+  legacy_hal::NanTransmitFollowupRequest legacy_msg;
+  if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) {
+    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+  }
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanTransmitFollowupRequest(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
 }
-WifiStatus WifiNanIface::configRequestInternal(
-    uint32_t /* cmd_id */, const NanConfigRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
+
+WifiStatus WifiNanIface::createDataInterfaceRequestInternal(
+    uint16_t cmd_id, const std::string& iface_name) {
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanDataInterfaceCreate(cmd_id, iface_name);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(
+    uint16_t cmd_id, const std::string& iface_name) {
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanDataInterfaceDelete(cmd_id, iface_name);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::initiateDataPathRequestInternal(
+    uint16_t cmd_id, const NanInitiateDataPathRequest& msg) {
+  legacy_hal::NanDataPathInitiatorRequest legacy_msg;
+  if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) {
+    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+  }
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanDataRequestInitiator(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal(
+    uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) {
+  legacy_hal::NanDataPathIndicationResponse legacy_msg;
+  if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) {
+    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+  }
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanDataIndicationResponse(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::terminateDataPathRequestInternal(
+    uint16_t cmd_id, uint32_t ndpInstanceId) {
+  legacy_hal::NanDataPathEndRequest* legacy_msg = (legacy_hal::NanDataPathEndRequest*)malloc(
+      sizeof(legacy_hal::NanDataPathEndRequest) + sizeof(uint32_t));
+  legacy_msg->num_ndp_instances = 1;
+  legacy_msg->ndp_instance_id[0] = ndpInstanceId;
+
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanDataEnd(cmd_id, *legacy_msg);
+  free(legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
 }
 WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal(
-    uint32_t /* cmd_id */, const NanBeaconSdfPayloadRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
+    uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg) {
+  legacy_hal::NanBeaconSdfPayloadRequest legacy_msg;
+  if (!hidl_struct_util::convertHidlNanBeaconSdfPayloadRequestToLegacy(msg, &legacy_msg)) {
+    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+  }
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->nanBeaconSdfPayloadRequest(cmd_id, legacy_msg);
+  return createWifiStatusFromLegacyError(legacy_status);
 }
-std::pair<WifiStatus, NanVersion> WifiNanIface::getVersionInternal() {
-  // TODO implement
-  return {createWifiStatus(WifiStatusCode::SUCCESS), 0};
-}
-WifiStatus WifiNanIface::getCapabilitiesInternal(uint32_t /* cmd_id */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceCreateInternal(
-    uint32_t /* cmd_id */, const std::string& /* iface_name */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceDeleteInternal(
-    uint32_t /* cmd_id */, const std::string& /* iface_name */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataRequestInitiatorInternal(
-    uint32_t /* cmd_id */, const NanDataPathInitiatorRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataIndicationResponseInternal(
-    uint32_t /* cmd_id */, const NanDataPathIndicationResponse& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataEndInternal(
-    uint32_t /* cmd_id */, const NanDataPathEndRequest& /* msg */) {
-  // TODO implement
-  return createWifiStatus(WifiStatusCode::SUCCESS);
-}
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace wifi
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index 4f89b31..4fae3df 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -46,58 +46,50 @@
   Return<void> registerEventCallback(
       const sp<IWifiNanIfaceEventCallback>& callback,
       registerEventCallback_cb hidl_status_cb) override;
-  Return<void> enableRequest(uint32_t cmd_id,
+  Return<void> getCapabilitiesRequest(uint16_t cmd_id,
+                                      getCapabilitiesRequest_cb hidl_status_cb) override;
+  Return<void> enableRequest(uint16_t cmd_id,
                              const NanEnableRequest& msg,
                              enableRequest_cb hidl_status_cb) override;
-  Return<void> disableRequest(uint32_t cmd_id,
-                              disableRequest_cb hidl_status_cb) override;
-  Return<void> publishRequest(uint32_t cmd_id,
-                              const NanPublishRequest& msg,
-                              publishRequest_cb hidl_status_cb) override;
-  Return<void> publishCancelRequest(
-      uint32_t cmd_id,
-      const NanPublishCancelRequest& msg,
-      publishCancelRequest_cb hidl_status_cb) override;
-  Return<void> subscribeRequest(uint32_t cmd_id,
-                                const NanSubscribeRequest& msg,
-                                subscribeRequest_cb hidl_status_cb) override;
-  Return<void> subscribeCancelRequest(
-      uint32_t cmd_id,
-      const NanSubscribeCancelRequest& msg,
-      subscribeCancelRequest_cb hidl_status_cb) override;
-  Return<void> transmitFollowupRequest(
-      uint32_t cmd_id,
-      const NanTransmitFollowupRequest& msg,
-      transmitFollowupRequest_cb hidl_status_cb) override;
-  Return<void> configRequest(uint32_t cmd_id,
+  Return<void> configRequest(uint16_t cmd_id,
                              const NanConfigRequest& msg,
                              configRequest_cb hidl_status_cb) override;
-  Return<void> beaconSdfPayloadRequest(
-      uint32_t cmd_id,
-      const NanBeaconSdfPayloadRequest& msg,
-      beaconSdfPayloadRequest_cb hidl_status_cb) override;
-  Return<void> getVersion(getVersion_cb hidl_status_cb) override;
-  Return<void> getCapabilities(uint32_t cmd_id,
-                               getCapabilities_cb hidl_status_cb) override;
-  Return<void> dataInterfaceCreate(
-      uint32_t cmd_id,
-      const hidl_string& iface_name,
-      dataInterfaceCreate_cb hidl_status_cb) override;
-  Return<void> dataInterfaceDelete(
-      uint32_t cmd_id,
-      const hidl_string& iface_name,
-      dataInterfaceDelete_cb hidl_status_cb) override;
-  Return<void> dataRequestInitiator(
-      uint32_t cmd_id,
-      const NanDataPathInitiatorRequest& msg,
-      dataRequestInitiator_cb hidl_status_cb) override;
-  Return<void> dataIndicationResponse(
-      uint32_t cmd_id,
-      const NanDataPathIndicationResponse& msg,
-      dataIndicationResponse_cb hidl_status_cb) override;
-  Return<void> dataEnd(uint32_t cmd_id,
-                       const NanDataPathEndRequest& msg,
-                       dataEnd_cb hidl_status_cb) override;
+  Return<void> disableRequest(uint16_t cmd_id,
+                              disableRequest_cb hidl_status_cb) override;
+  Return<void> startPublishRequest(uint16_t cmd_id,
+                                   const NanPublishRequest& msg,
+                                   startPublishRequest_cb hidl_status_cb) override;
+  Return<void> stopPublishRequest(uint16_t cmd_id,
+                                  uint16_t sessionId,
+                                  stopPublishRequest_cb hidl_status_cb) override;
+  Return<void> startSubscribeRequest(uint16_t cmd_id,
+                                     const NanSubscribeRequest& msg,
+                                    startSubscribeRequest_cb hidl_status_cb) override;
+  Return<void> stopSubscribeRequest(uint16_t cmd_id,
+                                    uint16_t sessionId,
+                                    stopSubscribeRequest_cb hidl_status_cb) override;
+  Return<void> transmitFollowupRequest(uint16_t cmd_id,
+                                       const NanTransmitFollowupRequest& msg,
+                                       transmitFollowupRequest_cb hidl_status_cb) override;
+  Return<void> createDataInterfaceRequest(uint16_t cmd_id,
+                                          const hidl_string& iface_name,
+                                          createDataInterfaceRequest_cb hidl_status_cb) override;
+  Return<void> deleteDataInterfaceRequest(uint16_t cmd_id,
+                                          const hidl_string& iface_name,
+                                          deleteDataInterfaceRequest_cb hidl_status_cb) override;
+  Return<void> initiateDataPathRequest(uint16_t cmd_id,
+                                       const NanInitiateDataPathRequest& msg,
+                                       initiateDataPathRequest_cb hidl_status_cb) override;
+  Return<void> respondToDataPathIndicationRequest(
+      uint16_t cmd_id,
+      const NanRespondToDataPathIndicationRequest& msg,
+      respondToDataPathIndicationRequest_cb hidl_status_cb) override;
+  Return<void> terminateDataPathRequest(uint16_t cmd_id,
+                                        uint32_t ndpInstanceId,
+                                        terminateDataPathRequest_cb hidl_status_cb) override;
+  Return<void> beaconSdfPayloadRequest(uint16_t cmd_id,
+                                       const NanBeaconSdfPayloadRequest& msg,
+                                       beaconSdfPayloadRequest_cb hidl_status_cb) override;
 
  private:
   // Corresponding worker functions for the HIDL methods.
@@ -105,34 +97,32 @@
   std::pair<WifiStatus, IfaceType> getTypeInternal();
   WifiStatus registerEventCallbackInternal(
       const sp<IWifiNanIfaceEventCallback>& callback);
-  WifiStatus enableRequestInternal(uint32_t cmd_id,
+  WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id);
+  WifiStatus enableRequestInternal(uint16_t cmd_id,
                                    const NanEnableRequest& msg);
-  WifiStatus disableRequestInternal(uint32_t cmd_id);
-  WifiStatus publishRequestInternal(uint32_t cmd_id,
-                                    const NanPublishRequest& msg);
-  WifiStatus publishCancelRequestInternal(uint32_t cmd_id,
-                                          const NanPublishCancelRequest& msg);
-  WifiStatus subscribeRequestInternal(uint32_t cmd_id,
-                                      const NanSubscribeRequest& msg);
-  WifiStatus subscribeCancelRequestInternal(
-      uint32_t cmd_id, const NanSubscribeCancelRequest& msg);
-  WifiStatus transmitFollowupRequestInternal(
-      uint32_t cmd_id, const NanTransmitFollowupRequest& msg);
-  WifiStatus configRequestInternal(uint32_t cmd_id,
+  WifiStatus configRequestInternal(uint16_t cmd_id,
                                    const NanConfigRequest& msg);
+  WifiStatus disableRequestInternal(uint16_t cmd_id);
+  WifiStatus startPublishRequestInternal(uint16_t cmd_id,
+                                         const NanPublishRequest& msg);
+  WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+  WifiStatus startSubscribeRequestInternal(uint16_t cmd_id,
+                                           const NanSubscribeRequest& msg);
+  WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+  WifiStatus transmitFollowupRequestInternal(
+      uint16_t cmd_id, const NanTransmitFollowupRequest& msg);
+  WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id,
+                                                const std::string& iface_name);
+  WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id,
+                                                const std::string& iface_name);
+  WifiStatus initiateDataPathRequestInternal(
+      uint16_t cmd_id, const NanInitiateDataPathRequest& msg);
+  WifiStatus respondToDataPathIndicationRequestInternal(
+      uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg);
+  WifiStatus terminateDataPathRequestInternal(
+      uint16_t cmd_id, uint32_t ndpInstanceId);
   WifiStatus beaconSdfPayloadRequestInternal(
-      uint32_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
-  std::pair<WifiStatus, NanVersion> getVersionInternal();
-  WifiStatus getCapabilitiesInternal(uint32_t cmd_id);
-  WifiStatus dataInterfaceCreateInternal(uint32_t cmd_id,
-                                         const std::string& iface_name);
-  WifiStatus dataInterfaceDeleteInternal(uint32_t cmd_id,
-                                         const std::string& iface_name);
-  WifiStatus dataRequestInitiatorInternal(
-      uint32_t cmd_id, const NanDataPathInitiatorRequest& msg);
-  WifiStatus dataIndicationResponseInternal(
-      uint32_t cmd_id, const NanDataPathIndicationResponse& msg);
-  WifiStatus dataEndInternal(uint32_t cmd_id, const NanDataPathEndRequest& msg);
+      uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
 
   std::string ifname_;
   std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index e48978e..a00c5bc 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -212,6 +212,44 @@
                          state);
 }
 
+Return<void> WifiStaIface::enableNdOffload(bool enable,
+                                           enableNdOffload_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiStaIface::enableNdOffloadInternal,
+                         hidl_status_cb,
+                         enable);
+}
+
+Return<void> WifiStaIface::startSendingKeepAlivePackets(
+    uint32_t cmd_id,
+    const hidl_vec<uint8_t>& ip_packet_data,
+    uint16_t ether_type,
+    const hidl_array<uint8_t, 6>& src_address,
+    const hidl_array<uint8_t, 6>& dst_address,
+    uint32_t period_in_ms,
+    startSendingKeepAlivePackets_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiStaIface::startSendingKeepAlivePacketsInternal,
+                         hidl_status_cb,
+                         cmd_id,
+                         ip_packet_data,
+                         ether_type,
+                         src_address,
+                         dst_address,
+                         period_in_ms);
+}
+
+Return<void> WifiStaIface::stopSendingKeepAlivePackets(
+    uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiStaIface::stopSendingKeepAlivePacketsInternal,
+                         hidl_status_cb,
+                         cmd_id);
+}
+
 Return<void> WifiStaIface::startDebugPacketFateMonitoring(
     startDebugPacketFateMonitoring_cb hidl_status_cb) {
   return validateAndCall(this,
@@ -498,6 +536,31 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
+WifiStatus WifiStaIface::enableNdOffloadInternal(bool enable) {
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->configureNdOffload(enable);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::startSendingKeepAlivePacketsInternal(
+    uint32_t cmd_id,
+    const std::vector<uint8_t>& ip_packet_data,
+    uint16_t /* ether_type */,
+    const std::array<uint8_t, 6>& src_address,
+    const std::array<uint8_t, 6>& dst_address,
+    uint32_t period_in_ms) {
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->startSendingOffloadedPacket(
+          cmd_id, ip_packet_data, src_address, dst_address, period_in_ms);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(uint32_t cmd_id) {
+  legacy_hal::wifi_error legacy_status =
+      legacy_hal_.lock()->stopSendingOffloadedPacket(cmd_id);
+  return createWifiStatusFromLegacyError(legacy_status);
+}
+
 WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() {
   legacy_hal::wifi_error legacy_status =
       legacy_hal_.lock()->startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h
index 90126cd..311c991 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.0/default/wifi_sta_iface.h
@@ -83,6 +83,18 @@
                                 configureRoaming_cb hidl_status_cb) override;
   Return<void> setRoamingState(StaRoamingState state,
                                setRoamingState_cb hidl_status_cb) override;
+  Return<void> enableNdOffload(bool enable,
+                               enableNdOffload_cb hidl_status_cb) override;
+  Return<void> startSendingKeepAlivePackets(
+      uint32_t cmd_id,
+      const hidl_vec<uint8_t>& ip_packet_data,
+      uint16_t ether_type,
+      const hidl_array<uint8_t, 6>& src_address,
+      const hidl_array<uint8_t, 6>& dst_address,
+      uint32_t period_in_ms,
+      startSendingKeepAlivePackets_cb hidl_status_cb) override;
+  Return<void> stopSendingKeepAlivePackets(
+      uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) override;
   Return<void> startDebugPacketFateMonitoring(
       startDebugPacketFateMonitoring_cb hidl_status_cb) override;
   Return<void> stopDebugPacketFateMonitoring(
@@ -121,6 +133,15 @@
   getRoamingCapabilitiesInternal();
   WifiStatus configureRoamingInternal(const StaRoamingConfig& config);
   WifiStatus setRoamingStateInternal(StaRoamingState state);
+  WifiStatus enableNdOffloadInternal(bool enable);
+  WifiStatus startSendingKeepAlivePacketsInternal(
+      uint32_t cmd_id,
+      const std::vector<uint8_t>& ip_packet_data,
+      uint16_t ether_type,
+      const std::array<uint8_t, 6>& src_address,
+      const std::array<uint8_t, 6>& dst_address,
+      uint32_t period_in_ms);
+  WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id);
   WifiStatus startDebugPacketFateMonitoringInternal();
   WifiStatus stopDebugPacketFateMonitoringInternal();
   std::pair<WifiStatus, std::vector<WifiDebugTxPacketFateReport>>
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 76c89e3..edf306d 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -254,7 +254,7 @@
  * Bands that can be specified in Background scan requests.
  */
 enum StaBackgroundScanBand : uint32_t {
-  BAND_UNSPECIFIED,
+  BAND_UNSPECIFIED = 0,
   /**
    * 2.4 GHz.
    */
@@ -325,10 +325,10 @@
    */
   uint32_t periodInMs;
   /**
-   * Bitset of |BackgroundScanBucketEventReportSchemeMask| values controlling
+   * Bitset of |StaBackgroundScanBucketEventReportSchemeMask| values controlling
    * when events for this bucket must be reported.
    */
-  uint32_t eventReportScheme;
+  bitfield<StaBackgroundScanBucketEventReportSchemeMask> eventReportScheme;
   /**
    * For exponential back off. If |exponentialMaxPeriodInMs| is non zero or
    * different than period, then this bucket is an exponential backoff bucket
@@ -503,7 +503,7 @@
   /**
    * Bitset containing |ScanDataFlagMask| values.
    */
-  uint32_t flags;
+  bitfield<StaScanDataFlagMask> flags;
   /**
    * Bitset where each bit indicates if the bucket with that index was
    * scanned.
@@ -563,148 +563,77 @@
  * NAN specific types.
  * TODO(b/32159498): Move to a separate nan_types.hal.
  */
+
 /**
- * Various max sizes used in the NAN interface.
+ * A unique short handle provided by the client to identify individual invocations of
+ * certain API's like |IWifiNanIface.*|.
  */
-enum NanMaxSize : uint32_t {
-  SOCIAL_CHANNELS = 3,
-  SERVICE_NAME_LEN = 255,
-  MATCH_FILTER_LEN = 255,
-  SERVICE_SPECIFIC_INFO_LEN = 1024,
-  VSA_DATA_LEN = 1024,
-  MESH_DATA_LEN = 32,
-  INFRA_DATA_LEN = 32,
-  CLUSTER_ATTRIBUTE_LEN = 255,
-  SUBSCRIBE_MAX_ADDRESS = 42,
-  FAM_CHANNELS = 32,
-  POSTDISCOVERY_LEN = 5,
-  FRAME_DATA_LEN = 504,
-  DP_APP_INFO_LEN = 512,
+typedef uint16_t CommandIdShort;
+
+/**
+ * NAN API response codes used in request notifications and events.
+ */
+enum NanStatusType : uint32_t {
+  SUCCESS = 0,
+  /* NAN Discovery Engine/Host driver failures */
+  INTERNAL_FAILURE = 1,
+  /* NAN OTA failures */
+  PROTOCOL_FAILURE = 2,
+  /* The publish/subscribe discovery session id is invalid */
+  INVALID_SESSION_ID = 3,
+  /* Out of resources to fufill request */
+  NO_RESOURCES_AVAILABLE = 4,
+  /* Invalid arguments passed */
+  INVALID_ARGS = 5,
+  /* Invalid peer id */
+  INVALID_PEER_ID = 6,
+  /* Invalid NAN data-path (ndp) id */
+  INVALID_NDP_ID = 7,
+  /* Attempting to enable NAN when not available, e.g. wifi is disabled */
+  NAN_NOT_ALLOWED = 8,
+  /* Over the air ACK not received */
+  NO_OTA_ACK = 9,
+  /* Attempting to enable NAN when already enabled */
+  ALREADY_ENABLED = 10,
+  /* Can't queue tx followup message foor transmission */
+  FOLLOWUP_TX_QUEUE_FULL = 11,
+  /* Unsupported concurrency of NAN and another feature - NAN disabled */
+  UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
 };
 
 /**
- * NAN protocol Version info.
+ * The discovery bands supported by NAN.
  */
-typedef int32_t NanVersion;
-
-/**
- * NAN data path identifiers.
- */
-typedef uint32_t NanDataPathId;
-
-/**
- * Data request Initiator/Responder app/service related info.
- */
-struct NanDataPathAppInfo {
-  /**
-   * Max length: |MAX_DP_APP_INFO_LEN|.
-   */
-  vec<uint8_t> ndpAppInfo;
+enum NanBandIndex : uint32_t {
+  NAN_BAND_24GHZ = 0,
+  NAN_BAND_5GHZ
 };
 
 /**
- * Configuration params of Data request Initiator/Responder.
+ * The status information returned in NAN notifications.
  */
-struct NanDataPathCfg {
+struct WifiNanStatus {
   /**
-   * Indicates whether to use Security/No Security.
+   * Status of the command request.
    */
-  bool useSecurity;
+  NanStatusType status;
   /**
-   * Indicating whether to use QOS/No QOS.
+   * Further description of the issue causing a failure.
    */
-  bool useQos;
+  string description;
 };
 
 /**
- * Indicates the availability interval duration associated with the
- * Availability Intervals Bitmap field
+ * NAN Match indication type.
  */
-enum NanAvailDuration : uint32_t {
-  DURATION_16MS = 0,
-  DURATION_32MS = 1,
-  DURATION_64MS = 2,
+enum NanMatchAlg : uint32_t {
+  MATCH_ONCE = 0,
+  MATCH_CONTINUOUS,
+  MATCH_NEVER,
 };
 
 /**
- * Possible connection types in Post NAN Discovery attributes.
- */
-enum NanConnectionType : uint32_t {
-  WLAN_INFRA = 0,
-  P2P_OPER = 1,
-  WLAN_IBSS = 2,
-  WLAN_MESH = 3,
-  FURTHER_SERVICE_AVAILABILITY = 4,
-  WLAN_RANGING = 5,
-};
-
-/**
- * Possible device roles in Post NAN Discovery attributes.
- */
-enum NanDeviceRole : uint32_t {
-  WLAN_INFRA_AP = 0,
-  WLAN_INFRA_STA = 1,
-  P2P_OPER_GO = 2,
-  P2P_OPER_DEV = 3,
-  P2P_OPER_CLI = 4,
-};
-
-/**
- * Data request Responder's response.
- */
-enum NanDataPathResponseCode : uint32_t {
-  ACCEPT = 0,
-  REJECT,
-};
-
-/**
- * Further availability per channel information.
- */
-struct NanFurtherAvailabilityChannel {
-  /**
-   * Defined above.
-   */
-  NanAvailDuration entryControl;
-  /**
-   * 1 byte field indicating the frequency band the NAN Device
-   * must be available as defined in IEEE Std. 802.11-2012
-   * Annex E Table E-4 Global Operating Classes
-   */
-  uint8_t classVal;
-  /**
-   * 1 byte field indicating the channel the NAN Device
-   * must be available.
-   */
-  uint8_t channel;
-  /**
-   * Map Id - 4 bit field which identifies the Further
-   * availability map attribute.
-   */
-  uint8_t mapid;
-  /**
-   * Divides the time between the beginnings of consecutive "Discovery
-   * Windows" of a given NAN cluster into consecutive time intervals
-   * of equal durations. The time interval duration is specified by
-   * the |entryControl| field.
-   * A  device that sets the i-th bit of the Availability
-   * Intervals Bitmap to 1 shall be present during the corresponding
-   * i-th time interval in the operation channel indicated by the
-   * Operating Class and Channel Number fields in the same Availability Entry.
-   * A  device that sets the i-th bit of the Availability Intervals Bitmap to
-   * 0 may be present during the corresponding i-th time interval in the operation
-   * channel indicated by the Operating Class and Channel Number fields in the same
-   * Availability Entry.
-   * The size of the Bitmap is dependent upon the Availability Interval Duration
-   * Chosen in the Entry Control Field.  The size can be either 1, 2 or 4 bytes long
-   * - Duration field is equal to 0, only AIB[0] is valid
-   * - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
-   * - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
-   */
-  uint32_t availIntervalBitmap;
-};
-
-/**
- * NAN Publish Types.
+ * NAN publish discovery session types.
  */
 enum NanPublishType : uint32_t {
   UNSOLICITED = 0,
@@ -713,15 +642,8 @@
 };
 
 /**
- * NAN Transmit Priorities.
- */
-enum NanTxPriority : uint32_t {
-  NORMAL = 0,
-  HIGH,
-};
-
-/**
- * NAN Transmit Types.
+ * NAN transmit type used in |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+ * publish discovery sessions.
  */
 enum NanTxType : uint32_t {
   BROADCAST = 0,
@@ -729,7 +651,7 @@
 };
 
 /**
- * NAN Subscribe Type.
+ * NAN subscribe discovery session ypes.
  */
 enum NanSubscribeType : uint32_t {
   PASSIVE = 0,
@@ -745,31 +667,6 @@
 };
 
 /**
- * NAN Service Response Filter Include Bit.
- */
-enum NanSrfIncludeType : uint32_t {
-  DO_NOT_RESPOND = 0,
-  RESPOND,
-};
-
-/**
- * NAN Match indication type.
- */
-enum NanMatchAlg : uint32_t {
-  MATCH_ONCE = 0,
-  MATCH_CONTINUOUS,
-  MATCH_NEVER,
-};
-
-/**
- * NAN Transmit Window Type.
- */
-enum NanTransmitWindowType : uint32_t {
-  DW = 0,
-  FAW,
-};
-
-/**
  * NAN DP channel config options.
  */
 enum NanDataPathChannelCfg : uint32_t {
@@ -779,575 +676,415 @@
 };
 
 /**
- * Host can send Vendor specific attributes which the Discovery Engine can
- * enclose in Beacons and/or Service Discovery frames transmitted.
- * Below structure is used to populate that.
- * TODO(b/32207606): This can be moved to vendor extension.
+ * NAN band-specific configuration.
  */
-struct NanTransmitVendorSpecificAttribute {
+struct NanBandSpecificConfig {
   /**
-   * 0 = transmit only in the next discovery window
-   * 1 = transmit in next 16 discovery window
+   * RSSI values controlling clustering behavior per spec.
    */
-  uint8_t payloadTransmitFlag;
+  uint8_t rssiClose;
+  uint8_t rssiMiddle;
   /**
-   * Below flags must determine in which all frames
-   * the vendor specific attributes must be included
+   * RSSI value determining whether discovery is near (used if enabled in discovery).
    */
-  uint8_t txInDiscoveryBeacon;
-  uint8_t txInSyncBeacon;
-  uint8_t txInServiceDiscovery;
+  uint8_t rssiProximity;
   /**
-   * Organizationally Unique Identifier.
-   */
-  uint32_t vendorOui;
-  /**
-   * Vendor specific attribute to be transmitted.
-   * Max length: |MAX_VSA_DATA_LEN|.
-   */
-  vec<uint8_t> vsa;
-};
-
-/**
- * Host can set the Periodic scan parameters for each of the
- * 3(6, 44, 149) Social channels. Only these channels are allowed
- * any other channels are rejected
- */
- enum NanChannelIndex : uint32_t {
-  CHANNEL_24G_BAND = 0,
-  CHANNEL_5G_BAND_LOW,
-  CHANNEL_5G_BAND_HIGH,
-};
-
-/**
- * Structure to set the Social Channel Scan parameters
- * passed as part of EnableRequest/ConfigRequest.
- */
-struct NanSocialChannelScanParams {
-  /**
-   * Dwell time of each social channel in milliseconds
-   * ChannelIndex corresponds to the respective channel
+   * Dwell time of each discovery channel in milliseconds.
    * If time set to 0 then the FW default time must be used.
-   * Max length: |MAX_SOCIAL_CHANNELS|.
-   * dwellTime[i] refers to the dwell time of the i'th social channel.
    */
-  vec<uint8_t> dwellTime;
+  uint8_t dwellTimeMs;
   /**
-   * Scan period of each social channel in seconds
-   * ChannelIndex corresponds to the respective channel
+   * Scan period of each discovery channel in seconds.
    * If time set to 0 then the FW default time must be used.
-   * Max length: |MAX_SOCIAL_CHANNELS|.
-   * scanPeriod[i] refers to the scan period of the i'th social channel.
    */
-  vec<uint16_t> scanPeriod;
+  uint16_t scanPeriodSec;
+   /**
+    * Specifies the interval for Sync beacons and SDF's.
+    * Valid values of DW Interval are: 1, 2, 3, 4 and 5 corresponding to 1, 2, 4, 8, and 16 DWs.
+    * Value of 0:
+    *  - reserved in 2.4GHz band
+    *  - no wakeup at all in 5GHz band
+    * The publish/subscribe period values don't override the device level configurations if
+    * specified (if 'valid' is true).
+    */
+  bool validDiscoveryWindowIntervalVal;
+  uint8_t discoveryWindowIntervalVal;
 };
 
 /**
- * Enable Request Message Structure
- * The EnableReq message in  structs the Discovery Engine to enter an operational state
+ * Configuration parameters
  */
-struct NanEnableRequest {
+struct NanDebugConfig {
   /**
-   * Mandatory parameters below.
+   * The low and high values of the cluster ID: standard values are 0x0000 - 0xFFFF.
+   * A clusterLow == clusterHigh indicates a request to join or create a cluster with that ID.
+   * Used if 'valid' is true.
    */
-  uint8_t masterPref;
+  bool validClusterIdVals;
+  uint16_t clusterIdLowVal;
+  uint16_t clusterIdHighVal;
   /**
-   * A cluster_low value matching cluster_high indicates a request to join
-   * a cluster with that value. If the requested cluster is not found the
-   * device must start its own cluster.
-   */
-  uint16_t clusterLow;
-  uint16_t clusterHigh;
-  /**
-   * Optional configuration of Enable request.
-   * Each of the optional parameters have configure flag which
-   * determine whether configuration is to be passed or not.
-   */
-  bool validSupport5gVal;
-  uint8_t support5gVal;
-  /**
-   * BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
-   * 0 - Do not include SIDs in any beacons
-   * 1 - Include SIDs in all beacons.
-   * Rest 7 bits are count field which allows control over the number of SIDs
-   * included in the Beacon.  0 means to include as many SIDs that fit into
-   * the maximum allow Beacon frame size
-   */
-  bool validSidBeaconVal;
-  uint8_t sidBeaconVal;
-  /**
-   * The rssi values below must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
-   */
-  bool valid2dot4gRssiCloseVal;
-  uint8_t rssiClose2dot4gVal;
-  bool valid2dot4gRssiMiddleVal;
-  uint8_t rssiMiddle2dot4gVal;
-  bool valid2dot4gRssiProximityVal;
-  uint8_t rssiProximity2dot4gVal;
-  bool validHopCountLimitVal;
-  uint8_t hopCountLimitVal;
-  /**
-   * Defines 2.4G channel access support
-   */
-  bool valid2dot4gSupportVal;
-  bool support2dot4gVal;
-  /**
-   * Defines 2.4G channels must be used for sync/discovery beacons
-   */
-  bool valid2dot4gBeaconsVal;
-  bool beacon2dot4gVal;
-  /**
-   * Defines 2.4G channels must be used for Service Discovery frames
-   */
-  bool valid2dot4gSdfVal;
-  bool sdf2dot4gVal;
-  /**
-   * Defines 5G channels must be used for sync/discovery beacons
-   */
-  bool valid5gBeaconsVal;
-  bool beacon5gVal;
-  /**
-   * Defines 5G channels must be used for Service Discovery frames
-   */
-  bool valid5gSdfVal;
-  bool sdf5gVal;
-  /**
-   * 1 byte value which defines the RSSI in
-   * dBm for a close by Peer in 5 Ghz channels.
-   * The rssi values must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
-   */
-  bool valid5gRssiCloseVal;
-  uint8_t rssiClose5gVal;
-  /**
-   * 1 byte value which defines the RSSI value in
-   * dBm for a close by Peer in 5 Ghz channels.
-   * The rssi values must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
-   */
-  bool valid5gRssiMiddleVal;
-  uint8_t rssiMiddle5gVal;
-  /**
-   * 1 byte value which defines the RSSI filter
-   * threshold.  Any Service Descriptors received above this
-   * value that are configured for RSSI filtering must be dropped.
-   * The rssi values must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
-   */
-  bool valid5gRssiCloseProximityVal;
-  uint8_t rssiCloseProximity5gVal;
-  /**
-   * 1 byte quantity which defines the window size over
-   * which the “average RSSI” must be calculated over.
-   */
-  bool validRssiWindowSizeVal;
-  uint8_t rssiWindowSizeVal;
-  /**
-   * The 24 bit Organizationally Unique ID + the 8 bit Network Id.
-   */
-  uint8_t validOuiVal;
-  uint32_t ouiVal;
-  /**
-   * NAN Interface Address, If not configured the Discovery Engine
-   * must generate a 6 byte Random MAC.
+   * NAN management interface address, If specified ('valid' is true) then overrides any other
+   * configuration (specifically the default randomization).
    */
   bool validIntfAddrVal;
   MacAddress intfAddrVal;
   /**
-   * If set to true, the Discovery Engine must enclose the Cluster
-   * Attribute only sent in Beacons in a Vendor Specific Attribute
-   * and transmit in a Service Descriptor Frame.
+   * The 24 bit Organizationally Unique ID + the 8 bit Network Id. Used if 'valid' is true.
    */
-  bool configClusterAttributeVal;
+  bool validOuiVal;
+  uint32_t ouiVal;
   /**
-   * The periodicity in seconds between full scan’s to find any new
-   * clusters available in the area. A Full scan must not be done
-   * more than every 10 seconds and must not be done less than every
-   * 30 seconds.
-   */
-  bool validScanParamsVal;
-  NanSocialChannelScanParams scanParamsVal;
-  /**
-   * 1 byte quantity which forces the Random Factor to a particular
-   * value for all transmitted Sync/Discovery beacons
+   * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons
+   * if the 'valid' flag is true.
    */
   bool validRandomFactorForceVal;
   uint8_t randomFactorForceVal;
   /**
-   * 1 byte quantity which forces the HC for all transmitted Sync and
-   * Discovery Beacon NO matter the real HC being received over the
-   * air.
+   * Forces the hop-count for all transmitted Sync and Discovery Beacons NO matter the real
+   * hop-count being received over the air. Used if the 'valid' flag is true.
    */
   bool validHopCountForceVal;
   uint8_t hopCountForceVal;
   /**
-   * Channel frequency in MHz to enable  on.
+   * Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
    */
-  bool valid24gChannelVal;
-  WifiChannelInMhz channel24gVal;
-  bool valid5gChannelVal;
-  WifiChannelInMhz channel5gVal;
+  bool validDiscoveryChannelVal;
+  vec<WifiChannelInMhz> discoveryChannelMhzVal;
+  /**
+   * Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
+   * |NanBandIndex|.
+   */
+  bool validUseBeaconsInBandVal;
+  vec<bool> useBeaconsInBandVal;
+  /**
+   * Specified whether SDF (service discovery frames) are transmitted in the specified band. Indexed
+   * by |NanBandIndex|.
+   */
+  bool validUseSdfInBandVal;
+  vec<bool> useSdfInBandVal;
 };
 
+/**
+ * Configuration parameters of NAN: used when enabling and re-configuring a NAN cluster.
+ */
+struct NanConfigRequest {
+  /**
+   * Master preference of this device.
+   */
+  uint8_t masterPref;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+   * for DISCOVERY_MAC_ADDRESS_CHANGED.
+   */
+  bool disableDiscoveryAddressChangeIndication;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+   * for STARTED_CLUSTER.
+   */
+  bool disableStartedClusterIndication;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+   * for JOINED_CLUSTER.
+   */
+  bool disableJoinedClusterIndication;
+  /**
+   * Control whether service IDs are included in Sync/Discovery beacons.
+   */
+  bool includeServiceIdsInBeacon;
+  /**
+   * If |includeServiceIdInBeacon| is true then specifies the number of service IDs to include
+   * in the Sync/Discovery beacons:
+   *  Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
+   *  Value must fit within 7 bits - i.e. <= 127.
+   */
+  uint8_t numberOfServiceIdsInBeacon;
+  /**
+   * Number of samples used to calculate RSSI.
+   */
+  uint16_t rssiWindowSize;
+  /**
+   * Specifies the interval in seconds that the NAN management interface MAC address is randomized.
+   * A value of 0 is used to disable the MAC address randomization
+   */
+  uint32_t macAddressRandomizationIntervalSec;
+  /**
+   * Accept (if true) or not (if false) ranging requests from peers - whether in the context of
+   * discovery or otherwise.
+   */
+  bool acceptRangingRequests;
+  /**
+   * Additional configuration provided per band: indexed by |NanBandIndex|.
+   */
+  vec<NanBandSpecificConfig> bandSpecificConfig;
+};
 
 /**
- * Publish Msg Structure
- * Message is used to request the DE to publish the Service Name
- * using the parameters passed into the "Discovery Window".
+ * Enable requests for NAN: start-up configuration.
+ */
+struct NanEnableRequest {
+  /**
+   * Enable operation in a specific band: indexed by |NanBandIndex|.
+   */
+  vec<bool> operateInBand;
+  /**
+   * Specify extent of cluster by specifying the max hop count.
+   */
+  uint8_t hopCountMax;
+  /**
+   * Configurations of NAN cluster operation. Can also be modified at run-time using
+   * |configRequest|.
+   */
+  NanConfigRequest configParams;
+  /**
+   * Non-standard configurations of NAN cluster operation - useful for debugging opeations.
+   */
+  NanDebugConfig debugConfigs;
+};
+
+/**
+ * Cipher suite flags - to be used as a bitmask.
+ */
+enum NanCipherSuiteType : uint32_t {
+  SHARED_KEY_128_MASK = 1 << 0,
+  SHARED_KEY_256_MASK = 1 << 1
+};
+
+/**
+ * Ranging in the context of discovery sessions indication controls - to be used as a bitmask.
+ */
+enum NanRangingIndication : uint32_t {
+  CONTINUOUS_INDICATION_MASK = 1 << 0,
+  INGRESS_MET_MASK = 1 << 1,
+  EGRESS_MET_MASK = 1 << 2
+};
+
+/**
+ * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
+ */
+struct NanDiscoveryCommonConfig {
+  /**
+   * The ID of the discovery session being configured. A value of 0 specifies a request to create
+   * a new discovery session.
+   */
+  uint16_t sessionId;
+  /**
+   * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
+   * canceled.
+   */
+  uint16_t ttlSec;
+  /**
+   * Indicates the interval between two Discovery Windows in which the device supporting the
+   * service is awake to transmit or receive the Service Discovery frames.
+   * Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1.
+   */
+  uint16_t discoveryWindowPeriod;
+  /**
+   * Number of other-air-air operations (i.e. active transmissions), 0 means forever or until
+   * canceled.
+   */
+  uint8_t discoveryCount;
+  /**
+   * UTF-8 encoded string identifying the service.
+   * Max length: |NanCapabilities.maxServiceNameLen|.
+   */
+  string serviceName;
+  /**
+   * Specifies the matching indication to host: once, continuous, or never.
+   */
+  NanMatchAlg discoveryMatchIndicator;
+  /**
+   * Arbitrary information communicated as part of discovery.
+   * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   */
+  vec<uint8_t> serviceSpecificInfo;
+  /**
+   * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+   * criteria (beyond the service name).
+   * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
+   * Subscriber: used in ACTIVE or PASSIVE sessions.
+   * Max length: |NanCapabilities.maxMatchFilterLen|.
+   */
+  vec<uint8_t> rxMatchFilter;
+  /**
+   * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+   * criteria (beyond the service name).
+   * Publisher: used if provided.
+   * Subscriber: used in ACTIVE sessions.
+   * Max length: |NanCapabilities.maxMatchFilterLen|.
+   */
+  vec<uint8_t> txMatchFilter;
+  /**
+   * Specifies whether or not the discovery session uses the |rssiProximity| value (configured
+   * in enable/configure requests) to filter out matched discovered peers.
+   */
+  bool useRssiThreshold;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish
+   * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe
+   * discovery sessions) will be delivered.
+   */
+  bool disableDiscoveryTerminationIndication;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered.
+   */
+  bool disableMatchExpirationIndication;
+  /**
+   * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be
+   * delivered.
+   */
+  bool disableFollowupReceivedIndication;
+  /**
+   * Cipher types supported in data-paths constructed in the context of this discovery session. The
+   * |NanCipherSuiteType| bit fields are used to set this value.
+   */
+  bitfield<NanCipherSuiteType> supportedCipherTypes;
+  /**
+   * Optional PMK for data-paths constructed in the context of this discovery session. A PMK could
+   * also be provided during the actual construction of the data-path (which allows unique PMKs for
+   * each data-path).
+   * Max length: 32
+   */
+  vec<uint8_t> pmk;
+  /**
+   * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
+   * of this discovery session.
+   */
+  bool securityEnabledInNdp;
+  /**
+   * Specifies whether or not there is a ranging requirement in this discovery session.
+   * Note that ranging is only performed if all other match criteria with the peer are met.
+   */
+  bool rangingRequired;
+   /**
+    * Interval in msec between two ranging measurements.
+    * If the Awake DW interval in Enable/Config is larger than the ranging interval - priority is
+    * given to Awake DW interval.
+    */
+  uint32_t rangingIntervalMsec;
+  /**
+   * The type of ranging indication feedback to be provided by discovery session matches. Use
+   * bit-fields from |NanRangingIndication|.
+   */
+   bitfield<NanRangingIndication> configRangingIndications;
+   /**
+    * The ingress and egress distance in cm. If ranging is eanbled (|rangingEnabled| is true) then
+    * \configRangingIndications\ is used to determine whether ingress and/or egress (or neither)
+    * are used to determine whether a match has occurred.
+    */
+   uint32_t distanceIngressCm;
+   uint32_t distanceEgressCm;
+};
+
+/**
+ * Publish request: specifies a publish discovery operation.
  */
 struct NanPublishRequest {
   /**
-   * Id  0 means new publish, any other id is existing publish.
+   * Common configuration of discovery sessions.
    */
-  uint16_t publishId;
+  NanDiscoveryCommonConfig baseConfigs;
   /**
-   * How many seconds to run for. 0 means forever until canceled.
-   */
-  uint16_t ttl;
-  /**
-   * Periodicity of OTA unsolicited publish. Specified in increments of 500 ms.
-   */
-  uint16_t period;
-  /**
-   * 0= unsolicited, solicited = 1, 2= both.
+   * The type of the publish discovery session.
    */
   NanPublishType publishType;
   /**
-   * 0 = broadcast, 1= unicast  if solicited publish.
+   * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+   * specifies the type of transmission used for responding to the probing subscribe discovery
+   * peer.
    */
   NanTxType txType;
-  /**
-   * Number of OTA Publish, 0 means forever until canceled.
-   */
-  uint8_t publishCount;
-  /**
-   * UTF-8 encoded string identifying the service.
-   * Max length: |MAX_SERVICE_NAME_LEN|.
-   */
-  string serviceName;
-  /**
-   * Field which specifies how the matching indication to host is controlled.
-   * 0 - Match and Indicate Once
-   * 1 - Match and Indicate continuous
-   * 2 - Match and Indicate never. This means don't indicate the match to
-   *     the host.
-   * 3 - Reserved
-   */
-  NanMatchAlg publishMatchIndicator;
-  /**
-   * Sequence of values NAN Device that has invoked a Subscribe method
-   * corresponding to this Publish method.
-   * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
-   */
-  vec<uint8_t> serviceSpecificInfo;
-  /**
-   * Ordered sequence of <length, value> pairs which specify further response conditions
-   * beyond the service name used to filter subscribe messages to respond to.
-   * This is only needed when the PT is set to SOLICITED or SOLICITED_UNSOLICITED.
-   * Max length: |MAX_MATCH_FILTER_LEN|.
-   */
-  vec<uint8_t> rxMatchFilter;
-  /**
-   * Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
-   * If present it is always sent in a Discovery Frame
-   * Max length: |MAX_MATCH_FILTER_LEN|.
-   */
-  vec<uint8_t> txMatchFilter;
-  /**
-   * Flag which specifies that the Publish must use the configured RSSI
-   * threshold and the received RSSI in order to filter requests
-   * false – ignore the configured RSSI threshold when running a Service
-   * Descriptor attribute or Service ID List Attribute through the DE matching logic.
-   * true – use the configured RSSI threshold when running a Service
-   * Descriptor attribute or Service ID List Attribute through the DE matching logic.
-   */
-  bool useRssiThreshold;
-  /**
-   * 8-bit bitmap which allows the Host to associate this publish
-   * with a particular Post-NAN Connectivity attribute
-   * which has been sent down in a ConfigureRequest/EnableRequest
-   * message.  If the DE fails to find a configured Post-NAN
-   * connectivity attributes referenced by the bitmap,
-   * the DE must return an error code to the Host.
-   * If the Publish is configured to use a Post-NAN Connectivity
-   * attribute and the Host does not refresh the Post-NAN Connectivity
-   * attribute the Publish must be canceled and the Host must be sent
-   * a PublishTerminatedIndication message.
-   */
-  uint8_t connmap;
-  /**
-   * Set/Enable corresponding bits to disable any indications that follow a publish.
-   * BIT0 - Disable publish termination indication.
-   * BIT1 - Disable match expired indication.
-   * BIT2 - Disable followUp indication received (OTA).
-   */
-  uint8_t recvIndicationCfg;
 };
 
 /**
- * Publish Cancel Msg Structure.
- * The PublishServiceCancelReq Message is used to request the DE to stop publishing
- * the Service Name identified by the Publish Id in the message.
- */
-struct NanPublishCancelRequest {
-  uint16_t publishId;
-};
-
-/**
- * NAN Subscribe Structure.
- * The SubscribeServiceReq message is sent to the Discovery Engine
- * whenever the Upper layers would like to listen for a Service Name
+ * Subscribe request: specifies a subscribe discovery operation.
  */
 struct NanSubscribeRequest {
   /**
-   * Id 0 means new subscribe, non zero is existing subscribe.
+   * Common configuration of discovery sessions.
    */
-  uint16_t subscribeId;
+  NanDiscoveryCommonConfig baseConfigs;
   /**
-   * How many seconds to run for. 0 means forever until canceled.
-   */
-  uint16_t ttl;
-  /**
-   * Periodicity of OTA Active Subscribe. Units in increments of 500 ms,
-   * 0 = attempt every DW.
-   */
-  uint16_t period;
-  /**
-   * Flag which specifies how the Subscribe request shall be processed.
-   * 0 - PASSIVE , 1- ACTIVE.
+   * The type of the subscribe discovery session.
    */
   NanSubscribeType subscribeType;
   /**
-   * Flag which specifies on Active Subscribes how the Service Response Filter
+   * For Active subscribe discovery sessions specify how the Service Response Filter (SRF)
    * attribute is populated.
-   * 0 - Bloom Filter, 1 - MAC Addr.
    */
-  NanSrfType serviceResponseFilter;
+  NanSrfType srfType;
   /**
-   * Flag which specifies how the Service Response Filter Include bit is
-   * populated.
-   * 0=Do not respond if in the Address Set, 1= Respond.
+   * Configure the requested response of the Service Response Filter (SRF).
    */
-  NanSrfIncludeType serviceResponseInclude;
+  bool srfRespondIfInAddressSet;
   /**
-   * Flag which specifies if the Service Response Filter must be used when
-   * creating Subscribes.
-   * 0=Do not send the Service Response Filter,1= send.
+   * Control whether the Service Response Filter (SRF) is transmitted OTA.
    */
-  bool shouldUseServiceResponseFilter;
+  bool shouldUseSrf;
   /**
-   * Flag which specifies if the Service Specific Info is needed in
-   * the Publish message before creating the MatchIndication.
-   * 0=Not needed, 1= Required.
+   * Control whether the Service Specific Info (SSI) is needed in the Publish message to trigger
+   * service discovery (a match).
    */
-  bool isSsiRequiredForMatchIndication;
-  /**
-   * Field which specifies how the matching indication to host is controlled.
-   * 0 - Match and Indicate Once
-   * 1 - Match and Indicate continuous
-   * 2 - Match and Indicate never. This means don't indicate the match to the
-   *     host.
-   * 3 - Reserved
-   */
-  NanMatchAlg subscribeMatchIndicator;
-  /**
-   * The number of Subscribe Matches which must occur
-   * before the Subscribe request is automatically terminated.
-   * If this value is 0 this field is not used by the DE.
-   */
-  uint8_t subscribeCount;
-  /**
-   * UTF-8 encoded string identifying the service.
-   * Max length: |MAX_SERVICE_NAME_LEN|.
-   */
-  string serviceName;
-  /**
-   * Sequence of values which further specify the published service beyond the
-   * service name.
-   * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
-   */
-  vec<uint8_t> serviceSpecificInfo;
-  /**
-   * Ordered sequence of <length, value> pairs used to filter out received
-   * publish discovery messages.
-   * This can be sent both for a Passive or an Active Subscribe
-   * Max length: |MAX_MATCH_FILTER_LEN|.
-   */
-  vec<uint8_t> rxMatchFilter;
-  /**
-   * Ordered sequence of <length, value> pairs  included in the
-   * Discovery Frame when an Active Subscribe is used.
-   * Max length: |MAX_MATCH_FILTER_LEN|.
-   */
-  vec<uint8_t> txMatchFilter;
-  /**
-   * Flag which specifies that the Publish must use the configured RSSI
-   * threshold and the received RSSI in order to filter requests
-   * false – ignore the configured RSSI threshold when running a Service
-   * Descriptor attribute or Service ID List Attribute through the DE matching logic.
-   * true – use the configured RSSI threshold when running a Service
-   * Descriptor attribute or Service ID List Attribute through the DE matching logic.
-   */
-  bool useRssiThreshold;
-  /**
-   * 8-bit bitmap which allows the Host to associate this Active
-   * Subscribe with a particular Post-NAN Connectivity attribute
-   * which has been sent down in a ConfigureRequest/EnableRequest
-   * message.  If the DE fails to find a configured Post-NAN
-   * connectivity attributes referenced by the bitmap,
-   * the DE must return an error code to the Host.
-   * If the Subscribe is configured to use a Post-NAN Connectivity
-   * attribute and the Host does not refresh the Post-NAN Connectivity
-   * attribute the Subscribe must be canceled and the Host must be sent
-   * a SubscribeTerminatedIndication message.
-   */
-  uint8_t connmap;
+  bool isSsiRequiredForMatch;
   /**
    * NAN Interface Address, conforming to the format as described in
    * 8.2.4.3.2 of IEEE Std. 802.11-2012.
-   * Max length: |MAX_SUBSCRIBE_MAX_ADDRESS|.
+   * Max length: |NanCapabilities.maxSubscribeInterfaceAddresses|.
    */
   vec<MacAddress> intfAddr;
-  /**
-   * Set/Enable corresponding bits to disable indications that follow a
-   * subscribe.
-   * BIT0 - Disable subscribe termination indication.
-   * BIT1 - Disable match expired indication.
-   * BIT2 - Disable followUp indication received (OTA).
-   */
-  uint8_t recvIndicationCfg;
 };
 
 /**
- * NAN Subscribe Cancel Structure
- * The SubscribeCancelReq Message is used to request the DE to stop looking
- * for the Service Name.
- */
-struct NanSubscribeCancelRequest {
-  uint16_t subscribeId;
-};
-
-/**
- * Transmit follow up Structure.
- * The TransmitFollowupReq message is sent to the DE to allow the sending of
- * the Service_Specific_Info to a particular MAC address.
+ * Transmit follow up message request.
  */
 struct NanTransmitFollowupRequest {
   /**
-   * Publish or Subscribe Id of an earlier Publish/Subscribe.
+   * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
+   * context of the discovery session.
    */
-  uint16_t publishSubscribeId;
+  uint16_t discoverySessionId;
   /**
-   * This Id is the Requestor Instance that is passed as
-   * part of earlier MatchInd/FollowupInd message.
+   * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
    */
-  uint32_t requestorInstanceId;
+  uint32_t peerId;
   /**
-   * Unicast address.
+   * MAC address of the peer. Obtained as part of an earlier |eventMatch| or
+   * |eventFollowupReceived|.
    */
   MacAddress addr;
   /**
-   * Priority of the request 2=high.
+   * Should the follow-up message be transmitted with a high priority.
    */
-  NanTxPriority priority;
+  bool isHighPriority;
   /**
-   * Flag which the DE uses to decide if received in a DW or a FAW
-   * 0= send in a DW, 1=send in FAW.
+   * Should the follow-up message be transmitted in a discovery window (true) or a further
+   * availability window (false).
    */
-  NanTransmitWindowType dwOrFaw;
+  bool shouldUseDiscoveryWindow;
   /**
-   * Sequence of values which further specify the published service beyond
-   * the service name.
-   * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
+   * Message as a byte sequence.
+   * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
    */
-  vec<uint8_t> serviceSpecificInfo;
+  vec<uint8_t> message;
   /**
-   * Set/Enable corresponding bits to disable responses after followUp.
-   * BIT0 - Disable followUp response from FW.
+   * Disable |eventTransmitFollowup| - i.e. do not get indication on whether the follow-up
+   * was transmitted and received successfully.
    */
-  uint8_t recvIndicationCfg;
+  bool disableFollowupResultIndication;
 };
 
 /**
- * Config Structure.
- * The ConfigurationReq message is sent by the Host to the
- * Discovery Engine in order to configure the Discovery Engine during runtime.
+ *  Data Path Initiator requesting a data-path.
  */
-struct NanConfigRequest {
-  bool validSidBeaconVal;
-  uint8_t sidBeacon;
-  bool validRssiProximityVal;
-  uint8_t rssiProximity;
-  bool validMasterPrefVal;
-  uint8_t masterPref;
+struct NanInitiateDataPathRequest {
   /**
-   * 1 byte value which defines the RSSI filter threshold.
-   * Any Service Descriptors received above this value
-   * that are configured for RSSI filtering must be dropped.
-   * The rssi values must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
+   * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
    */
-  bool valid5gRssiCloseProximityVal;
-  uint8_t rssiCloseProximity5gVal;
+  uint32_t peerId;
   /**
-   * 2 byte quantity which defines the window size over
-   * which the “average RSSI” must be calculated over.
+   * NAN management interface MAC address of the peer.
    */
-  bool validRssiWindowSizeVal;
-  uint16_t rssiWindowSizeVal;
-  /**
-   * If set to 1, the Discovery Engine must enclose the Cluster
-   * Attribute only sent in Beacons in a Vendor Specific Attribute
-   * and transmit in a Service Descriptor Frame.
-   */
-  bool configClusterAttributeVal;
-  /**
-   * The periodicity in seconds between full scan’s to find any new
-   * clusters available in the area.  A Full scan must not be done
-   * more than every 10 seconds and must not be done less than every
-   * 30 seconds.
-   */
-  bool validScanParamsVal;
-  NanSocialChannelScanParams scanParamsVal;
-  /**
-   * 1 byte quantity which forces the Random Factor to a particular
-   * value for all transmitted Sync/Discovery beacons
-   */
-  bool validRandomFactorForceVal;
-  uint8_t randomFactorForceVal;
-  /**
-   * 1 byte quantity which forces the HC for all transmitted Sync and
-   * Discovery Beacon NO matter the real HC being received over the
-   * air.
-   */
-  bool validHopCountForceVal;
-  uint8_t hopCountForceVal;
-};
-
-/**
- * Beacon Sdf Payload Structure
- * The Discovery Engine can be configured to publish vendor specific attributes as part of
- * beacon or service discovery frame transmitted as part of this request..
- */
-struct NanBeaconSdfPayloadRequest {
-  /**
-   * VendorAttribute must have the Vendor Specific Attribute which the
-   * vendor wants to publish as part of Discovery or Sync or Service discovery frame
-   */
-  NanTransmitVendorSpecificAttribute vsa;
-};
-
-/**
- *  Data Path Initiator requesting a data session.
- */
-struct NanDataPathInitiatorRequest {
-  /**
-   * Unique Instance Id identifying the Responder's service.
-   * This is same as publish_id notified on the subscribe side
-   * in a publish/subscribe scenario
-   */
-  uint32_t serviceInstanceId;
+  MacAddress peerDiscMacAddr;
   /**
    * Config flag for channel request.
    */
@@ -1357,486 +1094,312 @@
    */
   WifiChannelInMhz channel;
   /**
-   * Discovery MAC addr of the publisher/peer.
+   * NAN data interface name on which this data-path session is to be started.
+   * This must be an interface created using |createDataInterfaceRequest|.
    */
-  MacAddress peerDiscMacAddr;
+  string ifaceName;
   /**
-   * Interface name on which this NDP session is to be started.
-   * This must be the same interface name provided during interface
-   * create.
+   * Specifies whether or not security is required for the data-path being created.
    */
-  string ndpIface;
+  bool securityRequired;
   /**
-   * Initiator/Responder Security/QoS configuration.
+   * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+   * Max length: |NanCapabilities.maxAppInfoLen|.
    */
-  NanDataPathCfg ndpCfg;
+  vec<uint8_t> appInfo;
   /**
-   * App/Service information of the Initiator.
+   * Cipher types supported in data-paths constructed in the context of this discovery session. The
+   * |NanCipherSuiteType| bit fields are used to set this value.
    */
-  NanDataPathAppInfo appInfo;
+  bitfield<NanCipherSuiteType> supportedCipherTypes;
+  /**
+   * PMK of the data-path being requested (if |securityRequired| is true).
+   * Max length: 32
+   */
+  vec<uint8_t> pmk;
 };
 
 /**
- * Data struct Nanto initiate a data response on the responder side
- * for an indication received with a data request.
+ * Response to a data-path request from a peer.
  */
-struct NanDataPathIndicationResponse {
+struct NanRespondToDataPathIndicationRequest {
   /**
-   * Unique token Id generated on the initiator/responder
-   * side used for a NDP session between two NAN devices.
+   * Accept (true) or reject (false) the request.
    */
-  NanDataPathId ndpInstanceId;
+  bool acceptRequest;
   /**
-   * Interface name on which this NDP session is to be started.
-   * This must be the same interface name provided during interface
-   * create.
+   * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
+   * |NanDataPathRequestInd|.
    */
-  string ndpIface;
+  uint32_t ndpInstanceId;
   /**
-   * Initiator/Responder Security/QoS configuration.
+   * NAN data interface name on which this data-path session is to be started.
+   * This must be an interface created using |createDataInterfaceRequest|.
    */
-  NanDataPathCfg ndpCfg;
+  string ifaceName;
   /**
-   * App/Service information of the responder.
+   * Specifies whether or not security is required for the data-path being created.
    */
-  NanDataPathAppInfo appInfo;
+  bool securityRequired;
   /**
-   * Response Code indicating ACCEPT/REJECT/DEFER
+   * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+   * Max length: |NanCapabilities.maxAppInfoLen|.
    */
-  NanDataPathResponseCode rspCode;
+  vec<uint8_t> appInfo;
+  /**
+   * Cipher types supported in data-paths constructed in the context of this discovery session. The
+   * |NanCipherSuiteType| bit fields are used to set this value.
+   */
+  bitfield<NanCipherSuiteType> supportedCipherTypes;
+  /**
+   * PMK of the data-path being requested (if |securityRequired| is true).
+   * Max length: 32
+   */
+  vec<uint8_t> pmk;
 };
 
 /**
- * NDP termination info.
+ * Specifies vendor-specific information fields to be included in NAN management frames.
  */
-struct NanDataPathEndRequest {
-  uint8_t numNdpInstances;
+struct NanBeaconSdfPayloadRequest {
   /**
-   * Unique token Id generated on the initiator/responder side
-   * used for a NDP session between two NAN devices
+   * If true information is transmitted in next 16 DWs, else only in the next (1) DW.
    */
-  vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * Definition of various ResponseType
- */
-enum NanResponseType : uint32_t  {
-  ENABLED = 0,
-  DISABLED = 1,
-  PUBLISH = 2,
-  PUBLISH_CANCEL = 3,
-  TRANSMIT_FOLLOWUP = 4,
-  SUBSCRIBE = 5,
-  SUBSCRIBE_CANCEL = 6,
-  CONFIG = 8,
-  ERROR = 10,
-  BEACON_SDF_PAYLOAD = 11,
-  GET_CAPABILITIES = 12,
-  DP_INTERFACE_CREATE = 13,
-  DP_INTERFACE_DELETE = 14,
-  DP_INITIATOR_RESPONSE = 15,
-  DP_RESPONDER_RESPONSE = 16,
-  DP_END = 17,
-};
-
-/**
- * Various NAN Protocol Response code
- */
-enum NanStatusType : uint32_t {
-  /* NAN Protocol Response Codes */
-  SUCCESS = 0,
-  TIMEOUT = 1,
-  DE_FAILURE = 2,
-  INVALID_MSG_VERSION = 3,
-  INVALID_MSG_LEN = 4,
-  INVALID_MSG_ID = 5,
-  INVALID_HANDLE = 6,
-  NO_SPACE_AVAILABLE = 7,
-  INVALID_PUBLISH_TYPE = 8,
-  INVALID_TX_TYPE = 9,
-  INVALID_MATCH_ALGORITHM = 10,
-  DISABLE_IN_PROGRESS = 11,
-  INVALID_TLV_LEN = 12,
-  INVALID_TLV_TYPE = 13,
-  MISSING_TLV_TYPE = 14,
-  INVALID_TOTAL_TLVS_LEN = 15,
-  INVALID_MATCH_HANDLE = 16,
-  INVALID_TLV_VALUE = 17,
-  INVALID_TX_PRIORITY = 18,
-  INVALID_CONNECTION_MAP = 19,
-  NOT_ALLOWED = 22,
-  NO_OTA_ACK = 23,
-  TX_FAIL = 24,
-  ALREADY_ENABLED = 25,
-  FOLLOWUP_QUEUE_FULL = 26,
-
-  /* NAN Configuration Response codes */
-  INVALID_RSSI_CLOSE_VALUE = 4096,
-  INVALID_RSSI_MIDDLE_VALUE = 4097,
-  INVALID_HOP_COUNT_LIMIT = 4098,
-  INVALID_MASTER_PREFERENCE_VALUE = 4099,
-  INVALID_LOW_CLUSTER_ID_VALUE = 4100,
-  INVALID_HIGH_CLUSTER_ID_VALUE = 4101,
-  INVALID_BACKGROUND_SCAN_PERIOD = 4102,
-  INVALID_RSSI_PROXIMITY_VALUE = 4103,
-  INVALID_SCAN_CHANNEL = 4104,
-  INVALID_POST_CONNECTIVITY_CAPABILITIES_BITMAP = 4105,
-  INVALID_FURTHER_AVAILABILITY_MAP_NUMCHAN_VALUE = 4106,
-  INVALID_FURTHER_AVAILABILITY_MAP_DURATION_VALUE = 4107,
-  INVALID_FURTHER_AVAILABILITY_MAP_CLASS_VALUE = 4108,
-  INVALID_FURTHER_AVAILABILITY_MAP_CHANNEL_VALUE = 4109,
-  INVALID_FURTHER_AVAILABILITY_MAP_AVAILABILITY_INTERVAL_BITMAP_VALUE = 4110,
-  INVALID_FURTHER_AVAILABILITY_MAP_MAP_ID = 4111,
-  INVALID_POST_DISCOVERY_CONN_TYPE_VALUE = 4112,
-  INVALID_POST_DISCOVERY_DEVICE_ROLE_VALUE = 4113,
-  INVALID_POST_DISCOVERY_DURATION_VALUE = 4114,
-  INVALID_POST_DISCOVERY_BITMAP_VALUE = 4115,
-  MISSING_FUTHER_AVAILABILITY_MAP = 4116,
-  INVALID_BAND_CONFIG_FLAGS = 4117,
-  INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE = 4118,
-  INVALID_ONGOING_SCAN_PERIOD = 4119,
-  INVALID_DW_INTERVAL_VALUE = 4120,
-  INVALID_DB_INTERVAL_VALUE = 4121,
-
-  /* 4122-8191 RESERVED */
-  TERMINATED_REASON_INVALID = 8192,
-  TERMINATED_REASON_TIMEOUT = 8193,
-  TERMINATED_REASON_USER_REQUEST = 8194,
-  TERMINATED_REASON_FAILURE = 8195,
-  TERMINATED_REASON_COUNT_REACHED = 8196,
-  TERMINATED_REASON_DE_SHUTDOWN = 8197,
-  TERMINATED_REASON_DISABLE_IN_PROGRESS = 8198,
-  TERMINATED_REASON_POST_DISC_ATTR_EXPIRED = 8199,
-  TERMINATED_REASON_POST_DISC_LEN_EXCEEDED = 8200,
-  TERMINATED_REASON_FURTHER_AVAIL_MAP_EMPTY = 8201,
-
-  /* 9000-9500 NDP Status type */
-  NDP_UNSUPPORTED_CONCURRENCY = 9000,
-  NDP_DATA_IFACE_CREATE_FAILED = 9001,
-  NDP_DATA_IFACE_DELETE_FAILED = 9002,
-  NDP_DATA_INITIATOR_REQUEST_FAILED = 9003,
-  NDP_DATA_RESPONDER_REQUEST_FAILED = 9004,
-  NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
-  NDP_INVALID_NDP_INSTANCE_ID = 9006,
-  NDP_INVALID_RESPONSE_CODE = 9007,
-  NDP_INVALID_APP_INFO_LEN = 9008,
-
-  /* OTA failures and timeouts during negotiation */
-  NDP_MGMT_FRAME_REQUEST_FAILED = 9009,
-  NDP_MGMT_FRAME_RESPONSE_FAILED = 9010,
-  NDP_MGMT_FRAME_CONFIRM_FAILED = 9011,
-  NDP_END_FAILED = 9012,
-  NDP_MGMT_FRAME_END_REQUEST_FAILED = 9013,
-
-  /* 9500 onwards vendor specific error codes */
-  NDP_VENDOR_SPECIFIC_ERROR = 9500,
-};
-
-/**
- * NAN Response message header
- */
-struct NanResponseMsgHeader {
+  bool transmitInNext16dws;
   /**
-   * Contains the result code.
+   * Specify the management frames in which the vendor-specific information is included.
    */
-  NanStatusType status;
+  bool transmitInDiscoveryBeacon;
+  bool transmitInSyncBeacon;
+  bool transmitInServiceDiscoveryFrame;
   /**
-   * For error returns the value is returned which was in error.
-   * TODO(b/32207606): Find all the error values.
-   */
-  uint32_t value;
-  /**
-   * ResponseType Definitions.
-   */
-  NanResponseType responseType;
-};
-
-/**
- * Publish Response Message structure.
- */
-struct NanPublishResponse {
-  uint16_t publishId;
-};
-
-/**
- * NAN Publish Response Messages.
- */
-struct NanPublishResponseMsg {
-  NanResponseMsgHeader header;
-  NanPublishResponse body;
-};
-
-
-/**
- * Subscribe Response Message structure.
- */
-struct NanSubscribeResponse {
-  uint16_t subscribeId;
-};
-
-/**
- * NAN Subscribe Response Messages.
- */
-struct NanSubscribeResponseMsg {
-  NanResponseMsgHeader header;
-  NanSubscribeResponse body;
-};
-
-/**
- * Response returned for Initiators Data request.
- */
-struct NanDataPathResponse {
-  /**
-   * Unique token Id generated on the initiator
-   * side used for a NDP session between two NAN devices
-   */
-  NanDataPathId ndpInstanceId;
-};
-
-/**
- * NAN Data Path Response Messages.
- */
-struct NanDataPathResponseMsg {
-  NanResponseMsgHeader header;
-  NanDataPathResponse body;
-};
-
-/**
- * NDP Capabilites response.
- */
-struct NanCapabilitiesResponse {
-  uint32_t maxConcurrentClusters;
-  uint32_t maxPublishes;
-  uint32_t maxSubscribes;
-  uint32_t maxServiceNameLen;
-  uint32_t maxMatchFilterLen;
-  uint32_t maxTotalMatchFilterLen;
-  uint32_t maxServiceSpecificInfoLen;
-  uint32_t maxVsaDataLen;
-  uint32_t maxMeshDataLen;
-  uint32_t maxNdiInterfaces;
-  uint32_t maxNdpSessions;
-  uint32_t maxAppInfoLen;
-  uint32_t maxQueuedTransmitFollowupMsgs;
-};
-
-/**
- * NAN Capabilities Response Messages.
- */
-struct NanCapabilitiesResponseMsg {
-  NanResponseMsgHeader header;
-  NanCapabilitiesResponse body;
-};
-
-/**
- * Publish Terminated Message structure.
- * The PublishTerminatedInd message is sent by the DE whenever a Publish
- * terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanPublishTerminatedInd {
-  /**
-   * Id returned during the initial Publish.
-   */
-  uint16_t publishId;
-  NanStatusType reason;
-};
-
-/**
- * Match Indication Message structure.
- * The MatchInd message is sent once per responding MAC address whenever
- * the Discovery Engine detects a match for a previous SubscribeServiceReq
- * or PublishServiceReq.
- */
-struct NanMatchInd {
-  /**
-   * Publish or Subscribe Id of an earlier Publish/Subscribe.
-   */
-  uint16_t publishSubscribeId;
-  /**
-   * A 32 bit Requestor Instance Id which is sent to the Application.
-   * This Id must be sent in any subsequent UnmatchInd/FollowupInd
-   * messages.
-   */
-  uint32_t requestorInstanceId;
-  MacAddress addr;
-  /**
-   * Sequence of octets which were received in a Discovery Frame matching the
-   * Subscribe Request.
-   * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
-   */
-  vec<uint8_t> serviceSpecificInfo;
-  /**
-   * Ordered sequence of <length, value> pairs received in the Discovery Frame
-   * matching the Subscribe Request.
-   * Max length: |MAX_MATCH_FILTER_LEN|.
-   */
-  vec<uint8_t> sdfMatchFilter;
-  /**
-   * Flag to indicate if the Match occurred in a Beacon Frame or in a
-   * Service Discovery Frame.
-   */
-  bool matchOccuredFlag;
-  /**
-   * Flag to indicate FW is out of resource and that it can no longer
-   * track this Service Name. The Host still need to send the received
-   * Match_Handle but duplicate MatchInd messages may be received on
-   * this Handle until the resource frees up.
-   */
-  bool outOfResourceFlag;
-  /**
-   * If RSSI filtering was configured in SubscribeRequest then this
-   * field must contain the received RSSI value. 0 if not.
-   * All rssi values must be specified without sign.
-   * For eg: -70dBm must be specified as 70.
-   */
-  uint8_t rssiValue;
-};
-
-/**
- * MatchExpired Indication Message structure.
- * The MatchExpiredInd message is sent whenever the Discovery Engine detects that
- * a previously Matched Service has been gone for too long. If the previous
- * MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
- * set then this message must not be received
- */
-struct NanMatchExpiredInd {
-  /**
-   * Publish or Subscribe Id of an earlier Publish/Subscribe.
-   */
-  uint16_t publishSubscribeId;
-  /**
-   * 32 bit value sent by the DE in a previous
-   * MatchInd/FollowupInd to the application.
-   */
-  uint32_t requestorInstanceId;
-};
-
-/**
- * Subscribe Terminated Message structure.
- * The SubscribeTerminatedInd message is sent by the DE whenever a
- * Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanSubscribeTerminatedInd {
-  /**
-   * Id returned during initial Subscribe.
-   */
-  uint16_t subscribeId;
-  NanStatusType reason;
-};
-
-/**
- * Followup Indication Message structure.
- * The FollowupInd message is sent by the DE to the Host whenever it receives a
- * Followup message from another peer.
- */
-struct NanFollowupInd {
-  /**
-   * Publish or Subscribe Id of an earlier Publish/Subscribe.
-   */
-  uint16_t publishSubscribeId;
-  /**
-   * A 32 bit Requestor instance Id which is sent to the Application.
-   * This Id must be used in subsequent UnmatchInd/FollowupInd messages.
-   */
-  uint32_t requestorInstanceId;
-  MacAddress addr;
-  /**
-   * Flag which the DE uses to decide if received in a DW or a FAW
-   * 0= send in a DW, 1=send in FAW.
-   */
-  NanTransmitWindowType dwOrFaw;
-  /**
-   * Sequence of values which further specify the published service beyond
-   * the service name
-   * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
-   */
-  vec<uint8_t> serviceSpecificInfo;
-};
-
-/**
- * NAN Protocol Event ID Codes.
- */
-enum NanDiscEngEventType : uint32_t {
-  /**
-   * Event data notifying the Mac address of the Discovery engine.
-   * which is reported as one of the Discovery engine event
-   */
-  DISC_MAC_ADDR = 0,
-  /**
-   * Event data notifying the Cluster address of the cluster
-   * which is reported as one of the Discovery engine events.
-   */
-  STARTED_CLUSTER,
-  JOINED_CLUSTER,
-};
-
-/**
- * Discovery Engine Event Indication Message structure.
- * The Discovery Engine can inform the Host when significant events occur
- * The data following the EventId is dependent upon the EventId type.
- * In other words, each new event defined must carry a different
- * structure of information back to the host.
- */
-struct NanDiscEngEventInd {
-  /**
-   * NAN Protocol Event Codes.
-   */
-  NanDiscEngEventType eventType;
-  /**
-   * Mac Address associated with the corresponding event.
-   */
-  MacAddress addr;
-};
-
-/**
- * NAN Disabled Indication Message structure.
- * The DisableInd message indicates to the upper layers that the Discovery
- * Engine has flushed all state and has been shutdown.  When this message is
- * received the DE is guaranteed to have left the NAN cluster it was part of
- * and must have terminated any in progress Publishes or Subscribes.
- */
-struct NanDisabledInd {
-  NanStatusType reason;
-};
-
-/**
- * Mask to determine on which frames attribute was received.
- */
-enum NanVsaRxFrameMask: uint32_t {
-  DISCOVERY_BEACON_MASK = 1 << 0,
-  SYNC_BEACON_MASK = 1 << 1,
-  SERVICE_DISCOVERY_MASK = 1 << 2
-};
-
-struct NanReceiveVendorSpecificAttribute {
-  /**
-   * Frames on which this vendor specific attribute
-   * was received. Mask |NanVsaRxFrameMask| defined above.
-   */
-  uint8_t vsaReceivedOn;
-  /**
-   * Organizationally Unique Identifier.
+   * Organizationally Unique Identifier (OUI).
    */
   uint32_t vendorOui;
   /**
-   * Vendor specific attribute.
-   * Max length: |MAX_VSA_DATA_LEN|.
+   * Vendor specific attribute to be transmitted.
+   * Max length: |NanCapabilities.maxVsaDataLen|.
    */
   vec<uint8_t> vsa;
 };
 
 /**
- * NAN Beacon SDF Payload Received Message structure.
- * Discovery engine sends the details of received Beacon or
- * Service Discovery Frames as part of this structure.
+ * NDP Capabilities response.
  */
-struct NanBeaconSdfPayloadReceive {
+struct NanCapabilities {
   /**
-   * Frame data.
-   * Max length: |MAX_FRAME_DATA_LEN|.
+   * Maximum number of clusters which the device can join concurrently.
    */
-  vec<uint8_t> frameData;
+  uint32_t maxConcurrentClusters;
+  /**
+   * Maximum number of concurrent publish discovery sessions.
+   */
+  uint32_t maxPublishes;
+  /**
+   * Maximum number of concurrent subscribe discovery sessions.
+   */
+  uint32_t maxSubscribes;
+  /**
+   * Maximum length (in bytes) of service name.
+   */
+  uint32_t maxServiceNameLen;
+  /**
+   * Maximum length (in bytes) of individual match filters.
+   */
+  uint32_t maxMatchFilterLen;
+  /**
+   * Maximum length (in bytes) of aggregate match filters.
+   */
+  uint32_t maxTotalMatchFilterLen;
+  /**
+   * Maximum length (in bytes) of the service specific info length or message length in follow-ups.
+   */
+  uint32_t maxServiceSpecificInfoLen;
+  /**
+   * Maximum length (in bytes) of vendor-specific (VSA) data.
+   */
+  uint32_t maxVsaDataLen;
+  /**
+   * Maximum number of data interfaces which can be created concurrently on the device.
+   */
+  uint32_t maxNdiInterfaces;
+  /**
+   * Maximum number of data paths which can be created concurrently on each individual
+   * data interface.
+   */
+  uint32_t maxNdpSessions;
+  /**
+   * Maximum length (in bytes) of application info field (used in data-path negotiations).
+   */
+  uint32_t maxAppInfoLen;
+  /**
+   * Maximum number of transmitted followup messages which can be queued by the firmware.
+   */
+  uint32_t maxQueuedTransmitFollowupMsgs;
+  /**
+   * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
+   */
+  uint32_t maxSubscribeInterfaceAddresses; // TODO: (hard-code to 42) get from HAL
+  /**
+   * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
+   */
+  bitfield<NanCipherSuiteType> supportedCipherSuites;
+};
+
+/**
+ * Match indication structure
+ */
+struct NanMatchInd {
+  /**
+   * Publish or subscribe discovery session ID of an existing discovery session.
+   */
+  uint16_t discoverySessionId;
+  /**
+   * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+   */
+  uint32_t peerId;
+  /**
+   * The NAN Discovery (management) MAC address of the peer.
+   */
+  MacAddress addr;
+  /**
+   * The arbitrary information contained in the |serviceSpecificInfo| of the peer's discovery
+   * session.
+   * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   */
+  vec<uint8_t> serviceSpecificInfo;
+  /**
+   * Ordered sequence of <length, value> pairs (length uses 1 byte) of the peer's discovery session
+   * match filter.
+   * Max length: |NanCapabilities.maxMatchFilterLen|.
+   */
+  vec<uint8_t> matchFilter;
+  /**
+   * Indicates the type of discovery: Beacon if true, Service Discovery Frames (SDF) if false.
+   */
+  bool matchOccuredInBeaconFlag;
+  /**
+   * Flag to indicate FW is out of resource and that it can no longer
+   * track this Service Name.
+   */
+  bool outOfResourceFlag;
+  /**
+   * If RSSI filtering was configured in discovery session setup then this
+   * field must contain the received RSSI value. It will contain 0 if RSSI filtering was not
+   * configured.
+   * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
+   */
+  uint8_t rssiValue;
+  /**
+   * Cipher types supported by the peer for data-paths constructed in the context of this discovery
+   * session. The |NanCipherSuiteType| bit fields are used to set this value.
+   */
+  bitfield<NanCipherSuiteType> peerSupportedCipherTypes;
+  /**
+   * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
+   * in the context of this discovery session.
+   */
+  bool peerRequiresSecurityEnabledInNdp;
+  /**
+   * Indicates whether or not the peer requires (and hence allows) ranging in this discovery
+   * session.
+   * Note that ranging is only performed if all other match criteria with the peer are met.
+   */
+  bool peerRequiresRanging;
+  /**
+   * Ranging indication supersedes the NanMatchAlg specification.
+   * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous
+   * match notifications will be received (with ranging information).
+   * Ranging indication data is provided if Ranging required is enabled in the discovery
+   * specification and:
+   *   1) continuous ranging specified.
+   *   2) ingress/egress specified and:
+   *       - notify once for ingress >= ingress_distance and egress <= egress_distance,
+   *       - same for ingress_egress_both
+   * If the Awake DW intervals are larger than the ranging intervals then priority is given to the
+   * device DW intervals.
+   *
+   * If ranging was required and executed contains the distance to the peer in CM. The
+   * |rangingIndicationType| field specifies the event which triggered ranging.
+   */
+  uint32_t rangingMeasurementInCm;
+  /**
+   * The ranging event(s) which triggered the ranging. Uses bit-fields from |NanRangingIndication|.
+   * E.g. can indicate that continuous ranging is required, or else that an ingress event occurred.
+   */
+   bitfield<NanRangingIndication> rangingIndicationType;
+};
+
+/**
+ * Followup message received from peer indication structure.
+ */
+struct NanFollowupReceivedInd {
+  /**
+   * Discovery session (publish or subscribe) ID of a previously created discovery session. The
+   * message is received in the context of this discovery session.
+   */
+  uint16_t discoverySessionId;
+  /**
+   * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+   */
+  uint32_t peerId;
+  /**
+   * The NAN Discovery (management) MAC address of the peer.
+   */
+  MacAddress addr;
+  /**
+   * Indicates whether received in a further availability window (FAW) if true, or in a discovery
+   * window (DW) if false.
+   */
+  bool receivedInFaw;
+  /**
+   * Received message as a byte sequence.
+   * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   */
+  vec<uint8_t> message;
+};
+
+/**
+ * Event types for a cluster event indication.
+ */
+enum NanClusterEventType : uint32_t {
+  /**
+   * Management/discovery interface MAC address has changed (e.g. due to randomization or at
+   * startup).
+   */
+  DISCOVERY_MAC_ADDRESS_CHANGED = 0,
+  /**
+   * A new cluster has been formed by this device.
+   */
+  STARTED_CLUSTER,
+  /**
+   * This device has joined an existing cluster.
+   */
+  JOINED_CLUSTER,
+};
+
+/**
+ * Cluster event indication structure: triggered on events impacting how this device is
+ * visible to peers - cluster forming, joining a new cluster, or changing of the MAC address.
+ */
+struct NanClusterEventInd {
+  /**
+   * Event type causing the cluster event indication to be triggered.
+   */
+  NanClusterEventType eventType;
+  /**
+   * MAC Address associated with the corresponding event.
+   */
+  MacAddress addr;
+};
+
+/**
+ * Mask to determine on which frames the vendor-specific attribute (VSA) was received on.
+ */
+enum NanVsaRxFrameMask: uint32_t {
+  DISCOVERY_BEACON_MASK = 1 << 0,
+  SYNC_BEACON_MASK = 1 << 1,
+  SERVICE_DISCOVERY_MASK = 1 << 2
 };
 
 /**
@@ -1851,98 +1414,91 @@
    */
   MacAddress addr;
   /**
-   * NAN Receive Vendor Specific Attribute.
+   * A flag indicating whether a vendor-specific attribute (VSA) has been received.
    */
   bool isVsaReceived;
-  NanReceiveVendorSpecificAttribute vsa;
   /**
-   * NAN Beacon or SDF Payload Received.
+   * Frames on which this vendor specific attribute was received.
+   * Mask |NanVsaRxFrameMask| defined above.
+   */
+  bitfield<NanVsaRxFrameMask> vsaReceivedOnFrames;
+  /**
+   * Organizationally Unique Identifier (OUI) of the vendor-specific attribute.
+   */
+  uint32_t vsaVendorOui;
+  /**
+   * Contents of the vendor specific attribute.
+   * Max length: |NanCapabilities.maxVsaDataLen|.
+   */
+  vec<uint8_t> vsa;
+  /**
+   * A flag indicating whether a NAN beacon or SDF payload has been received.
    */
   bool isBeaconSdfPayloadReceived;
-  NanBeaconSdfPayloadReceive data;
+  /**
+   * The contents of the NAN beacon or SDF payload.
+   */
+  vec<uint8_t> beaconSdfPayloadData;
 };
 
 /**
  * NAN Data path request Indication Message structure.
- * Event indication received on the responder side when a Nan Data request or
- * NDP session is initiated on the Initiator side.
+ * Event indication received by an intended Responder when a Nan Data request initiated by an
+ * Initiator.
  */
 struct NanDataPathRequestInd {
   /**
-   * Unique Instance Id corresponding to a service/session.
-   * This is similar to the publish_id generated on the
-   * publisher side.
+   * ID of an active publish or subscribe discovery session - the data-path request is in the
+   * context of this discovery session.
    */
-  uint16_t serviceInstanceId;
+  uint16_t discoverySessionId;
   /**
-   * Discovery MAC addr of the peer/initiator.
+   * MAC address of the Initiator peer. This is the MAC address of the peer's management/discovery
+   * NAN interface.
    */
   MacAddress peerDiscMacAddr;
   /**
-   * Unique token Id generated on the initiator/responder side
-   * used for a NDP session between two NAN devices.
+   * ID of the data-path - used to identify the data-path in further negotiation/APIs.
    */
-  NanDataPathId ndpInstanceId;
+  uint32_t ndpInstanceId;
   /**
-   * Initiator/Responder Security/QoS configuration.
+   * Specifies whether or not security is required by the peer for the data-path being created.
    */
-  NanDataPathCfg ndpCfg;
+  bool securityRequired;
   /**
-   * App/Service information of the initiator.
+   * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+   * Max length: |NanCapabilities.maxAppInfoLen|.
    */
-  NanDataPathAppInfo appInfo;
+  vec<uint8_t> appInfo;
 };
 
 /**
- * NAN Data path confirmation Indication Message structure.
- * Event indication of data confirm is received on both
- * initiator and responder side confirming a NDP session.
+ * NAN Data path confirmation Indication structure.
+ * Event indication is received on both initiator and responder side when negotiation for a
+ * data-path finish: on success or failure.
  */
 struct NanDataPathConfirmInd {
   /**
-   * Unique token Id generated on the initiator/responder side
-   * used for a NDP session between two NAN devices
+   * ID of the data-path.
    */
-  NanDataPathId ndpInstanceId;
+  uint32_t ndpInstanceId;
   /**
-   * NDI mac address of the peer.
-   * (required to derive target ipv6 address)
+   * Indicates whether the data-path setup succeeded (true) or failed (false).
+   */
+  bool dataPathSetupSuccess;
+  /**
+   * MAC address of the peer's data-interface (not it's management/discovery interface).
    */
   MacAddress peerNdiMacAddr;
   /**
-   * App/Service information of Initiator/Responder.
+   * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+   * Max length: |NanCapabilities.maxAppInfoLen|.
    */
-  NanDataPathAppInfo appInfo;
+  vec<uint8_t> appInfo;
   /**
-   * Response code indicating ACCEPT/REJECT/DEFER.
+   * Failure reason if |dataPathSetupSuccess| is false.
    */
-  NanDataPathResponseCode rspCode;
-  /**
-   * Reason code indicating the cause for REJECT.
-   */
-  NanStatusType reasonCode;
-};
-
-/**
- * NAN Data path end Indication Message structure.
- * Event indication received on the initiator/responder side terminating
- * a NDP session
- */
-struct NanDataPathEndInd {
-  /**
-   * Unique token Id generated on the initiator/responder side
-   * used for a NDP session between two NAN devices
-   */
-  vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * NAN Transmit followup Indication Message structure.
- * Event Indication notifying the transmit followup in progress.
- */
-struct NanTransmitFollowupInd {
-  CommandId cmdId;
-  NanStatusType reason;
+  WifiNanStatus status;
 };
 
 /**
@@ -2255,12 +1811,12 @@
    * Bit mask indicates what preamble is supported by initiator.
    * Combination of |RttPreamble| values.
    */
-  uint8_t preambleSupport;
+  bitfield<RttPreamble> preambleSupport;
   /**
    * Bit mask indicates what BW is supported by initiator.
    * Combination of |RttBw| values.
    */
-  uint8_t bwSupport;
+  bitfield<RttBw> bwSupport;
   /**
    * Draft 11mc spec version supported by chip.
    * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc.
diff --git a/wifi/1.0/vts/Wifi.vts b/wifi/1.0/vts/Wifi.vts
new file mode 100644
index 0000000..608e012
--- /dev/null
+++ b/wifi/1.0/vts/Wifi.vts
@@ -0,0 +1,110 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifi"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiChip"
+import: "android.hardware.wifi@1.0::IWifiEventCallback"
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "registerEventCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "IWifiEventCallback"
+            is_callback: true
+        }
+        callflow: {
+            entry: true
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "isStarted"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "start"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        callflow: {
+            entry: true
+        }
+        callflow: {
+            next: "registerEventCallback"
+            next: "start"
+            next: "stop"
+            next: "getChip"
+        }
+    }
+
+    api: {
+        name: "stop"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        callflow: {
+            exit: true
+        }
+        callflow: {
+            next: "registerEventCallback"
+            next: "start"
+            next: "stop"
+        }
+    }
+
+    api: {
+        name: "getChipIds"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint32_t"
+            }
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+    api: {
+        name: "getChip"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiChip"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "*"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiApIface.vts b/wifi/1.0/vts/WifiApIface.vts
new file mode 100644
index 0000000..c4f3640
--- /dev/null
+++ b/wifi/1.0/vts/WifiApIface.vts
@@ -0,0 +1,33 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiApIface"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiIface"
+
+interface: {
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiChip.vts b/wifi/1.0/vts/WifiChip.vts
new file mode 100644
index 0000000..4b278c1
--- /dev/null
+++ b/wifi/1.0/vts/WifiChip.vts
@@ -0,0 +1,545 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiChip"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiApIface"
+import: "android.hardware.wifi@1.0::IWifiChipEventCallback"
+import: "android.hardware.wifi@1.0::IWifiIface"
+import: "android.hardware.wifi@1.0::IWifiNanIface"
+import: "android.hardware.wifi@1.0::IWifiP2pIface"
+import: "android.hardware.wifi@1.0::IWifiRttController"
+import: "android.hardware.wifi@1.0::IWifiStaIface"
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiChip::ChipIfaceCombinationLimit"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "types"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ENUM
+                predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+            }
+        }
+        struct_value: {
+            name: "maxIfaces"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiChip::ChipIfaceCombination"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "limits"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::IWifiChip::ChipIfaceCombinationLimit"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiChip::ChipMode"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "id"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "availableCombinations"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::IWifiChip::ChipIfaceCombination"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiChip::ChipDebugInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "driverDescription"
+            type: TYPE_STRING
+        }
+        struct_value: {
+            name: "firmwareDescription"
+            type: TYPE_STRING
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiChip::ChipCapabilityMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "DEBUG_MEMORY_FIRMWARE_DUMP"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "DEBUG_MEMORY_DRIVER_DUMP"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "DEBUG_RING_BUFFER_CONNECT_EVENT"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "DEBUG_RING_BUFFER_POWER_EVENT"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "DEBUG_RING_BUFFER_WAKELOCK_EVENT"
+            scalar_value: {
+                uint32_t: 16
+            }
+            enumerator: "DEBUG_RING_BUFFER_VENDOR_DATA"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "DEBUG_HOST_WAKE_REASON_STATS"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "DEBUG_ERROR_ALERTS"
+            scalar_value: {
+                uint32_t: 128
+            }
+        }
+    }
+
+    api: {
+        name: "getId"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "registerEventCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "IWifiChipEventCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "getCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::V1_0::IWifiChip::ChipCapabilityMask"
+        }
+    }
+
+    api: {
+        name: "getAvailableModes"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::IWifiChip::ChipMode"
+            }
+        }
+    }
+
+    api: {
+        name: "configureChip"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getMode"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "requestChipDebugInfo"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::IWifiChip::ChipDebugInfo"
+        }
+    }
+
+    api: {
+        name: "requestDriverDebugDump"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "requestFirmwareDebugDump"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "createApIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiApIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getApIfaceNames"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "getApIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiApIface"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "removeApIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "createNanIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiNanIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getNanIfaceNames"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "getNanIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiNanIface"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "removeNanIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "createP2pIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiP2pIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getP2pIfaceNames"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "getP2pIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiP2pIface"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "removeP2pIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "createStaIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiStaIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getStaIfaceNames"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRING
+            }
+        }
+    }
+
+    api: {
+        name: "getStaIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiStaIface"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "removeStaIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "createRttController"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiRttController"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "getDebugRingBuffersStatus"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::WifiDebugRingBufferStatus"
+            }
+        }
+    }
+
+    api: {
+        name: "startLoggingToDebugRingBuffer"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::WifiDebugRingBufferVerboseLevel"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "forceDumpToDebugRingBuffer"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getDebugHostWakeReasonStats"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonStats"
+        }
+    }
+
+    api: {
+        name: "enableDebugErrorAlerts"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiChipEventCallback.vts b/wifi/1.0/vts/WifiChipEventCallback.vts
new file mode 100644
index 0000000..c755162
--- /dev/null
+++ b/wifi/1.0/vts/WifiChipEventCallback.vts
@@ -0,0 +1,78 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiChipEventCallback"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "onChipReconfigured"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onChipReconfigureFailure"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+    }
+
+    api: {
+        name: "onIfaceAdded"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onIfaceRemoved"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onDebugRingBufferDataAvailable"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiDebugRingBufferStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onDebugErrorAlert"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiEventCallback.vts b/wifi/1.0/vts/WifiEventCallback.vts
new file mode 100644
index 0000000..a0cf667
--- /dev/null
+++ b/wifi/1.0/vts/WifiEventCallback.vts
@@ -0,0 +1,26 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiEventCallback"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "onStart"
+    }
+
+    api: {
+        name: "onStop"
+    }
+
+    api: {
+        name: "onFailure"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiIface.vts b/wifi/1.0/vts/WifiIface.vts
new file mode 100644
index 0000000..1434a3e
--- /dev/null
+++ b/wifi/1.0/vts/WifiIface.vts
@@ -0,0 +1,33 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiIface"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiNanIface.vts b/wifi/1.0/vts/WifiNanIface.vts
new file mode 100644
index 0000000..663b526
--- /dev/null
+++ b/wifi/1.0/vts/WifiNanIface.vts
@@ -0,0 +1,278 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiNanIface"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiIface"
+import: "android.hardware.wifi@1.0::IWifiNanIfaceEventCallback"
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "registerEventCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "IWifiNanIfaceEventCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "getCapabilitiesRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "enableRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanEnableRequest"
+        }
+    }
+
+    api: {
+        name: "configRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanConfigRequest"
+        }
+    }
+
+    api: {
+        name: "disableRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "startPublishRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanPublishRequest"
+        }
+    }
+
+    api: {
+        name: "stopPublishRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "startSubscribeRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanSubscribeRequest"
+        }
+    }
+
+    api: {
+        name: "stopSubscribeRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "transmitFollowupRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanTransmitFollowupRequest"
+        }
+    }
+
+    api: {
+        name: "createDataInterfaceRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "deleteDataInterfaceRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "initiateDataPathRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanInitiateDataPathRequest"
+        }
+    }
+
+    api: {
+        name: "respondToDataPathIndicationRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanRespondToDataPathIndicationRequest"
+        }
+    }
+
+    api: {
+        name: "terminateDataPathRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "beaconSdfPayloadRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadRequest"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiNanIfaceEventCallback.vts b/wifi/1.0/vts/WifiNanIfaceEventCallback.vts
new file mode 100644
index 0000000..30ca88a
--- /dev/null
+++ b/wifi/1.0/vts/WifiNanIfaceEventCallback.vts
@@ -0,0 +1,318 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiNanIfaceEventCallback"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "notifyCapabilitiesResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanCapabilities"
+        }
+    }
+
+    api: {
+        name: "notifyEnableResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyConfigResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyDisableResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyStartPublishResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "notifyStopPublishResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyStartSubscribeResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+    }
+
+    api: {
+        name: "notifyStopSubscribeResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyTransmitFollowupResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyCreateDataInterfaceResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyDeleteDataInterfaceResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyInitiateDataPathResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyRespondToDataPathIndicationResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "notifyTerminateDataPathResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "notifyBeaconSdfPayloadResponse"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "eventClusterEvent"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanClusterEventInd"
+        }
+    }
+
+    api: {
+        name: "eventDisabled"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "eventPublishTerminated"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "eventSubscribeTerminated"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "eventMatch"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanMatchInd"
+        }
+    }
+
+    api: {
+        name: "eventMatchExpired"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "eventFollowupReceived"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanFollowupReceivedInd"
+        }
+    }
+
+    api: {
+        name: "eventTransmitFollowup"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+        }
+    }
+
+    api: {
+        name: "eventDataPathRequest"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanDataPathRequestInd"
+        }
+    }
+
+    api: {
+        name: "eventDataPathConfirm"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanDataPathConfirmInd"
+        }
+    }
+
+    api: {
+        name: "eventDataPathTerminated"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "eventBeaconSdfPayload"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadInd"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiP2pIface.vts b/wifi/1.0/vts/WifiP2pIface.vts
new file mode 100644
index 0000000..b40c81e
--- /dev/null
+++ b/wifi/1.0/vts/WifiP2pIface.vts
@@ -0,0 +1,33 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiP2pIface"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiIface"
+
+interface: {
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiRttController.vts b/wifi/1.0/vts/WifiRttController.vts
new file mode 100644
index 0000000..0fd3626
--- /dev/null
+++ b/wifi/1.0/vts/WifiRttController.vts
@@ -0,0 +1,172 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiRttController"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiIface"
+import: "android.hardware.wifi@1.0::IWifiRttControllerEventCallback"
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "getBoundIface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "IWifiIface"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "registerEventCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "IWifiRttControllerEventCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "rangeRequest"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::RttConfig"
+            }
+        }
+    }
+
+    api: {
+        name: "rangeCancel"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ARRAY
+                vector_value: {
+                    vector_size: 6
+                    type: TYPE_SCALAR
+                    scalar_type: "uint8_t"
+                }
+            }
+        }
+    }
+
+    api: {
+        name: "getCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::RttCapabilities"
+        }
+    }
+
+    api: {
+        name: "setLci"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::RttLciInformation"
+        }
+    }
+
+    api: {
+        name: "setLcr"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::RttLcrInformation"
+        }
+    }
+
+    api: {
+        name: "getResponderInfo"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::RttResponder"
+        }
+    }
+
+    api: {
+        name: "enableResponder"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiChannelInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::RttResponder"
+        }
+    }
+
+    api: {
+        name: "disableResponder"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiRttControllerEventCallback.vts b/wifi/1.0/vts/WifiRttControllerEventCallback.vts
new file mode 100644
index 0000000..028fd03
--- /dev/null
+++ b/wifi/1.0/vts/WifiRttControllerEventCallback.vts
@@ -0,0 +1,25 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiRttControllerEventCallback"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "onResults"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::RttResult"
+            }
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiStaIface.vts b/wifi/1.0/vts/WifiStaIface.vts
new file mode 100644
index 0000000..0cff792
--- /dev/null
+++ b/wifi/1.0/vts/WifiStaIface.vts
@@ -0,0 +1,432 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiStaIface"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::IWifiIface"
+import: "android.hardware.wifi@1.0::IWifiStaIfaceEventCallback"
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::V1_0::IWifiStaIface::StaIfaceCapabilityMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "APF"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "BACKGROUND_SCAN"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "LINK_LAYER_STATS"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "RSSI_MONITOR"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "CONTROL_ROAMING"
+            scalar_value: {
+                uint32_t: 16
+            }
+            enumerator: "PROBE_IE_WHITELIST"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "SCAN_RAND"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "STA_5G"
+            scalar_value: {
+                uint32_t: 128
+            }
+            enumerator: "HOTSPOT"
+            scalar_value: {
+                uint32_t: 256
+            }
+            enumerator: "PNO"
+            scalar_value: {
+                uint32_t: 512
+            }
+            enumerator: "TDLS"
+            scalar_value: {
+                uint32_t: 1024
+            }
+            enumerator: "TDLS_OFFCHANNEL"
+            scalar_value: {
+                uint32_t: 2048
+            }
+            enumerator: "ND_OFFLOAD"
+            scalar_value: {
+                uint32_t: 4096
+            }
+            enumerator: "KEEP_ALIVE"
+            scalar_value: {
+                uint32_t: 8192
+            }
+            enumerator: "DEBUG_PACKET_FATE"
+            scalar_value: {
+                uint32_t: 16384
+            }
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "registerEventCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "IWifiStaIfaceEventCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "getCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::V1_0::IWifiStaIface::StaIfaceCapabilityMask"
+        }
+    }
+
+    api: {
+        name: "getApfPacketFilterCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaApfPacketFilterCapabilities"
+        }
+    }
+
+    api: {
+        name: "installApfPacketFilter"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getBackgroundScanCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanCapabilities"
+        }
+    }
+
+    api: {
+        name: "getValidFrequenciesForBackgroundScan"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint32_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanBand"
+        }
+    }
+
+    api: {
+        name: "startBackgroundScan"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanParameters"
+        }
+    }
+
+    api: {
+        name: "stopBackgroundScan"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "enableLinkLayerStatsCollection"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "disableLinkLayerStatsCollection"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+    }
+
+    api: {
+        name: "getLinkLayerStats"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerStats"
+        }
+    }
+
+    api: {
+        name: "startRssiMonitoring"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "stopRssiMonitoring"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getRoamingCapabilities"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaRoamingCapabilities"
+        }
+    }
+
+    api: {
+        name: "configureRoaming"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaRoamingConfig"
+        }
+    }
+
+    api: {
+        name: "setRoamingState"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::V1_0::StaRoamingState"
+        }
+    }
+
+    api: {
+        name: "enableNdOffload"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "startSendingKeepAlivePackets"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "stopSendingKeepAlivePackets"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "startDebugPacketFateMonitoring"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+    }
+
+    api: {
+        name: "stopDebugPacketFateMonitoring"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+    }
+
+    api: {
+        name: "getDebugTxPacketFates"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::WifiDebugTxPacketFateReport"
+            }
+        }
+    }
+
+    api: {
+        name: "getDebugRxPacketFates"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::WifiDebugRxPacketFateReport"
+            }
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/WifiStaIfaceEventCallback.vts b/wifi/1.0/vts/WifiStaIfaceEventCallback.vts
new file mode 100644
index 0000000..b04ad26
--- /dev/null
+++ b/wifi/1.0/vts/WifiStaIfaceEventCallback.vts
@@ -0,0 +1,65 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IWifiStaIfaceEventCallback"
+
+package: "android.hardware.wifi"
+
+import: "android.hardware.wifi@1.0::types"
+
+interface: {
+    api: {
+        name: "onBackgroundScanFailure"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onBackgroundFullScanResult"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaScanResult"
+        }
+    }
+
+    api: {
+        name: "onBackgroundScanResults"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::V1_0::StaScanData"
+            }
+        }
+    }
+
+    api: {
+        name: "onRssiThresholdBreached"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+}
diff --git a/wifi/1.0/vts/types.vts b/wifi/1.0/vts/types.vts
new file mode 100644
index 0000000..fd60d4e
--- /dev/null
+++ b/wifi/1.0/vts/types.vts
@@ -0,0 +1,2846 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.wifi"
+
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiStatusCode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "ERROR_WIFI_CHIP_INVALID"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "ERROR_WIFI_IFACE_INVALID"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "ERROR_WIFI_RTT_CONTROLLER_INVALID"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "ERROR_NOT_SUPPORTED"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "ERROR_NOT_AVAILABLE"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "ERROR_NOT_STARTED"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "ERROR_INVALID_ARGS"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "ERROR_BUSY"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "ERROR_UNKNOWN"
+        scalar_value: {
+            uint32_t: 9
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "code"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiStatusCode"
+    }
+    struct_value: {
+        name: "description"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::IfaceType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "STA"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "AP"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "P2P"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "NAN"
+        scalar_value: {
+            uint32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiChannelWidthInMhz"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "WIDTH_20"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "WIDTH_40"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "WIDTH_80"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "WIDTH_160"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "WIDTH_80P80"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "WIDTH_5"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "WIDTH_10"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "WIDTH_INVALID"
+        scalar_value: {
+            uint32_t: 4294967295
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiChannelInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "width"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiChannelWidthInMhz"
+    }
+    struct_value: {
+        name: "centerFreq"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "centerFreq0"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "centerFreq1"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiInformationElement"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "id"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "data"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiRatePreamble"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "OFDM"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "CCK"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "HT"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "VHT"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "RESERVED"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiRateNss"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "NSS_1x1"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "NSS_2x2"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "NSS_3x3"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "NSS_4x4"
+        scalar_value: {
+            uint32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiRateInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "preamble"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiRatePreamble"
+    }
+    struct_value: {
+        name: "nss"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiRateNss"
+    }
+    struct_value: {
+        name: "bw"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiChannelWidthInMhz"
+    }
+    struct_value: {
+        name: "rateMcsIdx"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "bitRateInKbps"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaApfPacketFilterCapabilities"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "version"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxLength"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaBackgroundScanCapabilities"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "maxCacheSize"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxBuckets"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxApCachePerScan"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxReportingThreshold"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaBackgroundScanBand"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "BAND_UNSPECIFIED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "BAND_24GHZ"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "BAND_5GHZ"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "BAND_5GHZ_DFS"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "BAND_5GHZ_WITH_DFS"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "BAND_24GHZ_5GHZ"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "BAND_24GHZ_5GHZ_WITH_DFS"
+        scalar_value: {
+            uint32_t: 7
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaBackgroundScanBucketEventReportSchemeMask"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "EACH_SCAN"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FULL_RESULTS"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "NO_BATCH"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaBackgroundScanBucketParameters"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "band"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanBand"
+    }
+    struct_value: {
+        name: "frequencies"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "periodInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "eventReportScheme"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanBucketEventReportSchemeMask"
+    }
+    struct_value: {
+        name: "exponentialMaxPeriodInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "exponentialBase"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "exponentialStepCount"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaBackgroundScanParameters"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "basePeriodInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxApPerScan"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "reportThresholdPercent"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "reportThresholdNumScans"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "buckets"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaBackgroundScanBucketParameters"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaLinkLayerIfacePacketStats"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rxMpdu"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "txMpdu"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "lostMpdu"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "retries"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaLinkLayerIfaceStats"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "beaconRx"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "avgRssiMgmt"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "wmeBePktStats"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerIfacePacketStats"
+    }
+    struct_value: {
+        name: "wmeBkPktStats"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerIfacePacketStats"
+    }
+    struct_value: {
+        name: "wmeViPktStats"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerIfacePacketStats"
+    }
+    struct_value: {
+        name: "wmeVoPktStats"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerIfacePacketStats"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaLinkLayerRadioStats"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "onTimeInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "txTimeInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "txTimeInMsPerLevel"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "rxTimeInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "onTimeInMsForScan"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaLinkLayerStats"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "iface"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerIfaceStats"
+    }
+    struct_value: {
+        name: "radio"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::StaLinkLayerRadioStats"
+    }
+    struct_value: {
+        name: "timeStampInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaScanResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "timeStampInUs"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "ssid"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "bssid"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "rssi"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "frequency"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "beaconPeriodInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "capability"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "informationElements"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::WifiInformationElement"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaScanDataFlagMask"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "INTERRUPTED"
+        scalar_value: {
+            int32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaScanData"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "flags"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::StaScanDataFlagMask"
+    }
+    struct_value: {
+        name: "bucketsScanned"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "results"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::StaScanResult"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaRoamingCapabilities"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "maxBlacklistSize"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxWhitelistSize"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaRoamingConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "bssidBlacklist"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+    struct_value: {
+        name: "ssidWhitelist"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 32
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::StaRoamingState"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint8_t"
+
+        enumerator: "ENABLED"
+        scalar_value: {
+            uint8_t: 0
+        }
+        enumerator: "DISABLED"
+        scalar_value: {
+            uint8_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanStatusType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "INTERNAL_FAILURE"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "PROTOCOL_FAILURE"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "INVALID_SESSION_ID"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "NO_RESOURCES_AVAILABLE"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "INVALID_ARGS"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "INVALID_PEER_ID"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "INVALID_NDP_ID"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "NAN_NOT_ALLOWED"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "NO_OTA_ACK"
+        scalar_value: {
+            uint32_t: 9
+        }
+        enumerator: "ALREADY_ENABLED"
+        scalar_value: {
+            uint32_t: 10
+        }
+        enumerator: "FOLLOWUP_TX_QUEUE_FULL"
+        scalar_value: {
+            uint32_t: 11
+        }
+        enumerator: "UNSUPPORTED_CONCURRENCY_NAN_DISABLED"
+        scalar_value: {
+            uint32_t: 12
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanBandIndex"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "NAN_BAND_24GHZ"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "NAN_BAND_5GHZ"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiNanStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanStatusType"
+    }
+    struct_value: {
+        name: "description"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanMatchAlg"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "MATCH_ONCE"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "MATCH_CONTINUOUS"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "MATCH_NEVER"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanPublishType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "UNSOLICITED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "SOLICITED"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "UNSOLICITED_SOLICITED"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanTxType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "BROADCAST"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "UNICAST"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanSubscribeType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "PASSIVE"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "ACTIVE"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanSrfType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "BLOOM_FILTER"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "PARTIAL_MAC_ADDR"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanDataPathChannelCfg"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "CHANNEL_NOT_REQUESTED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "REQUEST_CHANNEL_SETUP"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FORCE_CHANNEL_SETUP"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanBandSpecificConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rssiClose"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "rssiMiddle"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "rssiProximity"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "dwellTimeMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "scanPeriodSec"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "validDiscoveryWindowIntervalVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "discoveryWindowIntervalVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanDebugConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "validClusterIdVals"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "clusterIdLowVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "clusterIdHighVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "validIntfAddrVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "intfAddrVal"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "validOuiVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "ouiVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "validRandomFactorForceVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "randomFactorForceVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "validHopCountForceVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "hopCountForceVal"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "validDiscoveryChannelVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "discoveryChannelMhzVal"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "validUseBeaconsInBandVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "useBeaconsInBandVal"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+    struct_value: {
+        name: "validUseSdfInBandVal"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "useSdfInBandVal"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanConfigRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "masterPref"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "disableDiscoveryAddressChangeIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "disableStartedClusterIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "disableJoinedClusterIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "includeServiceIdsInBeacon"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "numberOfServiceIdsInBeacon"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "rssiWindowSize"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "macAddressRandomizationIntervalSec"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "acceptRangingRequests"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "bandSpecificConfig"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::V1_0::NanBandSpecificConfig"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanEnableRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "operateInBand"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+    struct_value: {
+        name: "hopCountMax"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "configParams"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::NanConfigRequest"
+    }
+    struct_value: {
+        name: "debugConfigs"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::NanDebugConfig"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SHARED_KEY_128_MASK"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "SHARED_KEY_256_MASK"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanRangingIndication"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "CONTINUOUS_INDICATION_MASK"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "INGRESS_MET_MASK"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "EGRESS_MET_MASK"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanDiscoveryCommonConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "sessionId"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "ttlSec"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "discoveryWindowPeriod"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "discoveryCount"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "serviceName"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "discoveryMatchIndicator"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanMatchAlg"
+    }
+    struct_value: {
+        name: "serviceSpecificInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "rxMatchFilter"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "txMatchFilter"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "useRssiThreshold"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "disableDiscoveryTerminationIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "disableMatchExpirationIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "disableFollowupReceivedIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "supportedCipherTypes"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    }
+    struct_value: {
+        name: "pmk"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "securityEnabledInNdp"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "rangingRequired"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "rangingIntervalMsec"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "configRangingIndications"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanRangingIndication"
+    }
+    struct_value: {
+        name: "distanceIngressCm"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "distanceEgressCm"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanPublishRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "baseConfigs"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::NanDiscoveryCommonConfig"
+    }
+    struct_value: {
+        name: "publishType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanPublishType"
+    }
+    struct_value: {
+        name: "txType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanTxType"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanSubscribeRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "baseConfigs"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::NanDiscoveryCommonConfig"
+    }
+    struct_value: {
+        name: "subscribeType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanSubscribeType"
+    }
+    struct_value: {
+        name: "srfType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanSrfType"
+    }
+    struct_value: {
+        name: "srfRespondIfInAddressSet"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "shouldUseSrf"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "isSsiRequiredForMatch"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "intfAddr"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanTransmitFollowupRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "discoverySessionId"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "peerId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "isHighPriority"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "shouldUseDiscoveryWindow"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "message"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "disableFollowupResultIndication"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanInitiateDataPathRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "peerId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "peerDiscMacAddr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "channelRequestType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanDataPathChannelCfg"
+    }
+    struct_value: {
+        name: "channel"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ifaceName"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "securityRequired"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "appInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "supportedCipherTypes"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    }
+    struct_value: {
+        name: "pmk"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanRespondToDataPathIndicationRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "acceptRequest"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "ndpInstanceId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ifaceName"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "securityRequired"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "appInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "supportedCipherTypes"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    }
+    struct_value: {
+        name: "pmk"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadRequest"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "transmitInNext16dws"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "transmitInDiscoveryBeacon"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "transmitInSyncBeacon"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "transmitInServiceDiscoveryFrame"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "vendorOui"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "vsa"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanCapabilities"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "maxConcurrentClusters"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxPublishes"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxSubscribes"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxServiceNameLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxMatchFilterLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxTotalMatchFilterLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxServiceSpecificInfoLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxVsaDataLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxNdiInterfaces"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxNdpSessions"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxAppInfoLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxQueuedTransmitFollowupMsgs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "maxSubscribeInterfaceAddresses"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "supportedCipherSuites"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanMatchInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "discoverySessionId"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "peerId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "serviceSpecificInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "matchFilter"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "matchOccuredInBeaconFlag"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "outOfResourceFlag"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "rssiValue"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "peerSupportedCipherTypes"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanCipherSuiteType"
+    }
+    struct_value: {
+        name: "peerRequiresSecurityEnabledInNdp"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "peerRequiresRanging"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "rangingMeasurementInCm"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rangingIndicationType"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanRangingIndication"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanFollowupReceivedInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "discoverySessionId"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "peerId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "receivedInFaw"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "message"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanClusterEventType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "DISCOVERY_MAC_ADDRESS_CHANGED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "STARTED_CLUSTER"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "JOINED_CLUSTER"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanClusterEventInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "eventType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::NanClusterEventType"
+    }
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanVsaRxFrameMask"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "DISCOVERY_BEACON_MASK"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "SYNC_BEACON_MASK"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "SERVICE_DISCOVERY_MASK"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "isVsaReceived"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "vsaReceivedOnFrames"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::NanVsaRxFrameMask"
+    }
+    struct_value: {
+        name: "vsaVendorOui"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "vsa"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "isBeaconSdfPayloadReceived"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "beaconSdfPayloadData"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanDataPathRequestInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "discoverySessionId"
+        type: TYPE_SCALAR
+        scalar_type: "uint16_t"
+    }
+    struct_value: {
+        name: "peerDiscMacAddr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "ndpInstanceId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "securityRequired"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "appInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::NanDataPathConfirmInd"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "ndpInstanceId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "dataPathSetupSuccess"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "peerNdiMacAddr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "appInfo"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "status"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "FAILURE"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FAIL_NO_RSP"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "FAIL_REJECTED"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "FAIL_NOT_SCHEDULED_YET"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "FAIL_TM_TIMEOUT"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "FAIL_AP_ON_DIFF_CHANNEL"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "FAIL_NO_CAPABILITY"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "ABORTED"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "FAIL_INVALID_TS"
+        scalar_value: {
+            uint32_t: 9
+        }
+        enumerator: "FAIL_PROTOCOL"
+        scalar_value: {
+            uint32_t: 10
+        }
+        enumerator: "FAIL_SCHEDULE"
+        scalar_value: {
+            uint32_t: 11
+        }
+        enumerator: "FAIL_BUSY_TRY_LATER"
+        scalar_value: {
+            uint32_t: 12
+        }
+        enumerator: "INVALID_REQ"
+        scalar_value: {
+            uint32_t: 13
+        }
+        enumerator: "NO_WIFI"
+        scalar_value: {
+            uint32_t: 14
+        }
+        enumerator: "FAIL_FTM_PARAM_OVERRIDE"
+        scalar_value: {
+            uint32_t: 15
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttPeerType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "AP"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "STA"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "P2P_GO"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "P2P_CLIENT"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "NAN"
+        scalar_value: {
+            uint32_t: 5
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttBw"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "BW_5MHZ"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "BW_10MHZ"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "BW_20MHZ"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "BW_40MHZ"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "BW_80MHZ"
+        scalar_value: {
+            uint32_t: 16
+        }
+        enumerator: "BW_160MHZ"
+        scalar_value: {
+            uint32_t: 32
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttPreamble"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "LEGACY"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "HT"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "VHT"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "ONE_SIDED"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "TWO_SIDED"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttConfig"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttType"
+    }
+    struct_value: {
+        name: "peer"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttPeerType"
+    }
+    struct_value: {
+        name: "channel"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiChannelInfo"
+    }
+    struct_value: {
+        name: "burstPeriod"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "numBurst"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "numFramesPerBurst"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "numRetriesPerRttFrame"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "numRetriesPerFtmr"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "mustRequestLci"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "mustRequestLcr"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "burstDuration"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "preamble"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttPreamble"
+    }
+    struct_value: {
+        name: "bw"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttBw"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttResult"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "addr"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 6
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+    struct_value: {
+        name: "burstNum"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "measurementNumber"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "successNumber"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "numberPerBurstPeer"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "status"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttStatus"
+    }
+    struct_value: {
+        name: "retryAfterDuration"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "type"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttType"
+    }
+    struct_value: {
+        name: "rssi"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "rssiSpread"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "txRate"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiRateInfo"
+    }
+    struct_value: {
+        name: "rxRate"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiRateInfo"
+    }
+    struct_value: {
+        name: "rtt"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "rttSd"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "rttSpread"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "distanceInMm"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "distanceSdInMm"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "distanceSpreadInMm"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "timeStampInUs"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "burstDurationInMs"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "negotiatedBurstNum"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "lci"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiInformationElement"
+    }
+    struct_value: {
+        name: "lcr"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiInformationElement"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttCapabilities"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rttOneSidedSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "rttFtmSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "lciSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "lcrSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "responderSupported"
+        type: TYPE_SCALAR
+        scalar_type: "bool_t"
+    }
+    struct_value: {
+        name: "preambleSupport"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::RttPreamble"
+    }
+    struct_value: {
+        name: "bwSupport"
+        type: TYPE_MASK
+        predefined_type: "::android::hardware::wifi::V1_0::RttBw"
+    }
+    struct_value: {
+        name: "mcVersion"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttMotionPattern"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "NOT_EXPECTED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "EXPECTED"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttLciInformation"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "latitude"
+        type: TYPE_SCALAR
+        scalar_type: "int64_t"
+    }
+    struct_value: {
+        name: "longitude"
+        type: TYPE_SCALAR
+        scalar_type: "int64_t"
+    }
+    struct_value: {
+        name: "altitude"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "latitudeUnc"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "longitudeUnc"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "altitudeUnc"
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+    }
+    struct_value: {
+        name: "motionPattern"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttMotionPattern"
+    }
+    struct_value: {
+        name: "floor"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "heightAboveFloor"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+    struct_value: {
+        name: "heightUnc"
+        type: TYPE_SCALAR
+        scalar_type: "int32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttLcrInformation"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "countryCode"
+        type: TYPE_ARRAY
+        vector_value: {
+            vector_size: 2
+            type: TYPE_SCALAR
+            scalar_type: "int8_t"
+        }
+    }
+    struct_value: {
+        name: "civicInfo"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::RttResponder"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "channel"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiChannelInfo"
+    }
+    struct_value: {
+        name: "preamble"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::RttPreamble"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugRingBufferFlags"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "HAS_BINARY_ENTRIES"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "HAS_ASCII_ENTRIES"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "HAS_PER_PACKET_ENTRIES"
+        scalar_value: {
+            uint32_t: 4
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugRingBufferStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "ringName"
+        type: TYPE_STRING
+    }
+    struct_value: {
+        name: "flags"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ringId"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "sizeInBytes"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "freeSizeInBytes"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "verboseLevel"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugRingBufferVerboseLevel"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "NONE"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "DEFAULT"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "VERBOSE"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "EXCESSIVE"
+        scalar_value: {
+            uint32_t: 3
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugTxPacketFate"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "ACKED"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "SENT"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FW_QUEUED"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "FW_DROP_INVALID"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "FW_DROP_NOBUFS"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "FW_DROP_OTHER"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "DRV_QUEUED"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "DRV_DROP_INVALID"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "DRV_DROP_NOBUFS"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "DRV_DROP_OTHER"
+        scalar_value: {
+            uint32_t: 9
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugRxPacketFate"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "FW_QUEUED"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FW_DROP_FILTER"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "FW_DROP_INVALID"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "FW_DROP_NOBUFS"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "FW_DROP_OTHER"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "DRV_QUEUED"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "DRV_DROP_FILTER"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "DRV_DROP_INVALID"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "DRV_DROP_NOBUFS"
+        scalar_value: {
+            uint32_t: 9
+        }
+        enumerator: "DRV_DROP_OTHER"
+        scalar_value: {
+            uint32_t: 10
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugPacketFateFrameType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "UNKNOWN"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "ETHERNET_II"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "MGMT_80211"
+        scalar_value: {
+            uint32_t: 2
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugPacketFateFrameInfo"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "frameType"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugPacketFateFrameType"
+    }
+    struct_value: {
+        name: "frameLen"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "driverTimestampUsec"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "firmwareTimestampUsec"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+    struct_value: {
+        name: "frameContent"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugTxPacketFateReport"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "fate"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugTxPacketFate"
+    }
+    struct_value: {
+        name: "frameInfo"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugPacketFateFrameInfo"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugRxPacketFateReport"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "fate"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugRxPacketFate"
+    }
+    struct_value: {
+        name: "frameInfo"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugPacketFateFrameInfo"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxPacketDetails"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "rxUnicastCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rxMulticastCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rxBroadcastCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxMulticastPacketDetails"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "ipv4RxMulticastAddrCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "ipv6RxMulticastAddrCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "otherRxMulticastAddrCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxIcmpPacketDetails"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "icmpPkt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "icmp6Pkt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "icmp6Ra"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "icmp6Na"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "icmp6Ns"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonStats"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "totalCmdEventWakeCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "cmdEventWakeCntPerType"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "totalDriverFwLocalWakeCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "driverFwLocalWakeCntPerType"
+        type: TYPE_VECTOR
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+    struct_value: {
+        name: "totalRxPacketWakeCnt"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "rxPktWakeDetails"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxPacketDetails"
+    }
+    struct_value: {
+        name: "rxMulticastPkWakeDetails"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxMulticastPacketDetails"
+    }
+    struct_value: {
+        name: "rxIcmpPkWakeDetails"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::wifi::V1_0::WifiDebugHostWakeReasonRxIcmpPacketDetails"
+    }
+}
+
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 3100391..261d940 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -59,63 +59,63 @@
         "android/hardware/wifi/supplicant/1.0/types.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicant.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicant.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicant.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicant.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicant.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicant.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicant.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantCallback.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantCallback.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantCallback.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantIface.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantIface.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantIface.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantIface.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantIface.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantIface.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantIface.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantNetwork.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantNetwork.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantNetwork.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIface.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIface.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIface.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pIface.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pIface.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIface.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIfaceCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIfaceCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIfaceCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pIfaceCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetwork.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pNetwork.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetwork.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetworkCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetworkCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetworkCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pNetworkCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pNetworkCallback.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetworkCallback.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIface.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIface.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIface.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaIface.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaIface.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantStaIface.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIfaceCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIfaceCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIfaceCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaIfaceCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantStaIfaceCallback.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetwork.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaNetwork.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaNetwork.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetwork.h",
         "android/hardware/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.h",
         "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetworkCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetworkCallback.h",
-        "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetworkCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaNetworkCallback.h",
+        "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaNetworkCallback.h",
         "android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetworkCallback.h",
     ],
 }
diff --git a/wifi/supplicant/1.0/Android.mk b/wifi/supplicant/1.0/Android.mk
index 02a62b6..ad49b0a 100644
--- a/wifi/supplicant/1.0/Android.mk
+++ b/wifi/supplicant/1.0/Android.mk
@@ -36,6 +36,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (P2pGroupCapabilityMask)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/P2pGroupCapabilityMask.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi.supplicant@1.0::types.P2pGroupCapabilityMask
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (SupplicantStatus)
 #
 GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/SupplicantStatus.java
@@ -74,6 +93,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WpsConfigMethods)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/WpsConfigMethods.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi.supplicant@1.0::types.WpsConfigMethods
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build ISupplicant.hal
 #
 GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/ISupplicant.java
@@ -377,6 +415,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (P2pGroupCapabilityMask)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/P2pGroupCapabilityMask.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi.supplicant@1.0::types.P2pGroupCapabilityMask
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (SupplicantStatus)
 #
 GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/SupplicantStatus.java
@@ -415,6 +472,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WpsConfigMethods)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/WpsConfigMethods.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi.supplicant@1.0::types.WpsConfigMethods
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build ISupplicant.hal
 #
 GEN := $(intermediates)/android/hardware/wifi/supplicant/V1_0/ISupplicant.java
diff --git a/wifi/supplicant/1.0/ISupplicantCallback.hal b/wifi/supplicant/1.0/ISupplicantCallback.hal
index a5a0da5..3674cfb 100644
--- a/wifi/supplicant/1.0/ISupplicantCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantCallback.hal
@@ -37,4 +37,9 @@
    * @param ifName Name of the network interface, e.g., wlan0
    */
   oneway onInterfaceRemoved(string ifName);
+
+  /**
+   * Used to indicate that the supplicant daemon is terminating.
+   */
+  oneway onTerminating();
 };
diff --git a/wifi/supplicant/1.0/ISupplicantIface.hal b/wifi/supplicant/1.0/ISupplicantIface.hal
index 600df30..c0058a0 100644
--- a/wifi/supplicant/1.0/ISupplicantIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantIface.hal
@@ -24,6 +24,17 @@
  */
 interface ISupplicantIface {
   /**
+   * Size limits for some of the params used in this interface.
+   */
+  enum ParamSizeLimits : uint32_t {
+      WPS_DEVICE_NAME_MAX_LEN = 32,
+      WPS_MANUFACTURER_MAX_LEN = 64,
+      WPS_MODEL_NAME_MAX_LEN = 32,
+      WPS_MODEL_NUMBER_MAX_LEN = 32,
+      WPS_SERIAL_NUMBER_MAX_LEN = 32
+  };
+
+  /**
    * Retrieves the name of the network interface.
    *
    * @return status Status of the operation.
@@ -105,9 +116,92 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|
    * @return networkIds List of all network Id's controlled by the supplicant.
    */
   listNetworks()
       generates (SupplicantStatus status, vec<SupplicantNetworkId> networkIds);
+
+  /**
+   * Set the device name for WPS operations.
+   * User-friendly description of device (up to |WPS_DEVICE_NAME_MAX_LEN|
+   * octets encoded in UTF-8).
+   *
+   * @parm name Name to be set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsDeviceName(string name) generates (SupplicantStatus status);
+
+  /**
+   * Set the manufacturer for WPS operations.
+   * The manufacturer of the device (up to |WPS_MANUFACTURER_MAX_LEN| ASCII
+   * characters).
+   *
+   * @parm manufacturer Manufacture to be set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsManufacturer(string manufacturer) generates (SupplicantStatus status);
+
+  /**
+   * Set the model name for WPS operations.
+   * Model of the device (up to |WPS_MODEL_NAME_MAX_LEN| ASCII characters).
+   *
+   * @parm modelName Model name to be set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsModelName(string modelName) generates (SupplicantStatus status);
+
+  /**
+   * Set the model number for WPS operations.
+   * Additional device description (up to |WPS_MODEL_NUMBER_MAX_LEN| ASCII
+   * characters).
+   *
+   * @parm modelNumber Model number to be set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsModelNumber(string modelNumber) generates (SupplicantStatus status);
+
+  /**
+   * Set the serial number for WPS operations.
+   * Serial number of the device (up to |WPS_SERIAL_NUMBER_MAX_LEN| characters)
+   *
+   * @parm serialNumber Serial number to be set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsSerialNumber(string serialNumber) generates (SupplicantStatus status);
+
+  /**
+   * Set the list of supported config methods for WPS operations.
+   *
+   * @param configMethods Mask of WPS configuration methods supported by the
+   *        device.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   */
+  setWpsConfigMethods(bitfield<WpsConfigMethods> configMethods)
+      generates (SupplicantStatus status);
 };
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
index 0fa19c8..45e90f3 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -40,16 +40,6 @@
     KEYPAD
   };
 
-  enum GroupCapabilityMask : uint32_t {
-    GROUP_OWNER = 1 << 0,
-    PERSISTENT_GROUP = 1 << 1,
-    GROUP_LIMIT = 1 << 2,
-    INTRA_BSS_DIST = 1 << 3,
-    CROSS_CONN = 1 << 4,
-    PERSISTENT_RECONN = 1 << 5,
-    GROUP_FORMATION = 1 << 6
-  };
-
   /**
    * Use to specify a range of frequencies.
    * For example: 2412-2432,2462,5000-6000, etc.
@@ -261,12 +251,12 @@
   /**
    * Set up a P2P group owner manually (i.e., without group owner
    * negotiation with a specific peer). This is also known as autonomous
-   * group owner. Optional |persistent| may be used to specify restart of a
-   * persistent group.
+   * group owner. Optional |persistentNetworkId| may be used to specify
+   * restart of a persistent group.
    *
    * @param persistent Used to request a persistent group to be formed.
    * @param persistentNetworkId Used to specify the restart of a persistent
-   *        group.
+   *        group. Set to UINT32_MAX for a non-persistent group.
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
@@ -420,10 +410,11 @@
    *         |SupplicantStatusCode.SUCCESS|,
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
-   * @return capabilityMask Combination of |GroupCapabilityMask| values.
+   * @return capabilityMask Combination of |P2pGroupCapabilityMask| values.
    */
   getGroupCapability(MacAddress peerAddress)
-      generates (SupplicantStatus status, uint32_t capabilities);
+      generates (SupplicantStatus status,
+                 bitfield<P2pGroupCapabilityMask> capabilities);
 
   /**
    * This command can be used to add a bonjour service.
@@ -533,8 +524,92 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   setMiracastMode(MiracastMode mode)
       generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Push Button setup.
+   * The PBC operation requires that a button is also pressed at the
+   * AP/Registrar at about the same time (2 minute window).
+   *
+   * @param groupIfName Group interface name to use.
+   * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  startWpsPbc(string groupIfName, Bssid bssid)
+      generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Pin Keypad setup.
+   *
+   * @param groupIfName Group interface name to use.
+   * @param pin 8 digit pin to be used.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  startWpsPinKeypad(string groupIfName, string pin)
+      generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Pin Display setup.
+   *
+   * @param groupIfName Group interface name to use.
+   * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   * @return generatedPin 8 digit pin generated.
+   */
+  startWpsPinDisplay(string groupIfName, Bssid bssid)
+      generates (SupplicantStatus status, string generatedPin);
+
+  /**
+   * Cancel any ongoing WPS operations.
+   *
+   * @param groupIfName Group interface name to use.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+
+   */
+  cancelWps(string groupIfName) generates (SupplicantStatus status);
+
+  /**
+   * Enable/Disable Wifi Display.
+   *
+   * @param enable true to enable, false to disable.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  enableWfd(bool enable) generates (SupplicantStatus status);
+
+  /**
+   * Set Wifi Display device info.
+   *
+   * @param info WFD device info as described in section 5.1.2 of WFD technical
+   *        specification v1.0.0.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  setWfdDeviceInfo(uint8_t[8] info) generates (SupplicantStatus status);
 };
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
index 9ac8b36..ad4290b 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
@@ -26,6 +26,50 @@
  */
 interface ISupplicantP2pIfaceCallback {
   /**
+   * WPS Device Password ID
+   */
+  enum WpsDevPasswordId : uint16_t {
+    DEFAULT = 0x0000,
+    USER_SPECIFIED = 0x0001,
+    MACHINE_SPECIFIED = 0x0002,
+    REKEY = 0x0003,
+    PUSHBUTTON = 0x0004,
+    REGISTRAR_SPECIFIED = 0x0005,
+    NFC_CONNECTION_HANDOVER = 0x0007,
+    P2PS_DEFAULT = 0x0008
+  };
+
+  /**
+   * Status codes for P2P operations.
+   */
+  enum P2pStatusCode : uint32_t {
+    SUCCESS = 0,
+    FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
+    FAIL_INCOMPATIBLE_PARAMS = 2,
+    FAIL_LIMIT_REACHED = 3,
+    FAIL_INVALID_PARAMS = 4,
+    FAIL_UNABLE_TO_ACCOMMODATE = 5,
+    FAIL_PREV_PROTOCOL_ERROR = 6,
+    FAIL_NO_COMMON_CHANNELS = 7,
+    FAIL_UNKNOWN_GROUP = 8,
+    FAIL_BOTH_GO_INTENT_15 = 9,
+    FAIL_INCOMPATIBLE_PROV_METHOD = 10,
+    FAIL_REJECTED_BY_USER = 11,
+    SUCCESS_DEFERRED = 12,
+  };
+
+  /**
+   * Status codes for P2P discovery.
+   */
+  enum P2pProvDiscStatusCode : uint8_t {
+    SUCCESS = 0,
+    TIMEOUT = 1,
+    REJECTED = 2,
+    TIMEOUT_JOIN = 3,
+    INFO_UNAVAILABLE = 4
+  };
+
+  /**
    * Used to indicate that a new network has been added.
    *
    * @param id Network ID allocated to the corresponding network.
@@ -38,4 +82,192 @@
    * @param id Network ID allocated to the corresponding network.
    */
   oneway onNetworkRemoved(SupplicantNetworkId id);
+
+  /**
+   * Used to indicate that a P2P device has been found.
+   *
+   * @param srcAddress MAC address of the device found. This must either
+   *        be the P2P device address or the P2P interface address.
+   * @param p2pDeviceAddress P2P device address.
+   * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P
+   *        Technical specification v1.2.
+   * @param deviceName Name of the device.
+   * @param configMethods Mask of WPS configuration methods supported by the
+   *        device.
+   * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical
+   *        specification v1.2.
+   * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical
+   *        specification v1.2.
+   * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD
+   *        technical specification v1.0.0.
+   */
+  oneway onDeviceFound(
+      MacAddress srcAddress, MacAddress p2pDeviceAddress,
+      uint8_t[8] primaryDeviceType, string deviceName,
+      bitfield<WpsConfigMethods> configMethods, uint8_t deviceCapabilities,
+      bitfield<P2pGroupCapabilityMask> groupCapabilities, uint8_t[8] wfdDeviceInfo);
+
+  /**
+   * Used to indicate that a P2P device has been lost.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onDeviceLost(MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate the termination of P2P find operation.
+   */
+  oneway onFindStopped();
+
+  /**
+   * Used to indicate the reception of a P2P Group Owner negotiation request.
+   *
+   * @param srcAddress MAC address of the device that initiated the GO
+   *        negotiation request.
+   * @param passwordId Type of password.
+   */
+  oneway onGoNegotiationRequest(
+      MacAddress srcAddress, WpsDevPasswordId passwordId);
+
+  /**
+   * Used to indicate the completion of a P2P Group Owner negotiation request.
+   *
+   * @param status Status of the GO negotiation.
+   */
+  oneway onGoNegotiationCompleted(P2pStatusCode status);
+
+  /**
+   * Used to indicate a successful formation of a P2P group.
+   */
+  oneway onGroupFormationSuccess();
+
+  /**
+   * Used to indicate a failure to form a P2P group.
+   *
+   * @param failureReason Failure reason string for debug purposes.
+   */
+  oneway onGroupFormationFailure(string failureReason);
+
+  /**
+   * Used to indicate the start of a P2P group.
+   *
+   * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+   * @param isGo Whether this device is owner of the group.
+   * @param ssid SSID of the group.
+   * @param frequency Frequency on which this group is created.
+   * @param psk PSK used to secure the group.
+   * @param passphrase PSK passphrase used to secure the group.
+   * @param goDeviceAddress MAC Address of the owner of this group.
+   * @param isPersistent Whether this group is persisted or not.
+   */
+  oneway onGroupStarted(
+      string groupIfname, bool isGo, Ssid ssid, uint32_t frequency,
+      uint8_t[32] psk, string passphrase, MacAddress goDeviceAddress,
+      bool isPersistent);
+
+  /**
+   * Used to indicate the removal of a P2P group.
+   *
+   * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+   * @param isGo Whether this device is owner of the group.
+   */
+  oneway onGroupRemoved(string groupIfname, bool isGo);
+
+  /**
+   * Used to indicate the reception of a P2P invitation.
+   *
+   * @param srcAddress MAC address of the device that sent the invitation.
+   * @param goDeviceAddress MAC Address of the owner of this group.
+   * @param Bssid Bssid of the group.
+   * @param persistentNetworkId Persistent network Id of the group.
+   * @param operatingFrequency Frequency on which the invitation was received.
+   */
+  oneway onInvitationReceived(
+      MacAddress srcAddress, MacAddress goDeviceAddress, Bssid bssid,
+      SupplicantNetworkId persistentNetworkId, uint32_t operatingFrequency);
+
+  /**
+   * Used to indicate the result of the P2P invitation request.
+   *
+   * @param Bssid Bssid of the group.
+   * @param status Status of the invitation.
+   */
+  oneway onInvitationResult(Bssid bssid, P2pStatusCode status);
+
+  /**
+   * Used to indicate a push-button request generated during provision discovery.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onProvisionDiscoveryPbcRequest(MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate a push-button response generated during provision discovery.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onProvisionDiscoveryPbcResponse(MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate the pin generated during provision discovery.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   * @param generatedPin 8 digit pin generated.
+   */
+  oneway onProvisionDiscoveryShowPin(
+      MacAddress p2pDeviceAddress, string generatedPin);
+
+  /**
+   * Used to indicate that a pin needs to be entered during provision discovery.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onProvisionDiscoveryEnterPin(MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate a provision discovery failure.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onProvisionDiscoveryFailure(MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate the completion of a P2P provision discovery request.
+   *
+   * @param p2pDeviceAddress P2P device address.
+   * @param isRequest Whether we received or sent the provision discovery.
+   * @param status Status of the provision discovery.
+   * @param configMethods Mask of WPS configuration methods supported.
+   * @param generatedPin 8 digit pin generated.
+   */
+  oneway onProvisionDiscoveryCompleted(
+      MacAddress p2pDeviceAddress, bool isRequest, P2pProvDiscStatusCode status,
+      bitfield<WpsConfigMethods> configMethods, string generatedPin);
+
+  /**
+   * Used to indicate the reception of a P2P service discovery response.
+   *
+   * @param srcAddress MAC address of the device that sent the service discovery.
+   * @param updateIndicator Service update indicator. Refer to section 3.1.3 of
+   *        Wifi P2P Technical specification v1.2.
+   * @parm tlvs Refer to section 3.1.3.1 of Wifi P2P Technical specification v1.2.
+   */
+  oneway onServiceDiscoveryResponse(
+      MacAddress srcAddress, uint16_t updateIndicator, vec<uint8_t> tlvs);
+
+  /**
+   * Used to indicate when a STA device is connected to this device.
+   *
+   * @param srcAddress MAC address of the device that was authorized.
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onStaAuthorized(MacAddress srcAddress, MacAddress p2pDeviceAddress);
+
+  /**
+   * Used to indicate when a STA device is disconnected from this device.
+   *
+   * @param srcAddress MAC address of the device that was deauthorized.
+   * @param p2pDeviceAddress P2P device address.
+   */
+  oneway onStaDeauthorized(MacAddress srcAddress, MacAddress p2pDeviceAddress);
 };
diff --git a/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
index 34727c4..d32b47e 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
@@ -42,4 +42,62 @@
    */
   registerCallback(ISupplicantP2pNetworkCallback callback)
       generates (SupplicantStatus status);
+
+  /**
+   * Getters for the various network params.
+   */
+  /**
+   * Get SSID for this network.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return ssid value set.
+   */
+  getSsid() generates (SupplicantStatus status, Ssid ssid);
+
+  /**
+   * Get the BSSID set for this network.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return bssid value set.
+   */
+  getBssid() generates (SupplicantStatus status, Bssid bssid);
+
+  /**
+   * Check if the network is currently active one.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return isCurrent true if current, false otherwise.
+   */
+  isCurrent() generates (SupplicantStatus status, bool isCurrent);
+
+  /**
+   * Check if the network is marked persistent.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return isPersistent true if persistent, false otherwise.
+   */
+  isPersistent() generates (SupplicantStatus status, bool isPersistent);
+
+  /**
+   * Check if the device is the group owner of the network.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return isGo true if group owner, false otherwise.
+   */
+  isGo() generates (SupplicantStatus status, bool isGo);
 };
diff --git a/wifi/supplicant/1.0/ISupplicantStaIface.hal b/wifi/supplicant/1.0/ISupplicantStaIface.hal
index 2fc4d0f..c9d9ee6 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIface.hal
@@ -219,7 +219,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    * @return macAddr MAC address of the device.
    */
   getMacAddress()
@@ -231,7 +232,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   startRxFilter() generates (SupplicantStatus status);
 
@@ -241,7 +243,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   stopRxFilter() generates (SupplicantStatus status);
 
@@ -252,7 +255,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   addRxFilter(RxFilterType type)
       generates (SupplicantStatus status);
@@ -264,7 +268,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   removeRxFilter(RxFilterType type)
       generates (SupplicantStatus status);
@@ -276,7 +281,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   setBtCoexistenceMode(BtCoexistenceMode mode)
       generates (SupplicantStatus status);
@@ -291,7 +297,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   setBtCoexistenceScanModeEnabled(bool enable)
       generates (SupplicantStatus status);
@@ -303,7 +310,8 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   setSuspendModeEnabled(bool enable)
       generates (SupplicantStatus status);
@@ -315,8 +323,86 @@
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
-   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
    */
   setCountryCode(int8_t[2] code)
       generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS setup in registrar role to learn the current AP configuration.
+   *
+   * @param bssid BSSID of the AP.
+   * @param pin Pin of the AP.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  startWpsRegistrar(Bssid bssid, string pin)
+      generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Push Button setup.
+   * The PBC operation requires that a button is also pressed at the
+   * AP/Registrar at about the same time (2 minute window).
+   *
+   * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  startWpsPbc(Bssid bssid) generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Pin Keypad setup.
+   *
+   * @param pin 8 digit pin to be used.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  startWpsPinKeypad(string pin) generates (SupplicantStatus status);
+
+  /**
+   * Initiate WPS Pin Display setup.
+   *
+   * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   * @return generatedPin 8 digit pin generated.
+   */
+  startWpsPinDisplay(Bssid bssid)
+      generates (SupplicantStatus status, string generatedPin);
+
+  /**
+   * Cancel any ongoing WPS operations.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  cancelWps() generates (SupplicantStatus status);
+
+  /**
+   * Use external processing for SIM/USIM operations
+   *
+   * @param useExternalSim true to use external, false otherwise.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+   */
+  setExternalSim(bool useExternalSim) generates (SupplicantStatus status);
 };
diff --git a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
index 8a894a0..4b201d4 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
@@ -139,6 +139,43 @@
   };
 
   /**
+   * WPS Configuration Error.
+   */
+  enum WpsConfigError : uint16_t {
+    NO_ERROR = 0,
+    OOB_IFACE_READ_ERROR = 1,
+    DECRYPTION_CRC_FAILURE = 2,
+    CHAN_24_NOT_SUPPORTED = 3,
+    CHAN_50_NOT_SUPPORTED = 4,
+    SIGNAL_TOO_WEAK = 5,
+    NETWORK_AUTH_FAILURE = 6,
+    NETWORK_ASSOC_FAILURE = 7,
+    NO_DHCP_RESPONSE = 8,
+    FAILED_DHCP_CONFIG = 9,
+    IP_ADDR_CONFLICT = 10,
+    NO_CONN_TO_REGISTRAR = 11,
+    MULTIPLE_PBC_DETECTED = 12,
+    ROGUE_SUSPECTED = 13,
+    DEVICE_BUSY = 14,
+    SETUP_LOCKED = 15,
+    MSG_TIMEOUT = 16,
+    REG_SESS_TIMEOUT = 17,
+    DEV_PASSWORD_AUTH_FAILURE = 18,
+    CHAN_60G_NOT_SUPPORTED = 19,
+    PUBLIC_KEY_HASH_MISMATCH = 20
+  };
+
+  /**
+   * Vendor specific Error Indication for WPS event messages.
+   */
+  enum WpsErrorIndication : uint16_t {
+    NO_ERROR = 0,
+    SECURITY_TKIP_ONLY_PROHIBITED = 1,
+    SECURITY_WEP_PROHIBITED = 2,
+    AUTH_FAILURE = 3
+  };
+
+  /**
    * Used to indicate that a new network has been added.
    *
    * @param id Network ID allocated to the corresponding network.
@@ -220,8 +257,15 @@
                                     string url);
 
   /**
-   * Used to indicate a disconnect from the currently connected
-   * network on this iface,.
+   * Used to indicate the connection to a new network on this iface.
+   *
+   * @param bssid BSSID of the AP to which we connected.
+   */
+  oneway onConnected(Bssid bssid);
+
+  /**
+   * Used to indicate the disconnection from the currently connected
+   * network on this iface.
    *
    * @param bssid BSSID of the AP from which we disconnected.
    * @param locallyGenerated If the disconnect was triggered by
@@ -233,6 +277,13 @@
           Bssid bssid, bool locallyGenerated, uint32_t reasonCode);
 
   /**
+   * Used to indicate the completion of association to an AP.
+   *
+   * @param bssid BSSID of the corresponding AP.
+   */
+  oneway onAssociationCompleted(Bssid bssid);
+
+  /**
    * Used to indicate an association rejection recieved from the AP
    * to which the connection is being attempted.
    *
@@ -242,4 +293,37 @@
    *        Refer to section 8.4.1.9 of IEEE 802.11 spec.
    */
   oneway onAssociationRejected(Bssid bssid, uint32_t statusCode);
+
+  /**
+   * Used to indicate the timeout of authentication to an AP.
+   *
+   * @param bssid BSSID of the corresponding AP.
+   */
+  oneway onAuthenticationTimeout(Bssid bssid);
+
+  /**
+   * Used to indicate an EAP authentication failure.
+   */
+  oneway onEapFailure();
+
+  /**
+   * Used to indicate the success of a WPS connection attempt.
+   */
+  oneway onWpsEventSuccess();
+
+  /**
+   * Used to indicate the failure of a WPS connection attempt.
+   *
+   * @param bssid BSSID of the AP to which we initiated WPS
+   *        connection.
+   * @param configError Configuration error code.
+   * @param errorInd Error indication code.
+   */
+  oneway onWpsEventFail(
+      Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd);
+
+  /**
+   * Used to indicate the overlap of a WPS PBC connection attempt.
+   */
+  oneway onWpsEventPbcOverlap();
 };
diff --git a/wifi/supplicant/1.0/ISupplicantStaNetwork.hal b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
index 479ba94..b347c1d 100644
--- a/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
@@ -51,7 +51,10 @@
     WPA_EAP = 1 << 0,
     WPA_PSK = 1 << 1,
     NONE = 1 << 2,
-    IEEE8021X = 1 << 3
+    IEEE8021X = 1 << 3,
+    FT_EAP = 1 << 5,
+    FT_PSK = 1 << 6,
+    OSEN = 1 << 15
   };
 
   /** Possble mask of values for Proto param. */
@@ -74,7 +77,8 @@
     WEP40 = 1 << 1,
     WEP104 = 1 << 2,
     TKIP = 1 << 3,
-    CCMP = 1 << 4
+    CCMP = 1 << 4,
+    GTK_NOT_USED = 1 << 14
   };
 
   /** Possble mask of values for PairwiseCipher param. */
@@ -193,7 +197,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setKeyMgmt(uint32_t keyMgmtMask) generates (SupplicantStatus status);
+  setKeyMgmt(bitfield<KeyMgmtMask> keyMgmtMask) generates (SupplicantStatus status);
 
   /**
    * Set proto mask for the network.
@@ -207,7 +211,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setProto(uint32_t protoMask) generates (SupplicantStatus status);
+  setProto(bitfield<ProtoMask> protoMask) generates (SupplicantStatus status);
 
   /**
    * Set auth alg mask for the network.
@@ -221,7 +225,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setAuthAlg(uint32_t authAlgMask) generates (SupplicantStatus status);
+  setAuthAlg(bitfield<AuthAlgMask> authAlgMask) generates (SupplicantStatus status);
 
   /**
    * Set group cipher mask for the network.
@@ -235,7 +239,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setGroupCipher(uint32_t groupCipherMask)
+  setGroupCipher(bitfield<GroupCipherMask> groupCipherMask)
       generates (SupplicantStatus status);
 
   /**
@@ -250,7 +254,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setPairwiseCipher(uint32_t pairwiseCipherMask)
+  setPairwiseCipher(bitfield<PairwiseCipherMask> pairwiseCipherMask)
       generates (SupplicantStatus status);
 
   /**
@@ -504,6 +508,19 @@
    */
   setEapDomainSuffixMatch(string match)
       generates (SupplicantStatus status);
+  /**
+   * Get ID string set for this network.
+   * Network identifier string for external scripts.
+   *
+   * @return idStr ID string value to set.
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   */
+  setIdStr(string idStr) generates (SupplicantStatus status);
 
   /**
    * Getters for the various network params.
@@ -551,7 +568,7 @@
    * @return keyMgmtMask Combination of |KeyMgmtMask| values.
    */
   getKeyMgmt()
-      generates (SupplicantStatus status, uint32_t keyMgmtMask);
+      generates (SupplicantStatus status, bitfield<KeyMgmtMask> keyMgmtMask);
 
   /**
    * Get the proto mask set for the network.
@@ -562,7 +579,7 @@
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    * @return protoMask Combination of |ProtoMask| values.
    */
-  getProto() generates (SupplicantStatus status, uint32_t protoMask);
+  getProto() generates (SupplicantStatus status, bitfield<ProtoMask> protoMask);
 
   /**
    * Get the auth alg mask set for the network.
@@ -574,7 +591,7 @@
    * @return authAlgMask Combination of |AuthAlgMask| values.
    */
   getAuthAlg()
-      generates (SupplicantStatus status, uint32_t authAlgMask);
+      generates (SupplicantStatus status, bitfield<AuthAlgMask> authAlgMask);
 
   /**
    * Get the group cipher mask set for the network.
@@ -586,7 +603,8 @@
    * @return groupCipherMask Combination of |GroupCipherMask| values.
    */
   getGroupCipher()
-      generates (SupplicantStatus status, uint32_t groupCipherMask);
+      generates (SupplicantStatus status,
+                 bitfield<GroupCipherMask> groupCipherMask);
 
   /**
    * Get the pairwise cipher mask set for the network.
@@ -598,7 +616,8 @@
    * @return pairwiseCipherMask Combination of |PairwiseCipherMask| values.
    */
   getPairwiseCipher()
-      generates (SupplicantStatus status, uint32_t pairwiseCipherMask);
+      generates (SupplicantStatus status,
+                 bitfield<PairwiseCipherMask> pairwiseCipherMask);
 
   /**
    * Get passphrase for WPA_PSK network.
@@ -827,6 +846,20 @@
       generates (SupplicantStatus status, string match);
 
   /**
+   * Get ID string set for this network.
+   * Network identifier string for external scripts.
+   *
+   * @return status Status of the operation.
+   *         Possible status codes:
+   *         |SupplicantStatusCode.SUCCESS|,
+   *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+   * @return idStr ID string set.
+   */
+  getIdStr() generates (SupplicantStatus status, string idStr);
+
+  /**
    * Enable the network for connection purposes.
    *
    * This must trigger a connection to the network if:
diff --git a/wifi/supplicant/1.0/types.hal b/wifi/supplicant/1.0/types.hal
index 16a8d15..10cf483 100644
--- a/wifi/supplicant/1.0/types.hal
+++ b/wifi/supplicant/1.0/types.hal
@@ -73,3 +73,38 @@
   STA,
   P2P
 };
+
+/**
+ * P2P group capability.
+ */
+enum P2pGroupCapabilityMask : uint32_t {
+  GROUP_OWNER = 1 << 0,
+  PERSISTENT_GROUP = 1 << 1,
+  GROUP_LIMIT = 1 << 2,
+  INTRA_BSS_DIST = 1 << 3,
+  CROSS_CONN = 1 << 4,
+  PERSISTENT_RECONN = 1 << 5,
+  GROUP_FORMATION = 1 << 6
+};
+
+/**
+ * WPS config methods.
+ * Refer to section 3 of IBSS with Wi-Fi Protected Setup
+ * Technical Specification Version 1.0.0.
+ */
+enum WpsConfigMethods : uint16_t {
+  USBA = 0x0001,
+  ETHERNET = 0x0002,
+  LABEL = 0x0004,
+  DISPLAY = 0x0008,
+  EXT_NFC_TOKEN = 0x0010,
+  INT_NFC_TOKEN = 0x0020,
+  NFC_INTERFACE = 0x0040,
+  PUSHBUTTON = 0x0080,
+  KEYPAD = 0x0100,
+  VIRT_PUSHBUTTON = 0x0280,
+  PHY_PUSHBUTTON = 0x0480,
+  P2PS = 0x1000,
+  VIRT_DISPLAY = 0x2008,
+  PHY_DISPLAY = 0x4008
+};
diff --git a/wifi/supplicant/1.0/vts/Supplicant.vts b/wifi/supplicant/1.0/vts/Supplicant.vts
new file mode 100644
index 0000000..69fe209
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/Supplicant.vts
@@ -0,0 +1,160 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicant"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantCallback"
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantIface"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::DebugLevel"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "EXCESSIVE"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "MSGDUMP"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "DEBUG"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "INFO"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "WARNING"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "ERROR"
+            scalar_value: {
+                uint32_t: 5
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::IfaceInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "type"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+        struct_value: {
+            name: "name"
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getInterface"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantIface"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::IfaceInfo"
+        }
+    }
+
+    api: {
+        name: "listInterfaces"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::IfaceInfo"
+            }
+        }
+    }
+
+    api: {
+        name: "registerCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISupplicantCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "setDebugParams"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::DebugLevel"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getDebugLevel"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicant::DebugLevel"
+        }
+    }
+
+    api: {
+        name: "isDebugShowTimestampEnabled"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "isDebugShowKeysEnabled"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setConcurrencyPriority"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantCallback.vts b/wifi/supplicant/1.0/vts/SupplicantCallback.vts
new file mode 100644
index 0000000..e439bd6
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantCallback.vts
@@ -0,0 +1,27 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantCallback"
+
+package: "android.hardware.wifi.supplicant"
+
+
+interface: {
+    api: {
+        name: "onInterfaceCreated"
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onInterfaceRemoved"
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onTerminating"
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantIface.vts b/wifi/supplicant/1.0/vts/SupplicantIface.vts
new file mode 100644
index 0000000..41c77f8
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantIface.vts
@@ -0,0 +1,187 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantIface"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantNetwork"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantIface::ParamSizeLimits"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WPS_DEVICE_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MANUFACTURER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "WPS_MODEL_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MODEL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_SERIAL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "addNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "removeNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "listNetworks"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint32_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setWpsDeviceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsManufacturer"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsSerialNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsConfigMethods"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantNetwork.vts b/wifi/supplicant/1.0/vts/SupplicantNetwork.vts
new file mode 100644
index 0000000..edcabce
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantNetwork.vts
@@ -0,0 +1,45 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantNetwork"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    api: {
+        name: "getId"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getInterfaceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantP2pIface.vts b/wifi/supplicant/1.0/vts/SupplicantP2pIface.vts
new file mode 100644
index 0000000..afa9a8c
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantP2pIface.vts
@@ -0,0 +1,813 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantP2pIface"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantIface"
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantP2pIfaceCallback"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantIface::ParamSizeLimits"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WPS_DEVICE_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MANUFACTURER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "WPS_MODEL_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MODEL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_SERIAL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::WpsProvisionMethod"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "PBC"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "DISPLAY"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "KEYPAD"
+            scalar_value: {
+                uint32_t: 2
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::FreqRange"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "min"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "max"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::MiracastMode"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint8_t"
+
+            enumerator: "DISABLED"
+            scalar_value: {
+                uint8_t: 0
+            }
+            enumerator: "SOURCE"
+            scalar_value: {
+                uint8_t: 1
+            }
+            enumerator: "SINK"
+            scalar_value: {
+                uint8_t: 2
+            }
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "addNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "removeNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "listNetworks"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint32_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setWpsDeviceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsManufacturer"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsSerialNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsConfigMethods"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+        }
+    }
+
+    api: {
+        name: "registerCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISupplicantP2pIfaceCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "getDeviceAddress"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setSsidPostfix"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setGroupIdle"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "setPowerSave"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "find"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "stopFind"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "flush"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "connect"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::WpsProvisionMethod"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "cancelConnect"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "provisionDiscovery"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::WpsProvisionMethod"
+        }
+    }
+
+    api: {
+        name: "addGroup"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "removeGroup"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "reject"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "invite"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "reinvoke"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "configureExtListen"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "setListenChannel"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "setDisallowedFrequencies"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_STRUCT
+                predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::FreqRange"
+            }
+        }
+    }
+
+    api: {
+        name: "getSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getGroupCapability"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::P2pGroupCapabilityMask"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "addBonjourService"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "removeBonjourService"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "addUpnpService"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "removeUpnpService"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "flushServices"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "requestServiceDiscovery"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "cancelServiceDiscovery"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "setMiracastMode"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface::MiracastMode"
+        }
+    }
+
+    api: {
+        name: "startWpsPbc"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "startWpsPinKeypad"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "startWpsPinDisplay"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "cancelWps"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "enableWfd"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setWfdDeviceInfo"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 8
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantP2pIfaceCallback.vts b/wifi/supplicant/1.0/vts/SupplicantP2pIfaceCallback.vts
new file mode 100644
index 0000000..09fd779
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantP2pIfaceCallback.vts
@@ -0,0 +1,520 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantP2pIfaceCallback"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::WpsDevPasswordId"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint16_t"
+
+            enumerator: "DEFAULT"
+            scalar_value: {
+                uint16_t: 0
+            }
+            enumerator: "USER_SPECIFIED"
+            scalar_value: {
+                uint16_t: 1
+            }
+            enumerator: "MACHINE_SPECIFIED"
+            scalar_value: {
+                uint16_t: 2
+            }
+            enumerator: "REKEY"
+            scalar_value: {
+                uint16_t: 3
+            }
+            enumerator: "PUSHBUTTON"
+            scalar_value: {
+                uint16_t: 4
+            }
+            enumerator: "REGISTRAR_SPECIFIED"
+            scalar_value: {
+                uint16_t: 5
+            }
+            enumerator: "NFC_CONNECTION_HANDOVER"
+            scalar_value: {
+                uint16_t: 7
+            }
+            enumerator: "P2PS_DEFAULT"
+            scalar_value: {
+                uint16_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::P2pStatusCode"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "SUCCESS"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "FAIL_INFO_CURRENTLY_UNAVAILABLE"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "FAIL_INCOMPATIBLE_PARAMS"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "FAIL_LIMIT_REACHED"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "FAIL_INVALID_PARAMS"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "FAIL_UNABLE_TO_ACCOMMODATE"
+            scalar_value: {
+                uint32_t: 5
+            }
+            enumerator: "FAIL_PREV_PROTOCOL_ERROR"
+            scalar_value: {
+                uint32_t: 6
+            }
+            enumerator: "FAIL_NO_COMMON_CHANNELS"
+            scalar_value: {
+                uint32_t: 7
+            }
+            enumerator: "FAIL_UNKNOWN_GROUP"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "FAIL_BOTH_GO_INTENT_15"
+            scalar_value: {
+                uint32_t: 9
+            }
+            enumerator: "FAIL_INCOMPATIBLE_PROV_METHOD"
+            scalar_value: {
+                uint32_t: 10
+            }
+            enumerator: "FAIL_REJECTED_BY_USER"
+            scalar_value: {
+                uint32_t: 11
+            }
+            enumerator: "SUCCESS_DEFERRED"
+            scalar_value: {
+                uint32_t: 12
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::P2pProvDiscStatusCode"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint8_t"
+
+            enumerator: "SUCCESS"
+            scalar_value: {
+                uint8_t: 0
+            }
+            enumerator: "TIMEOUT"
+            scalar_value: {
+                uint8_t: 1
+            }
+            enumerator: "REJECTED"
+            scalar_value: {
+                uint8_t: 2
+            }
+            enumerator: "TIMEOUT_JOIN"
+            scalar_value: {
+                uint8_t: 3
+            }
+            enumerator: "INFO_UNAVAILABLE"
+            scalar_value: {
+                uint8_t: 4
+            }
+        }
+    }
+
+    api: {
+        name: "onNetworkAdded"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onNetworkRemoved"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onDeviceFound"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 8
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::P2pGroupCapabilityMask"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 8
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onDeviceLost"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onFindStopped"
+    }
+
+    api: {
+        name: "onGoNegotiationRequest"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::WpsDevPasswordId"
+        }
+    }
+
+    api: {
+        name: "onGoNegotiationCompleted"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::P2pStatusCode"
+        }
+    }
+
+    api: {
+        name: "onGroupFormationSuccess"
+    }
+
+    api: {
+        name: "onGroupFormationFailure"
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onGroupStarted"
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 32
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "onGroupRemoved"
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "onInvitationReceived"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onInvitationResult"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::P2pStatusCode"
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryPbcRequest"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryPbcResponse"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryShowPin"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryEnterPin"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryFailure"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onProvisionDiscoveryCompleted"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback::P2pProvDiscStatusCode"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onServiceDiscoveryResponse"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint16_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onStaAuthorized"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onStaDeauthorized"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantP2pNetwork.vts b/wifi/supplicant/1.0/vts/SupplicantP2pNetwork.vts
new file mode 100644
index 0000000..fddcca3
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantP2pNetwork.vts
@@ -0,0 +1,127 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantP2pNetwork"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantNetwork"
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantP2pNetworkCallback"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    api: {
+        name: "getId"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getInterfaceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "registerCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISupplicantP2pNetworkCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "getSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getBssid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "isCurrent"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "isPersistent"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "isGo"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantP2pNetworkCallback.vts b/wifi/supplicant/1.0/vts/SupplicantP2pNetworkCallback.vts
new file mode 100644
index 0000000..0e9ccde
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantP2pNetworkCallback.vts
@@ -0,0 +1,9 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantP2pNetworkCallback"
+
+package: "android.hardware.wifi.supplicant"
+
+
+interface: {
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantStaIface.vts b/wifi/supplicant/1.0/vts/SupplicantStaIface.vts
new file mode 100644
index 0000000..ceadb6c
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantStaIface.vts
@@ -0,0 +1,623 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantStaIface"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantIface"
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantStaIfaceCallback"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantIface::ParamSizeLimits"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WPS_DEVICE_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MANUFACTURER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "WPS_MODEL_NAME_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_MODEL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "WPS_SERIAL_NUMBER_MAX_LEN"
+            scalar_value: {
+                uint32_t: 32
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::AnqpInfoId"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint16_t"
+
+            enumerator: "VENUE_NAME"
+            scalar_value: {
+                uint16_t: 258
+            }
+            enumerator: "ROAMING_CONSORTIUM"
+            scalar_value: {
+                uint16_t: 261
+            }
+            enumerator: "IP_ADDR_TYPE_AVAILABILITY"
+            scalar_value: {
+                uint16_t: 262
+            }
+            enumerator: "NAI_REALM"
+            scalar_value: {
+                uint16_t: 263
+            }
+            enumerator: "ANQP_3GPP_CELLULAR_NETWORK"
+            scalar_value: {
+                uint16_t: 264
+            }
+            enumerator: "DOMAIN_NAME"
+            scalar_value: {
+                uint16_t: 268
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::Hs20AnqpSubtypes"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "OPERATOR_FRIENDLY_NAME"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "WAN_METRICS"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "CONNECTION_CAPABILITY"
+            scalar_value: {
+                uint32_t: 5
+            }
+            enumerator: "OSU_PROVIDERS_LIST"
+            scalar_value: {
+                uint32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::RxFilterType"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint8_t"
+
+            enumerator: "V4_MULTICAST"
+            scalar_value: {
+                uint8_t: 0
+            }
+            enumerator: "V6_MULTICAST"
+            scalar_value: {
+                uint8_t: 1
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::BtCoexistenceMode"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint8_t"
+
+            enumerator: "ENABLED"
+            scalar_value: {
+                uint8_t: 0
+            }
+            enumerator: "DISABLED"
+            scalar_value: {
+                uint8_t: 1
+            }
+            enumerator: "SENSE"
+            scalar_value: {
+                uint8_t: 2
+            }
+        }
+    }
+
+    api: {
+        name: "getName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "addNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+    }
+
+    api: {
+        name: "removeNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getNetwork"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_HIDL_INTERFACE
+            predefined_type: "ISupplicantNetwork"
+            is_callback: false
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "listNetworks"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint32_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setWpsDeviceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsManufacturer"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsModelNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsSerialNumber"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWpsConfigMethods"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+        }
+    }
+
+    api: {
+        name: "registerCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISupplicantStaIfaceCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "reassociate"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "reconnect"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "disconnect"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "setPowerSave"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "initiateTdlsDiscover"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "initiateTdlsSetup"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "initiateTdlsTeardown"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "initiateAnqpQuery"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ENUM
+                predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::AnqpInfoId"
+            }
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ENUM
+                predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::Hs20AnqpSubtypes"
+            }
+        }
+    }
+
+    api: {
+        name: "initiateHs20IconQuery"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getMacAddress"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "startRxFilter"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "stopRxFilter"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "addRxFilter"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::RxFilterType"
+        }
+    }
+
+    api: {
+        name: "removeRxFilter"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::RxFilterType"
+        }
+    }
+
+    api: {
+        name: "setBtCoexistenceMode"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface::BtCoexistenceMode"
+        }
+    }
+
+    api: {
+        name: "setBtCoexistenceScanModeEnabled"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setSuspendModeEnabled"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setCountryCode"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 2
+                type: TYPE_SCALAR
+                scalar_type: "int8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "startWpsRegistrar"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "startWpsPbc"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "startWpsPinKeypad"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "startWpsPinDisplay"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "cancelWps"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "setExternalSim"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantStaIfaceCallback.vts b/wifi/supplicant/1.0/vts/SupplicantStaIfaceCallback.vts
new file mode 100644
index 0000000..88b1c3b
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantStaIfaceCallback.vts
@@ -0,0 +1,499 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantStaIfaceCallback"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::State"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "DISCONNECTED"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "IFACE_DISABLED"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "INACTIVE"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "SCANNING"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "AUTHENTICATING"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "ASSOCIATING"
+            scalar_value: {
+                uint32_t: 5
+            }
+            enumerator: "ASSOCIATED"
+            scalar_value: {
+                uint32_t: 6
+            }
+            enumerator: "FOURWAY_HANDSHAKE"
+            scalar_value: {
+                uint32_t: 7
+            }
+            enumerator: "GROUP_HANDSHAKE"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "COMPLETED"
+            scalar_value: {
+                uint32_t: 9
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::OsuMethod"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint8_t"
+
+            enumerator: "OMA_DM"
+            scalar_value: {
+                uint8_t: 0
+            }
+            enumerator: "SOAP_XML_SPP"
+            scalar_value: {
+                uint8_t: 1
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::AnqpData"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "venueName"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "roamingConsortium"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "ipAddrTypeAvailability"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "naiRealm"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "anqp3gppCellularNetwork"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "domainName"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::Hs20AnqpData"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "operatorFriendlyName"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "wanMetrics"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "connectionCapability"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "osuProvidersList"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::WpsConfigError"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint16_t"
+
+            enumerator: "NO_ERROR"
+            scalar_value: {
+                uint16_t: 0
+            }
+            enumerator: "OOB_IFACE_READ_ERROR"
+            scalar_value: {
+                uint16_t: 1
+            }
+            enumerator: "DECRYPTION_CRC_FAILURE"
+            scalar_value: {
+                uint16_t: 2
+            }
+            enumerator: "CHAN_24_NOT_SUPPORTED"
+            scalar_value: {
+                uint16_t: 3
+            }
+            enumerator: "CHAN_50_NOT_SUPPORTED"
+            scalar_value: {
+                uint16_t: 4
+            }
+            enumerator: "SIGNAL_TOO_WEAK"
+            scalar_value: {
+                uint16_t: 5
+            }
+            enumerator: "NETWORK_AUTH_FAILURE"
+            scalar_value: {
+                uint16_t: 6
+            }
+            enumerator: "NETWORK_ASSOC_FAILURE"
+            scalar_value: {
+                uint16_t: 7
+            }
+            enumerator: "NO_DHCP_RESPONSE"
+            scalar_value: {
+                uint16_t: 8
+            }
+            enumerator: "FAILED_DHCP_CONFIG"
+            scalar_value: {
+                uint16_t: 9
+            }
+            enumerator: "IP_ADDR_CONFLICT"
+            scalar_value: {
+                uint16_t: 10
+            }
+            enumerator: "NO_CONN_TO_REGISTRAR"
+            scalar_value: {
+                uint16_t: 11
+            }
+            enumerator: "MULTIPLE_PBC_DETECTED"
+            scalar_value: {
+                uint16_t: 12
+            }
+            enumerator: "ROGUE_SUSPECTED"
+            scalar_value: {
+                uint16_t: 13
+            }
+            enumerator: "DEVICE_BUSY"
+            scalar_value: {
+                uint16_t: 14
+            }
+            enumerator: "SETUP_LOCKED"
+            scalar_value: {
+                uint16_t: 15
+            }
+            enumerator: "MSG_TIMEOUT"
+            scalar_value: {
+                uint16_t: 16
+            }
+            enumerator: "REG_SESS_TIMEOUT"
+            scalar_value: {
+                uint16_t: 17
+            }
+            enumerator: "DEV_PASSWORD_AUTH_FAILURE"
+            scalar_value: {
+                uint16_t: 18
+            }
+            enumerator: "CHAN_60G_NOT_SUPPORTED"
+            scalar_value: {
+                uint16_t: 19
+            }
+            enumerator: "PUBLIC_KEY_HASH_MISMATCH"
+            scalar_value: {
+                uint16_t: 20
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::WpsErrorIndication"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint16_t"
+
+            enumerator: "NO_ERROR"
+            scalar_value: {
+                uint16_t: 0
+            }
+            enumerator: "SECURITY_TKIP_ONLY_PROHIBITED"
+            scalar_value: {
+                uint16_t: 1
+            }
+            enumerator: "SECURITY_WEP_PROHIBITED"
+            scalar_value: {
+                uint16_t: 2
+            }
+            enumerator: "AUTH_FAILURE"
+            scalar_value: {
+                uint16_t: 3
+            }
+        }
+    }
+
+    api: {
+        name: "onNetworkAdded"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onNetworkRemoved"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onStateChanged"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::State"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onAnqpQueryDone"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::AnqpData"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::Hs20AnqpData"
+        }
+    }
+
+    api: {
+        name: "onHs20IconQueryDone"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onHs20SubscriptionRemediation"
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::OsuMethod"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onHs20DeauthImminentNotice"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "onConnected"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onDisconnected"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onAssociationCompleted"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onAssociationRejected"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onAuthenticationTimeout"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onEapFailure"
+    }
+
+    api: {
+        name: "onWpsEventSuccess"
+    }
+
+    api: {
+        name: "onWpsEventFail"
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::WpsConfigError"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback::WpsErrorIndication"
+        }
+    }
+
+    api: {
+        name: "onWpsEventPbcOverlap"
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantStaNetwork.vts b/wifi/supplicant/1.0/vts/SupplicantStaNetwork.vts
new file mode 100644
index 0000000..f493b3e
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantStaNetwork.vts
@@ -0,0 +1,1087 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantStaNetwork"
+
+package: "android.hardware.wifi.supplicant"
+
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantNetwork"
+import: "android.hardware.wifi.supplicant@1.0::ISupplicantStaNetworkCallback"
+import: "android.hardware.wifi.supplicant@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::ParamSizeLimits"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "SSID_MAX_LEN_IN_BYTES"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "PSK_PASSPHRASE_MIN_LEN_IN_BYTES"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "PSK_PASSPHRASE_MAX_LEN_IN_BYTES"
+            scalar_value: {
+                uint32_t: 63
+            }
+            enumerator: "WEP_KEYS_MAX_NUM"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "WEP40_KEY_LEN_IN_BYTES"
+            scalar_value: {
+                uint32_t: 5
+            }
+            enumerator: "WEP104_KEY_LEN_IN_BYTES"
+            scalar_value: {
+                uint32_t: 13
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::KeyMgmtMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WPA_EAP"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "WPA_PSK"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "NONE"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "IEEE8021X"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "FT_EAP"
+            scalar_value: {
+                uint32_t: 32
+            }
+            enumerator: "FT_PSK"
+            scalar_value: {
+                uint32_t: 64
+            }
+            enumerator: "OSEN"
+            scalar_value: {
+                uint32_t: 32768
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::ProtoMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WPA"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "RSN"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "OSEN"
+            scalar_value: {
+                uint32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::AuthAlgMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "OPEN"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "SHARED"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "LEAP"
+            scalar_value: {
+                uint32_t: 4
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::GroupCipherMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "WEP40"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "WEP104"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "TKIP"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "CCMP"
+            scalar_value: {
+                uint32_t: 16
+            }
+            enumerator: "GTK_NOT_USED"
+            scalar_value: {
+                uint32_t: 16384
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::PairwiseCipherMask"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "NONE"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "TKIP"
+            scalar_value: {
+                uint32_t: 8
+            }
+            enumerator: "CCMP"
+            scalar_value: {
+                uint32_t: 16
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapMethod"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "PEAP"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "TLS"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "TTLS"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "PWD"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "SIM"
+            scalar_value: {
+                uint32_t: 4
+            }
+            enumerator: "AKA"
+            scalar_value: {
+                uint32_t: 5
+            }
+            enumerator: "AKA_PRIME"
+            scalar_value: {
+                uint32_t: 6
+            }
+            enumerator: "WFA_UNAUTH_TLS"
+            scalar_value: {
+                uint32_t: 7
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapPhase2Method"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "uint32_t"
+
+            enumerator: "NONE"
+            scalar_value: {
+                uint32_t: 0
+            }
+            enumerator: "PAP"
+            scalar_value: {
+                uint32_t: 1
+            }
+            enumerator: "MSPAP"
+            scalar_value: {
+                uint32_t: 2
+            }
+            enumerator: "MSPAPV2"
+            scalar_value: {
+                uint32_t: 3
+            }
+            enumerator: "GTC"
+            scalar_value: {
+                uint32_t: 4
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::NetworkResponseEapSimGsmAuthParams"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "kc"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 8
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "sres"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 4
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::NetworkResponseEapSimUmtsAuthParams"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "res"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "ik"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 16
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "ck"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 16
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getId"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getInterfaceName"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getType"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+        }
+    }
+
+    api: {
+        name: "registerCallback"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "ISupplicantStaNetworkCallback"
+            is_callback: true
+        }
+    }
+
+    api: {
+        name: "setSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setBssid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setScanSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setKeyMgmt"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::KeyMgmtMask"
+        }
+    }
+
+    api: {
+        name: "setProto"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::ProtoMask"
+        }
+    }
+
+    api: {
+        name: "setAuthAlg"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::AuthAlgMask"
+        }
+    }
+
+    api: {
+        name: "setGroupCipher"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::GroupCipherMask"
+        }
+    }
+
+    api: {
+        name: "setPairwiseCipher"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::PairwiseCipherMask"
+        }
+    }
+
+    api: {
+        name: "setPskPassphrase"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setWepKey"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setWepTxKeyIdx"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "setRequirePmf"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setEapMethod"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapMethod"
+        }
+    }
+
+    api: {
+        name: "setEapPhase2Method"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapPhase2Method"
+        }
+    }
+
+    api: {
+        name: "setEapIdentity"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setEapAnonymousIdentity"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setEapPassword"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "setEapCACert"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapCAPath"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapClientCert"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapPrivateKey"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapSubjectMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapAltSubjectMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapEngine"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "setEapEngineID"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setEapDomainSuffixMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "setIdStr"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getBssid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 6
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getScanSsid"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getKeyMgmt"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::KeyMgmtMask"
+        }
+    }
+
+    api: {
+        name: "getProto"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::ProtoMask"
+        }
+    }
+
+    api: {
+        name: "getAuthAlg"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::AuthAlgMask"
+        }
+    }
+
+    api: {
+        name: "getGroupCipher"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::GroupCipherMask"
+        }
+    }
+
+    api: {
+        name: "getPairwiseCipher"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_MASK
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::PairwiseCipherMask"
+        }
+    }
+
+    api: {
+        name: "getPskPassphrase"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getWepKey"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getWepTxKeyIdx"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "getRequirePmf"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getEapMethod"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapMethod"
+        }
+    }
+
+    api: {
+        name: "getEapPhase2Method"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::EapPhase2Method"
+        }
+    }
+
+    api: {
+        name: "getEapIdentity"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getEapAnonymousIdentity"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getEapPassword"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "getEapCACert"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapCAPath"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapClientCert"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapPrivateKey"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapSubjectMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapAltSubjectMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapEngine"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "getEapEngineID"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getEapDomainSuffixMatch"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "getIdStr"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        return_type_hidl: {
+            type: TYPE_STRING
+        }
+    }
+
+    api: {
+        name: "enable"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "bool_t"
+        }
+    }
+
+    api: {
+        name: "disable"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "select"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+    }
+
+    api: {
+        name: "sendNetworkEapSimGsmAuthResponse"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::NetworkResponseEapSimGsmAuthParams"
+        }
+    }
+
+    api: {
+        name: "sendNetworkEapSimUmtsAuthResponse"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork::NetworkResponseEapSimUmtsAuthParams"
+        }
+    }
+
+    api: {
+        name: "sendNetworkEapIdentityResponse"
+        return_type_hidl: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/SupplicantStaNetworkCallback.vts b/wifi/supplicant/1.0/vts/SupplicantStaNetworkCallback.vts
new file mode 100644
index 0000000..3fe2da7
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/SupplicantStaNetworkCallback.vts
@@ -0,0 +1,69 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "ISupplicantStaNetworkCallback"
+
+package: "android.hardware.wifi.supplicant"
+
+
+interface: {
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetworkCallback::NetworkRequestEapSimGsmAuthParams"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "rands"
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_ARRAY
+                vector_value: {
+                    vector_size: 16
+                    type: TYPE_SCALAR
+                    scalar_type: "uint8_t"
+                }
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetworkCallback::NetworkRequestEapSimUmtsAuthParams"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "rand"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 16
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        struct_value: {
+            name: "autn"
+            type: TYPE_ARRAY
+            vector_value: {
+                vector_size: 16
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onNetworkEapSimGsmAuthRequest"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetworkCallback::NetworkRequestEapSimGsmAuthParams"
+        }
+    }
+
+    api: {
+        name: "onNetworkEapSimUmtsAuthRequest"
+        arg: {
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetworkCallback::NetworkRequestEapSimUmtsAuthParams"
+        }
+    }
+
+    api: {
+        name: "onNetworkEapIdentityRequest"
+    }
+
+}
diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk
new file mode 100644
index 0000000..8fa649f
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/Android.mk
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := supplicant_hidl_test
+LOCAL_CPPFLAGS := -Wall -Werror -Wextra
+LOCAL_SRC_FILES := \
+    main.cpp \
+    supplicant_hidl_test.cpp \
+    supplicant_hidl_test_utils.cpp \
+    supplicant_p2p_iface_hidl_test.cpp \
+    supplicant_sta_iface_hidl_test.cpp \
+    supplicant_sta_network_hidl_test.cpp
+LOCAL_SHARED_LIBRARIES := \
+    android.hardware.wifi.supplicant@1.0 \
+    libbase \
+    libcutils \
+    libhidlbase \
+    libhidltransport \
+    libhwbinder \
+    liblog \
+    libutils \
+    libwifi-hal \
+    libwifi-system
+LOCAL_STATIC_LIBRARIES := \
+    libgmock \
+    libgtest
+include $(BUILD_NATIVE_TEST)
+
diff --git a/wifi/supplicant/1.0/vts/functional/main.cpp b/wifi/supplicant/1.0/vts/functional/main.cpp
new file mode 100644
index 0000000..81a2947
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/main.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+class SupplicantHidlEnvironment : public ::testing::Environment {
+   public:
+    virtual void SetUp() override {
+        stopWifiFramework();
+        stopSupplicant();
+    }
+    virtual void TearDown() override {
+        startWifiFramework();
+        // Framework will start wpa_supplicant.
+    }
+};
+
+int main(int argc, char** argv) {
+    ::testing::AddGlobalTestEnvironment(new SupplicantHidlEnvironment);
+    ::testing::InitGoogleTest(&argc, argv);
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+    return status;
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
new file mode 100644
index 0000000..9922447
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicant proxy object is
+ * successfully created.
+ */
+TEST(SupplicantHidlTestNoFixture, Create) {
+    startSupplicantAndWaitForHidlService();
+    EXPECT_NE(nullptr, getSupplicant().get());
+    stopSupplicant();
+}
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
new file mode 100644
index 0000000..3877b97
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+#include <gtest/gtest.h>
+
+#include <hidl/HidlTransportSupport.h>
+#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <android/hidl/manager/1.0/IServiceNotification.h>
+
+#include <wifi_hal/driver_tool.h>
+#include <wifi_system/interface_tool.h>
+#include <wifi_system/supplicant_manager.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+using ::android::sp;
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::joinRpcThreadpool;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicant;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hidl::manager::V1_0::IServiceNotification;
+using ::android::wifi_hal::DriverTool;
+using ::android::wifi_system::InterfaceTool;
+using ::android::wifi_system::SupplicantManager;
+
+namespace {
+const char kSupplicantServiceName[] = "wpa_supplicant";
+
+// Helper function to initialize the driver and firmware to STA mode.
+void initilializeDriverAndFirmware() {
+    DriverTool driver_tool;
+    InterfaceTool iface_tool;
+    EXPECT_TRUE(driver_tool.LoadDriver());
+    EXPECT_TRUE(driver_tool.ChangeFirmwareMode(DriverTool::kFirmwareModeSta));
+    EXPECT_TRUE(iface_tool.SetWifiUpState(true));
+}
+
+// Helper function to find any iface of the desired type exposed.
+bool findIfaceOfType(sp<ISupplicant> supplicant, IfaceType desired_type,
+                     ISupplicant::IfaceInfo* out_info) {
+    bool operation_failed = false;
+    std::vector<ISupplicant::IfaceInfo> iface_infos;
+    supplicant->listInterfaces([&](const SupplicantStatus& status,
+                                   hidl_vec<ISupplicant::IfaceInfo> infos) {
+        if (status.code != SupplicantStatusCode::SUCCESS) {
+            operation_failed = true;
+            return;
+        }
+        iface_infos = infos;
+    });
+    if (operation_failed) {
+        return false;
+    }
+    for (const auto& info : iface_infos) {
+        if (info.type == desired_type) {
+            *out_info = info;
+            return true;
+        }
+    }
+    return false;
+}
+}  // namespace
+
+// Utility class to wait for wpa_supplicant's HIDL service registration.
+class ServiceNotificationListener : public IServiceNotification {
+   public:
+    Return<void> onRegistration(const hidl_string& fully_qualified_name,
+                                const hidl_string& instance_name,
+                                bool pre_existing) override {
+        if (pre_existing) {
+            return Void();
+        }
+        std::unique_lock<std::mutex> lock(mutex_);
+        registered_.push_back(std::string(fully_qualified_name.c_str()) + "/" +
+                              instance_name.c_str());
+        lock.unlock();
+        condition_.notify_one();
+        return Void();
+    }
+
+    bool registerForHidlServiceNotifications(const std::string& instance_name) {
+        if (!ISupplicant::registerForNotifications(instance_name, this)) {
+            return false;
+        }
+        configureRpcThreadpool(2, false);
+        return true;
+    }
+
+    bool waitForHidlService(uint32_t timeout_in_millis,
+                            const std::string& instance_name) {
+        std::unique_lock<std::mutex> lock(mutex_);
+        condition_.wait_for(lock, std::chrono::milliseconds(timeout_in_millis),
+                            [&]() { return registered_.size() >= 1; });
+        if (registered_.size() != 1) {
+            return false;
+        }
+        std::string exptected_registered =
+            std::string(ISupplicant::descriptor) + "/" + instance_name;
+        if (registered_[0] != exptected_registered) {
+            LOG(ERROR) << "Expected: " << exptected_registered
+                       << ", Got: " << registered_[0];
+            return false;
+        }
+        return true;
+    }
+
+   private:
+    std::vector<std::string> registered_{};
+    std::mutex mutex_;
+    std::condition_variable condition_;
+};
+
+void stopWifiFramework() {
+    ASSERT_EQ(std::system("svc wifi disable"), 0);
+    // TODO: Use some other mechanism to wait for the framework to
+    // finish disabling.
+    sleep(5);
+}
+
+void startWifiFramework() {
+    ASSERT_EQ(std::system("svc wifi enable"), 0);
+    // These tests don't care whether the framework
+    // finished enabling or not.
+}
+
+void stopSupplicant() {
+    DriverTool driver_tool;
+    SupplicantManager supplicant_manager;
+
+    ASSERT_TRUE(supplicant_manager.StopSupplicant());
+    ASSERT_TRUE(driver_tool.UnloadDriver());
+    ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
+}
+
+void startSupplicantAndWaitForHidlService() {
+    initilializeDriverAndFirmware();
+
+    android::sp<ServiceNotificationListener> notification_listener =
+        new ServiceNotificationListener();
+    ASSERT_TRUE(notification_listener->registerForHidlServiceNotifications(
+        kSupplicantServiceName));
+
+    SupplicantManager supplicant_manager;
+    ASSERT_TRUE(supplicant_manager.StartSupplicant());
+    ASSERT_TRUE(supplicant_manager.IsSupplicantRunning());
+
+    ASSERT_TRUE(
+        notification_listener->waitForHidlService(200, kSupplicantServiceName));
+}
+
+sp<ISupplicant> getSupplicant() {
+    return ISupplicant::getService(kSupplicantServiceName);
+}
+
+sp<ISupplicantStaIface> getSupplicantStaIface() {
+    sp<ISupplicant> supplicant = getSupplicant();
+    if (!supplicant.get()) {
+        return nullptr;
+    }
+    ISupplicant::IfaceInfo info;
+    if (!findIfaceOfType(supplicant, IfaceType::STA, &info)) {
+        return nullptr;
+    }
+    bool operation_failed = false;
+    sp<ISupplicantStaIface> sta_iface;
+    supplicant->getInterface(info, [&](const SupplicantStatus& status,
+                                       const sp<ISupplicantIface>& iface) {
+        if (status.code != SupplicantStatusCode::SUCCESS) {
+            operation_failed = true;
+            return;
+        }
+        sta_iface = ISupplicantStaIface::castFrom(iface);
+    });
+    if (operation_failed) {
+        return nullptr;
+    }
+    return sta_iface;
+}
+
+sp<ISupplicantStaNetwork> createSupplicantStaNetwork() {
+    sp<ISupplicantStaIface> sta_iface = getSupplicantStaIface();
+    if (!sta_iface.get()) {
+        return nullptr;
+    }
+    bool operation_failed = false;
+    sp<ISupplicantStaNetwork> sta_network;
+    sta_iface->addNetwork([&](const SupplicantStatus& status,
+                              const sp<ISupplicantNetwork>& network) {
+        if (status.code != SupplicantStatusCode::SUCCESS) {
+            operation_failed = true;
+            return;
+        }
+        sta_network = ISupplicantStaNetwork::castFrom(network);
+    });
+    if (operation_failed) {
+        return nullptr;
+    }
+    return sta_network;
+}
+
+sp<ISupplicantP2pIface> getSupplicantP2pIface() {
+    sp<ISupplicant> supplicant = getSupplicant();
+    if (!supplicant.get()) {
+        return nullptr;
+    }
+    ISupplicant::IfaceInfo info;
+    if (!findIfaceOfType(supplicant, IfaceType::P2P, &info)) {
+        return nullptr;
+    }
+    bool operation_failed = false;
+    sp<ISupplicantP2pIface> p2p_iface;
+    supplicant->getInterface(info, [&](const SupplicantStatus& status,
+                                       const sp<ISupplicantIface>& iface) {
+        if (status.code != SupplicantStatusCode::SUCCESS) {
+            operation_failed = true;
+            return;
+        }
+        p2p_iface = ISupplicantP2pIface::castFrom(iface);
+    });
+    if (operation_failed) {
+        return nullptr;
+    }
+    return p2p_iface;
+}
+
+bool turnOnExcessiveLogging() {
+    sp<ISupplicant> supplicant = getSupplicant();
+    if (!supplicant.get()) {
+        return false;
+    }
+    bool operation_failed = false;
+    supplicant->setDebugParams(
+        ISupplicant::DebugLevel::EXCESSIVE,
+        true,  // show timestamps
+        true,  // show keys
+        [&](const SupplicantStatus& status) {
+            if (status.code != SupplicantStatusCode::SUCCESS) {
+                operation_failed = true;
+            }
+        });
+    return !operation_failed;
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
new file mode 100644
index 0000000..38143e4
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SUPPLICANT_HIDL_TEST_UTILS_H
+#define SUPPLICANT_HIDL_TEST_UTILS_H
+
+#include <android/hardware/wifi/supplicant/1.0/ISupplicant.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
+
+// Used to stop the android wifi framework before every test.
+void stopWifiFramework();
+void startWifiFramework();
+void stopSupplicant();
+// Used to configure the chip, driver and start wpa_supplicant before every
+// test.
+void startSupplicantAndWaitForHidlService();
+
+// Helper functions to obtain references to the various HIDL interface objects.
+// Note: We only have a single instance of each of these objects currently.
+// These helper functions should be modified to return vectors if we support
+// multiple instances.
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicant>
+getSupplicant();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface>
+getSupplicantStaIface();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork>
+createSupplicantStaNetwork();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface>
+getSupplicantP2pIface();
+
+bool turnOnExcessiveLogging();
+
+#endif /* SUPPLICANT_HIDL_TEST_UTILS_H */
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
new file mode 100644
index 0000000..968d4c9
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantP2pIface proxy object is
+ * successfully created.
+ */
+TEST(SupplicantP2pIfaceHidlTestNoFixture, Create) {
+    startSupplicantAndWaitForHidlService();
+    EXPECT_NE(nullptr, getSupplicantP2pIface().get());
+    stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
new file mode 100644
index 0000000..45cc6bc
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantStaIface proxy object is
+ * successfully created.
+ */
+TEST(SupplicantStaIfaceHidlTestNoFixture, Create) {
+    startSupplicantAndWaitForHidlService();
+    EXPECT_NE(nullptr, getSupplicantStaIface().get());
+    stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
new file mode 100644
index 0000000..8c42a22
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantStaNetwork proxy object is
+ * successfully created.
+ */
+TEST(SupplicantStaNetworkHidlTestNoFixture, Create) {
+    startSupplicantAndWaitForHidlService();
+    EXPECT_NE(nullptr, createSupplicantStaNetwork().get());
+    stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/types.vts b/wifi/supplicant/1.0/vts/types.vts
new file mode 100644
index 0000000..b8b29b3
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/types.vts
@@ -0,0 +1,189 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.wifi.supplicant"
+
+
+attribute: {
+    name: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "SUCCESS"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "FAILURE_UNKNOWN"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "FAILURE_ARGS_INVALID"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "FAILURE_IFACE_INVALID"
+        scalar_value: {
+            uint32_t: 3
+        }
+        enumerator: "FAILURE_IFACE_UNKNOWN"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "FAILURE_IFACE_EXISTS"
+        scalar_value: {
+            uint32_t: 5
+        }
+        enumerator: "FAILURE_IFACE_DISABLED"
+        scalar_value: {
+            uint32_t: 6
+        }
+        enumerator: "FAILURE_IFACE_NOT_DISCONNECTED"
+        scalar_value: {
+            uint32_t: 7
+        }
+        enumerator: "FAILURE_NETWORK_INVALID"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "FAILURE_NETWORK_UNKNOWN"
+        scalar_value: {
+            uint32_t: 9
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatus"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "code"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode"
+    }
+    struct_value: {
+        name: "debugMessage"
+        type: TYPE_STRING
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::supplicant::V1_0::IfaceType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "STA"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "P2P"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::supplicant::V1_0::P2pGroupCapabilityMask"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "GROUP_OWNER"
+        scalar_value: {
+            uint32_t: 1
+        }
+        enumerator: "PERSISTENT_GROUP"
+        scalar_value: {
+            uint32_t: 2
+        }
+        enumerator: "GROUP_LIMIT"
+        scalar_value: {
+            uint32_t: 4
+        }
+        enumerator: "INTRA_BSS_DIST"
+        scalar_value: {
+            uint32_t: 8
+        }
+        enumerator: "CROSS_CONN"
+        scalar_value: {
+            uint32_t: 16
+        }
+        enumerator: "PERSISTENT_RECONN"
+        scalar_value: {
+            uint32_t: 32
+        }
+        enumerator: "GROUP_FORMATION"
+        scalar_value: {
+            uint32_t: 64
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::wifi::supplicant::V1_0::WpsConfigMethods"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint16_t"
+
+        enumerator: "USBA"
+        scalar_value: {
+            uint16_t: 1
+        }
+        enumerator: "ETHERNET"
+        scalar_value: {
+            uint16_t: 2
+        }
+        enumerator: "LABEL"
+        scalar_value: {
+            uint16_t: 4
+        }
+        enumerator: "DISPLAY"
+        scalar_value: {
+            uint16_t: 8
+        }
+        enumerator: "EXT_NFC_TOKEN"
+        scalar_value: {
+            uint16_t: 16
+        }
+        enumerator: "INT_NFC_TOKEN"
+        scalar_value: {
+            uint16_t: 32
+        }
+        enumerator: "NFC_INTERFACE"
+        scalar_value: {
+            uint16_t: 64
+        }
+        enumerator: "PUSHBUTTON"
+        scalar_value: {
+            uint16_t: 128
+        }
+        enumerator: "KEYPAD"
+        scalar_value: {
+            uint16_t: 256
+        }
+        enumerator: "VIRT_PUSHBUTTON"
+        scalar_value: {
+            uint16_t: 640
+        }
+        enumerator: "PHY_PUSHBUTTON"
+        scalar_value: {
+            uint16_t: 1152
+        }
+        enumerator: "P2PS"
+        scalar_value: {
+            uint16_t: 4096
+        }
+        enumerator: "VIRT_DISPLAY"
+        scalar_value: {
+            uint16_t: 8200
+        }
+        enumerator: "PHY_DISPLAY"
+        scalar_value: {
+            uint16_t: 16392
+        }
+    }
+}
+