Merge "Remove viral readproc group dependency."
diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp
index a8229d3..b641e82 100644
--- a/audio/2.0/default/StreamIn.cpp
+++ b/audio/2.0/default/StreamIn.cpp
@@ -103,7 +103,6 @@
     // 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);
         if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL))) {
@@ -321,7 +320,6 @@
                 CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         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));
diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp
index 6ccdbcd..d820f3c 100644
--- a/audio/2.0/default/StreamOut.cpp
+++ b/audio/2.0/default/StreamOut.cpp
@@ -101,7 +101,6 @@
     // 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);
         if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY))) {
@@ -304,7 +303,6 @@
                 CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         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));
diff --git a/audio/common/2.0/types.hal b/audio/common/2.0/types.hal
index bad01fc..dd7281d 100644
--- a/audio/common/2.0/types.hal
+++ b/audio/common/2.0/types.hal
@@ -89,7 +89,6 @@
 enum AudioStreamType : int32_t {
     // These values must kept in sync with
     //  frameworks/base/media/java/android/media/AudioSystem.java
-    // TODO: Synchronization should be done automatically by tools
     DEFAULT          = -1,
     MIN              = 0,
     VOICE_CALL       = 0,
@@ -169,10 +168,8 @@
     OUTPUT_MIX = 0,
     /*
      * Application does not specify an explicit session ID to be used, and
-     * requests a new session ID to be allocated TODO use unique values for
-     * AUDIO_SESSION_OUTPUT_MIX and AUDIO_SESSION_ALLOCATE, after all uses have
-     * been updated from 0 to the appropriate symbol, and have been tested.
-     * Corresponds to AudioManager.AUDIO_SESSION_ID_GENERATE and
+     * requests a new session ID to be allocated. Corresponds to
+     * AudioManager.AUDIO_SESSION_ID_GENERATE and
      * AudioSystem.AUDIO_SESSION_ALLOCATE.
      */
     ALLOCATE = 0,
@@ -698,7 +695,6 @@
 enum AudioUsage : int32_t {
     // These values must kept in sync with
     //  frameworks/base/media/java/android/media/AudioAttributes.java
-    // TODO: Synchronization should be done automatically by tools
     UNKNOWN                            = 0,
     MEDIA                              = 1,
     VOICE_COMMUNICATION                = 2,
diff --git a/audio/effect/2.0/IEffectBufferProviderCallback.hal b/audio/effect/2.0/IEffectBufferProviderCallback.hal
index 545e2e5..53f4d6e 100644
--- a/audio/effect/2.0/IEffectBufferProviderCallback.hal
+++ b/audio/effect/2.0/IEffectBufferProviderCallback.hal
@@ -27,7 +27,6 @@
      *
      * @return buffer audio buffer for processing
      */
-    // TODO(mnaganov): replace with FMQ version.
     getBuffer() generates (AudioBuffer buffer);
 
     /*
@@ -35,6 +34,5 @@
      *
      * @param buffer audio buffer for processing
      */
-    // TODO(mnaganov): replace with FMQ version.
     putBuffer(AudioBuffer buffer);
 };
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
index 6704239..2d36604 100644
--- a/audio/effect/2.0/default/Effect.cpp
+++ b/audio/effect/2.0/default/Effect.cpp
@@ -205,7 +205,7 @@
     halConfig->buffer.raw = NULL;
     halConfig->samplingRate = config.samplingRateHz;
     halConfig->channels = static_cast<uint32_t>(config.channels);
-    // TODO(mnaganov): The framework code currently does not use BP, implement later.
+    // Note: The framework code does not use BP.
     halConfig->bufferProvider.cookie = NULL;
     halConfig->bufferProvider.getBuffer = NULL;
     halConfig->bufferProvider.releaseBuffer = NULL;
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
index e6a3e56..03a65f3 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
@@ -104,7 +104,7 @@
 
         for (auto& prop : mProps) {
             emulator::VehiclePropValue* protoVal = respMsg.add_value();
-            populateProtoVehiclePropValue(protoVal, prop.second.get());
+            populateProtoVehiclePropValue(protoVal, prop.second->get());
         }
     }
 }
@@ -175,7 +175,7 @@
 
     auto prop = mProps.find(std::make_pair(propId, areaId));
     if (prop != mProps.end()) {
-        return prop->second.get();
+        return prop->second->get();
     }
     ALOGW("%s: Property not found:  propId = 0x%x, areaId = 0x%x", __func__, propId, areaId);
     return nullptr;
@@ -530,6 +530,13 @@
     return status;
 }
 
+V2_0::StatusCode DefaultVehicleHal::addCustomProperty(int32_t property,
+    std::unique_ptr<CustomVehiclePropertyHandler>&& handler) {
+    mProps[std::make_pair(property, 0)] = std::move(handler);
+    ALOGW("%s: Added custom property: propId = 0x%x", __func__, property);
+    return StatusCode::OK;
+}
+
 // Parse supported properties list and generate vector of property values to hold current values.
 void DefaultVehicleHal::onCreate() {
     // Initialize member variables
@@ -598,7 +605,11 @@
             prop->areaId = curArea;
             prop->prop = cfg.prop;
             setDefaultValue(prop.get());
-            mProps[std::make_pair(prop->prop, prop->areaId)] = std::move(prop);
+            std::unique_ptr<CustomVehiclePropertyHandler> handler;
+            handler.reset(new StoredValueCustomVehiclePropertyHandler());
+            handler->set(*prop);
+            mProps[std::make_pair(prop->prop, prop->areaId)] =
+                    std::move(handler);
         } while (supportedAreas != 0);
     }
 
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h
index bbbe955..c8310b3 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h
@@ -44,7 +44,31 @@
 
 class DefaultVehicleHal : public VehicleHal {
 public:
-    DefaultVehicleHal() : mRecurrentTimer(
+    class CustomVehiclePropertyHandler {
+    public:
+        virtual VehiclePropValue* get() = 0;
+        virtual StatusCode set(const VehiclePropValue& propValue) = 0;
+        virtual ~CustomVehiclePropertyHandler() = default;
+    };
+
+protected:
+    class StoredValueCustomVehiclePropertyHandler :
+        public CustomVehiclePropertyHandler {
+    public:
+        VehiclePropValue* get() override {
+            return mPropValue.get();
+        }
+
+        StatusCode set(const VehiclePropValue& propValue) {
+            *mPropValue = propValue;
+            return StatusCode::OK;
+        }
+private:
+    std::unique_ptr<VehiclePropValue> mPropValue{new VehiclePropValue()};
+};
+
+public:
+  DefaultVehicleHal() : mRecurrentTimer(
             std::bind(&DefaultVehicleHal::onContinuousPropertyTimer, this, std::placeholders::_1)) {
         for (size_t i = 0; i < arraysize(kVehicleProperties); i++) {
             mPropConfigMap[kVehicleProperties[i].prop] = &kVehicleProperties[i];
@@ -77,6 +101,43 @@
 
     StatusCode unsubscribe(int32_t property) override;
 
+    /**
+     * Add custom property information to this HAL instance.
+     *
+     * This is useful for allowing later versions of Vehicle HAL to coalesce
+     * the list of properties they support with a previous version of the HAL.
+     *
+     * @param property The identifier of the new property
+     * @param handler The object that will handle get/set requests
+     * @return OK on success, an error code on failure
+     */
+    virtual StatusCode addCustomProperty(int32_t,
+        std::unique_ptr<CustomVehiclePropertyHandler>&&);
+
+    /**
+     * Add custom property information to this HAL instance.
+     *
+     * This is useful for allowing later versions of Vehicle HAL to coalesce
+     * the list of properties they support with a previous version of the HAL.
+     *
+     * @param initialValue The initial value for the new property. This is not
+     *                     constant data, as later set() operations can change
+     *                     this value at will
+     * @return OK on success, an error code on failure
+     */
+    virtual StatusCode addCustomProperty(
+        const VehiclePropValue& initialValue) {
+        std::unique_ptr<CustomVehiclePropertyHandler> handler;
+        handler.reset(new StoredValueCustomVehiclePropertyHandler());
+        StatusCode setResponse = handler->set(initialValue);
+        if (StatusCode::OK == setResponse) {
+          return addCustomProperty(initialValue.prop,
+                                   std::move(handler));
+        } else {
+          return setResponse;
+        }
+    }
+
 private:
     void doGetConfig(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
     void doGetConfigAll(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
@@ -106,7 +167,7 @@
 private:
     std::map<
         std::pair<int32_t /*VehicleProperty*/, int32_t /*areaId*/>,
-        std::unique_ptr<VehiclePropValue>> mProps;
+        std::unique_ptr<CustomVehiclePropertyHandler>> mProps;
     std::atomic<int> mExit;
     std::unordered_set<int32_t> mHvacPowerProps;
     std::mutex mPropsMutex;
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.cpp b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.cpp
index d4eae7f..b147ce7 100644
--- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.cpp
@@ -120,12 +120,12 @@
     return sensorStore;
 }
 
-void DefaultVehicleHal::initObd2LiveFrame(V2_0::VehiclePropConfig& propConfig) {
+void DefaultVehicleHal::initObd2LiveFrame(V2_0::VehiclePropConfig& propConfig,
+    V2_0::VehiclePropValue* liveObd2Frame) {
     auto sensorStore = fillDefaultObd2Frame(propConfig.configArray[0],
             propConfig.configArray[1]);
-    mLiveObd2Frame = createVehiclePropValue(
-            V2_0::VehiclePropertyType::COMPLEX, 0);
-    sensorStore->fillPropValue(mLiveObd2Frame.get(), "");
+    sensorStore->fillPropValue(liveObd2Frame, "");
+    liveObd2Frame->prop = V2_0::toInt(VehicleProperty::OBD2_LIVE_FRAME);
 }
 
 void DefaultVehicleHal::initObd2FreezeFrame(V2_0::VehiclePropConfig& propConfig) {
@@ -144,14 +144,6 @@
     sensorStore->fillPropValue(mFreezeObd2Frames[2].get(), "P0123");
 }
 
-V2_0::StatusCode DefaultVehicleHal::fillObd2LiveFrame(V2_0::VehiclePropValue* v) {
-    v->prop = V2_0::toInt(VehicleProperty::OBD2_LIVE_FRAME);
-    v->value.int32Values = mLiveObd2Frame->value.int32Values;
-    v->value.floatValues = mLiveObd2Frame->value.floatValues;
-    v->value.bytes = mLiveObd2Frame->value.bytes;
-    return V2_0::StatusCode::OK;
-}
-
 template<typename Iterable>
 typename Iterable::const_iterator findPropValueAtTimestamp(
         const Iterable& frames,
@@ -224,8 +216,11 @@
     std::vector<V2_0::VehiclePropConfig> configs = listProperties();
     for (auto& cfg : configs) {
         switch(cfg.prop) {
-            case V2_0::toInt(V2_1::VehicleProperty::OBD2_LIVE_FRAME):
-                initObd2LiveFrame(cfg);
+            case V2_0::toInt(V2_1::VehicleProperty::OBD2_LIVE_FRAME): {
+                auto liveObd2Frame = createVehiclePropValue(V2_0::VehiclePropertyType::COMPLEX, 0);
+                initObd2LiveFrame(cfg, liveObd2Frame.get());
+                mVehicleHal20->addCustomProperty(*liveObd2Frame);
+            }
                 break;
             case V2_0::toInt(V2_1::VehicleProperty::OBD2_FREEZE_FRAME):
                 initObd2FreezeFrame(cfg);
@@ -245,10 +240,6 @@
     auto& pool = *getValuePool();
 
     switch (propId) {
-    case V2_0::toInt(V2_1::VehicleProperty::OBD2_LIVE_FRAME):
-        v = pool.obtainComplex();
-        *outStatus = fillObd2LiveFrame(v.get());
-        return v;
     case V2_0::toInt(V2_1::VehicleProperty::OBD2_FREEZE_FRAME):
         v = pool.obtainComplex();
         *outStatus = fillObd2FreezeFrame(requestedPropValue, v.get());
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h
index ac65fc6..af21138 100644
--- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h
@@ -39,7 +39,8 @@
 
 class DefaultVehicleHal : public V2_0::VehicleHal {
 public:
-    DefaultVehicleHal(V2_0::VehicleHal* vhal20) : mVehicleHal20(vhal20) {}
+    DefaultVehicleHal(V2_0::impl::DefaultVehicleHal* vhal20) :
+          mVehicleHal20(vhal20) {}
 
     std::vector<V2_0::VehiclePropConfig> listProperties() override {
         std::vector<V2_0::VehiclePropConfig> propConfigs(mVehicleHal20->listProperties());
@@ -70,17 +71,16 @@
     void onCreate() override;
 
 private:
-    void initObd2LiveFrame(V2_0::VehiclePropConfig& propConfig);
+    void initObd2LiveFrame(V2_0::VehiclePropConfig& propConfig,
+        V2_0::VehiclePropValue* liveObd2Frame);
     void initObd2FreezeFrame(V2_0::VehiclePropConfig& propConfig);
-    V2_0::StatusCode fillObd2LiveFrame(V2_0::VehiclePropValue* v);
     V2_0::StatusCode fillObd2FreezeFrame(const V2_0::VehiclePropValue& requestedPropValue,
             V2_0::VehiclePropValue* v);
     V2_0::StatusCode fillObd2DtcInfo(V2_0::VehiclePropValue *v);
     V2_0::StatusCode clearObd2FreezeFrames(const V2_0::VehiclePropValue& propValue);
 
 private:
-    V2_0::VehicleHal* mVehicleHal20;
-    std::unique_ptr<V2_0::VehiclePropValue> mLiveObd2Frame {nullptr};
+    V2_0::impl::DefaultVehicleHal* mVehicleHal20;
     std::vector<std::unique_ptr<V2_0::VehiclePropValue>> mFreezeObd2Frames;
 };
 
diff --git a/bluetooth/1.0/default/bluetooth_hci.cc b/bluetooth/1.0/default/bluetooth_hci.cc
index fec5b81..8eccfc7 100644
--- a/bluetooth/1.0/default/bluetooth_hci.cc
+++ b/bluetooth/1.0/default/bluetooth_hci.cc
@@ -15,9 +15,10 @@
 //
 
 #define LOG_TAG "android.hardware.bluetooth@1.0-impl"
+#include "bluetooth_hci.h"
+
 #include <utils/Log.h>
 
-#include "bluetooth_hci.h"
 #include "vendor_interface.h"
 
 namespace android {
@@ -38,59 +39,77 @@
       uint64_t /*cookie*/,
       const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
     ALOGE("BluetoothDeathRecipient::serviceDied - Bluetooth service died");
+    has_died_ = true;
     mHci->close();
   }
   sp<IBluetoothHci> mHci;
+  bool getHasDied() const { return has_died_; }
+  void setHasDied(bool has_died) { has_died_ = has_died; }
+
+ private:
+  bool has_died_;
 };
 
 BluetoothHci::BluetoothHci()
-    : deathRecipient(new BluetoothDeathRecipient(this)) {}
+    : death_recipient_(new BluetoothDeathRecipient(this)) {}
 
 Return<void> BluetoothHci::initialize(
     const ::android::sp<IBluetoothHciCallbacks>& cb) {
-  ALOGW("BluetoothHci::initialize()");
-  cb->linkToDeath(deathRecipient, 0);
-  event_cb_ = cb;
+  ALOGI("BluetoothHci::initialize()");
+  if (cb == nullptr) {
+    ALOGE("cb == nullptr! -> Unable to call initializationComplete(ERR)");
+    return Void();
+  }
+
+  death_recipient_->setHasDied(false);
+  cb->linkToDeath(death_recipient_, 0);
 
   bool rc = VendorInterface::Initialize(
-      [this](bool status) {
-        auto hidl_status = event_cb_->initializationComplete(
+      [cb](bool status) {
+        auto hidl_status = cb->initializationComplete(
             status ? Status::SUCCESS : Status::INITIALIZATION_ERROR);
         if (!hidl_status.isOk()) {
           ALOGE("VendorInterface -> Unable to call initializationComplete()");
         }
       },
-      [this](const hidl_vec<uint8_t>& packet) {
-        auto hidl_status = event_cb_->hciEventReceived(packet);
+      [cb](const hidl_vec<uint8_t>& packet) {
+        auto hidl_status = cb->hciEventReceived(packet);
         if (!hidl_status.isOk()) {
           ALOGE("VendorInterface -> Unable to call hciEventReceived()");
         }
       },
-      [this](const hidl_vec<uint8_t>& packet) {
-        auto hidl_status = event_cb_->aclDataReceived(packet);
+      [cb](const hidl_vec<uint8_t>& packet) {
+        auto hidl_status = cb->aclDataReceived(packet);
         if (!hidl_status.isOk()) {
           ALOGE("VendorInterface -> Unable to call aclDataReceived()");
         }
       },
-      [this](const hidl_vec<uint8_t>& packet) {
-        auto hidl_status = event_cb_->scoDataReceived(packet);
+      [cb](const hidl_vec<uint8_t>& packet) {
+        auto hidl_status = cb->scoDataReceived(packet);
         if (!hidl_status.isOk()) {
           ALOGE("VendorInterface -> Unable to call scoDataReceived()");
         }
       });
   if (!rc) {
-    auto hidl_status =
-        event_cb_->initializationComplete(Status::INITIALIZATION_ERROR);
+    auto hidl_status = cb->initializationComplete(Status::INITIALIZATION_ERROR);
     if (!hidl_status.isOk()) {
       ALOGE("VendorInterface -> Unable to call initializationComplete(ERR)");
     }
   }
+
+  unlink_cb_ = [cb](sp<BluetoothDeathRecipient>& death_recipient) {
+    if (death_recipient->getHasDied())
+      ALOGI("Skipping unlink call, service died.");
+    else
+      cb->unlinkToDeath(death_recipient);
+  };
+
   return Void();
 }
 
 Return<void> BluetoothHci::close() {
-  ALOGW("BluetoothHci::close()");
-  event_cb_->unlinkToDeath(deathRecipient);
+  ALOGI("BluetoothHci::close()");
+  unlink_cb_(death_recipient_);
   VendorInterface::Shutdown();
   return Void();
 }
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index 4f92231..6912405 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -44,8 +44,8 @@
 
  private:
   void sendDataToController(const uint8_t type, const hidl_vec<uint8_t>& data);
-  ::android::sp<IBluetoothHciCallbacks> event_cb_;
-  ::android::sp<BluetoothDeathRecipient> deathRecipient;
+  ::android::sp<BluetoothDeathRecipient> death_recipient_;
+  std::function<void(sp<BluetoothDeathRecipient>&)> unlink_cb_;
 };
 
 extern "C" IBluetoothHci* HIDL_FETCH_IBluetoothHci(const char* name);
diff --git a/broadcastradio/1.0/default/BroadcastRadio.cpp b/broadcastradio/1.0/default/BroadcastRadio.cpp
index 45ffdb2..72cdc19 100644
--- a/broadcastradio/1.0/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.0/default/BroadcastRadio.cpp
@@ -63,6 +63,7 @@
     if (rc != 0) {
         ALOGE("couldn't load radio module %s.%s (%s)",
               RADIO_HARDWARE_MODULE_ID, classString, strerror(-rc));
+        mStatus = Result::INVALID_ARGUMENTS;
         return;
     }
     rc = radio_hw_device_open(mod, &mHwDevice);
diff --git a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
index 4ec19c7..ebeadb1 100644
--- a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
+++ b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
@@ -48,21 +48,42 @@
 using ::android::hardware::broadcastradio::V1_0::MetaData;
 
 
+#define RETURN_IF_SKIPPED \
+    if (skipped) { \
+        std::cout << "[  SKIPPED ] This device class is not supported. " << std::endl; \
+        return; \
+    }
+
 // The main test class for Broadcast Radio HIDL HAL.
 
-class BroadcastRadioHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+class BroadcastRadioHidlTest : public ::testing::VtsHalHidlTargetTestBase,
+        public ::testing::WithParamInterface<Class> {
  protected:
     virtual void SetUp() override {
+        ASSERT_EQ(nullptr, mRadio.get());
+
+        radioClass = GetParam();
+        skipped = false;
+
         sp<IBroadcastRadioFactory> factory =
               ::testing::VtsHalHidlTargetTestBase::getService<IBroadcastRadioFactory>();
-        if (factory != 0) {
-            factory->connectModule(Class::AM_FM,
-                             [&](Result retval, const ::android::sp<IBroadcastRadio>& result) {
-                if (retval == Result::OK) {
-                  mRadio = result;
-                }
-            });
+        ASSERT_NE(nullptr, factory.get());
+
+        Result connectResult;
+        factory->connectModule(radioClass, [&](Result ret, const sp<IBroadcastRadio>& radio) {
+            connectResult = ret;
+            mRadio = radio;
+            onCallback_l();
+        });
+        EXPECT_EQ(true, waitForCallback(kConnectCallbacktimeoutNs));
+        mCallbackCalled = false;
+
+        if (connectResult == Result::INVALID_ARGUMENTS) {
+            skipped = true;
+            return;
         }
+        ASSERT_EQ(connectResult, Result::OK);
+
         mTunerCallback = new MyCallback(this);
         ASSERT_NE(nullptr, mRadio.get());
         ASSERT_NE(nullptr, mTunerCallback.get());
@@ -175,9 +196,9 @@
     }
 
 
-        BroadcastRadioHidlTest() :
-            mCallbackCalled(false), mBoolCallbackData(false),
-            mResultCallbackData(Result::OK), mHwFailure(false) {}
+    BroadcastRadioHidlTest()
+        : mCallbackCalled(false), mBoolCallbackData(false), mResultCallbackData(Result::OK),
+        mHwFailure(false) {}
 
     void onCallback_l() {
         if (!mCallbackCalled) {
@@ -208,9 +229,12 @@
     bool openTuner();
     bool checkAntenna();
 
+    static const nsecs_t kConnectCallbacktimeoutNs = seconds_to_nanoseconds(1);
     static const nsecs_t kConfigCallbacktimeoutNs = seconds_to_nanoseconds(10);
     static const nsecs_t kTuneCallbacktimeoutNs = seconds_to_nanoseconds(30);
 
+    Class radioClass;
+    bool skipped;
     sp<IBroadcastRadio> mRadio;
     Properties mHalProperties;
     sp<ITuner> mTuner;
@@ -225,13 +249,6 @@
     bool mHwFailure;
 };
 
-// A class for test environment setup (kept since this file is a template).
-class BroadcastRadioHidlEnvironment : public ::testing::Environment {
- public:
-    virtual void SetUp() {}
-    virtual void TearDown() {}
-};
-
 namespace android {
 namespace hardware {
 namespace broadcastradio {
@@ -331,7 +348,8 @@
  *  - the implementation supports at least one tuner
  *  - the implementation supports at one band
  */
-TEST_F(BroadcastRadioHidlTest, GetProperties) {
+TEST_P(BroadcastRadioHidlTest, GetProperties) {
+    RETURN_IF_SKIPPED;
     EXPECT_EQ(true, getProperties());
 }
 
@@ -342,7 +360,8 @@
  *  - the HAL implements the method
  *  - the method returns 0 (no error) and a valid ITuner interface
  */
-TEST_F(BroadcastRadioHidlTest, OpenTuner) {
+TEST_P(BroadcastRadioHidlTest, OpenTuner) {
+    RETURN_IF_SKIPPED;
     EXPECT_EQ(true, openTuner());
 }
 
@@ -353,7 +372,8 @@
  *  - ITuner destruction gets propagated through HAL
  *  - the openTuner method works well when called for the second time
  */
-TEST_F(BroadcastRadioHidlTest, ReopenTuner) {
+TEST_P(BroadcastRadioHidlTest, ReopenTuner) {
+    RETURN_IF_SKIPPED;
     EXPECT_TRUE(openTuner());
     mTuner.clear();
     EXPECT_TRUE(openTuner());
@@ -366,7 +386,8 @@
  *  - the openTuner method fails when called for the second time without deleting previous
  *    ITuner instance
  */
-TEST_F(BroadcastRadioHidlTest, OpenTunerTwice) {
+TEST_P(BroadcastRadioHidlTest, OpenTunerTwice) {
+    RETURN_IF_SKIPPED;
     EXPECT_TRUE(openTuner());
 
     Result halResult = Result::NOT_INITIALIZED;
@@ -389,7 +410,8 @@
  *  - the configuration callback is received within kConfigCallbacktimeoutNs ns
  *  - the configuration read back from HAl has the same class Id
  */
-TEST_F(BroadcastRadioHidlTest, SetAndGetConfiguration) {
+TEST_P(BroadcastRadioHidlTest, SetAndGetConfiguration) {
+    RETURN_IF_SKIPPED;
     ASSERT_EQ(true, openTuner());
     // test setConfiguration
     mCallbackCalled = false;
@@ -422,7 +444,8 @@
  *  - the methods returns INVALID_ARGUMENTS on invalid arguments
  *  - the method recovers and succeeds after passing correct arguments
  */
-TEST_F(BroadcastRadioHidlTest, SetConfigurationFails) {
+TEST_P(BroadcastRadioHidlTest, SetConfigurationFails) {
+    RETURN_IF_SKIPPED;
     ASSERT_EQ(true, openTuner());
 
     // Let's define a config that's bad for sure.
@@ -456,7 +479,8 @@
  *  - the tuned callback is received within kTuneCallbacktimeoutNs ns
  *  - skipping sub-channel or not does not fail the call
  */
-TEST_F(BroadcastRadioHidlTest, Scan) {
+TEST_P(BroadcastRadioHidlTest, Scan) {
+    RETURN_IF_SKIPPED;
     ASSERT_EQ(true, openTuner());
     ASSERT_TRUE(checkAntenna());
     // test scan UP
@@ -483,7 +507,8 @@
  *  - the tuned callback is received within kTuneCallbacktimeoutNs ns
  *  - skipping sub-channel or not does not fail the call
  */
-TEST_F(BroadcastRadioHidlTest, Step) {
+TEST_P(BroadcastRadioHidlTest, Step) {
+    RETURN_IF_SKIPPED;
     ASSERT_EQ(true, openTuner());
     ASSERT_TRUE(checkAntenna());
     // test step UP
@@ -509,7 +534,8 @@
  *  - the methods return 0 (no error)
  *  - the tuned callback is received within kTuneCallbacktimeoutNs ns after tune()
  */
-TEST_F(BroadcastRadioHidlTest, TuneAndGetProgramInformationAndCancel) {
+TEST_P(BroadcastRadioHidlTest, TuneAndGetProgramInformationAndCancel) {
+    RETURN_IF_SKIPPED;
     ASSERT_EQ(true, openTuner());
     ASSERT_TRUE(checkAntenna());
 
@@ -566,7 +592,8 @@
  *  - the method returns INVALID_ARGUMENTS when applicable
  *  - the method recovers and succeeds after passing correct arguments
  */
-TEST_F(BroadcastRadioHidlTest, TuneFailsOutOfBounds) {
+TEST_P(BroadcastRadioHidlTest, TuneFailsOutOfBounds) {
+    RETURN_IF_SKIPPED;
     ASSERT_TRUE(openTuner());
     ASSERT_TRUE(checkAntenna());
 
@@ -595,9 +622,12 @@
     EXPECT_TRUE(waitForCallback(kTuneCallbacktimeoutNs));
 }
 
+INSTANTIATE_TEST_CASE_P(
+    BroadcastRadioHidlTestCases,
+    BroadcastRadioHidlTest,
+    ::testing::Values(Class::AM_FM, Class::SAT, Class::DT));
 
 int main(int argc, char** argv) {
-  ::testing::AddGlobalTestEnvironment(new BroadcastRadioHidlEnvironment);
   ::testing::InitGoogleTest(&argc, argv);
   int status = RUN_ALL_TESTS();
   ALOGI("Test result = %d", status);
diff --git a/broadcastradio/1.1/Android.bp b/broadcastradio/1.1/Android.bp
index 570d1ae..12611dd 100644
--- a/broadcastradio/1.1/Android.bp
+++ b/broadcastradio/1.1/Android.bp
@@ -4,6 +4,7 @@
     name: "android.hardware.broadcastradio@1.1_hal",
     srcs: [
         "types.hal",
+        "IBroadcastRadio.hal",
         "IBroadcastRadioFactory.hal",
         "ITuner.hal",
         "ITunerCallback.hal",
@@ -19,6 +20,7 @@
     ],
     out: [
         "android/hardware/broadcastradio/1.1/types.cpp",
+        "android/hardware/broadcastradio/1.1/BroadcastRadioAll.cpp",
         "android/hardware/broadcastradio/1.1/BroadcastRadioFactoryAll.cpp",
         "android/hardware/broadcastradio/1.1/TunerAll.cpp",
         "android/hardware/broadcastradio/1.1/TunerCallbackAll.cpp",
@@ -34,6 +36,11 @@
     ],
     out: [
         "android/hardware/broadcastradio/1.1/types.h",
+        "android/hardware/broadcastradio/1.1/IBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.1/IHwBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.1/BnHwBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.1/BpHwBroadcastRadio.h",
+        "android/hardware/broadcastradio/1.1/BsBroadcastRadio.h",
         "android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h",
         "android/hardware/broadcastradio/1.1/IHwBroadcastRadioFactory.h",
         "android/hardware/broadcastradio/1.1/BnHwBroadcastRadioFactory.h",
diff --git a/broadcastradio/1.1/IBroadcastRadio.hal b/broadcastradio/1.1/IBroadcastRadio.hal
new file mode 100644
index 0000000..a6347c7
--- /dev/null
+++ b/broadcastradio/1.1/IBroadcastRadio.hal
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package android.hardware.broadcastradio@1.1;
+
+import @1.0::IBroadcastRadio;
+
+interface IBroadcastRadio extends @1.0::IBroadcastRadio {
+
+    /*
+     * Retrieve implementation properties.
+     * @return properties A Properties structure containing implementation
+     *                    description and capabilities.
+     */
+    getProperties_1_1() generates (Properties properties);
+
+};
diff --git a/broadcastradio/1.1/ITuner.hal b/broadcastradio/1.1/ITuner.hal
index 4f34019..82d45c6 100644
--- a/broadcastradio/1.1/ITuner.hal
+++ b/broadcastradio/1.1/ITuner.hal
@@ -26,7 +26,33 @@
      *                NOT_INITIALIZED if another error occurs
      * @return info Current program information.
      */
-    getProgramInformation_1_1() generates(Result result, ProgramInfo info);
+    getProgramInformation_1_1() generates (Result result, ProgramInfo info);
+
+    /**
+     * Initiates a background scan to update internally cached program list.
+     *
+     * HAL client may not need to initiate the scan explicitly with this call,
+     * ie. HAL implementation MAY perform the scan on boot. It's a common
+     * practice in devices with two physical tuners with background scanning.
+     *
+     * Device must call backgroundScanComplete if the result is OK, even if the
+     * scan fails later (it must pass proper result through the callback).
+     * Otherwise, backgroundScanComplete must not be called as a result of this
+     * certain attempt. It may still be called as a response to another call to
+     * startBackgroundScan, former or latter.
+     *
+     * Device may utilize an already running (but not finished) scan for
+     * subsequent calls to startBackgroundScan, issuing a single
+     * backgroundScanComplete callback.
+     *
+     * @return result OK if the scan was properly scheduled (this does not mean
+     *                it successfully finished).
+     *                TEMPORARILY_UNAVAILABLE if the background scan is
+     *                temporarily unavailable, ie. due to ongoing foreground
+     *                playback in single-tuner device.
+     *                NOT_INITIALIZED other error, ie. HW failure.
+     */
+    startBackgroundScan() generates (ProgramListResult result);
 
     /**
      * Retrieve station list.
@@ -40,11 +66,12 @@
      *               before setting this parameter to anything else.
      * @return result OK if the list was successfully retrieved.
      *                NOT_READY if the scan is in progress.
-     *                NOT_STARTED if the scan has not been started.
+     *                NOT_STARTED if the scan has not been started, client may
+     *                call startBackgroundScan to fix this.
      *                NOT_INITIALIZED if any other error occurs.
      * @return programList List of stations available for user.
      */
     getProgramList(string filter)
-            generates(ProgramListResult result, vec<ProgramInfo> programList);
+        generates (ProgramListResult result, vec<ProgramInfo> programList);
 
 };
diff --git a/broadcastradio/1.1/ITunerCallback.hal b/broadcastradio/1.1/ITunerCallback.hal
index 4af6b1f..1ea57e9 100644
--- a/broadcastradio/1.1/ITunerCallback.hal
+++ b/broadcastradio/1.1/ITunerCallback.hal
@@ -19,9 +19,10 @@
 import @1.0::ITunerCallback;
 
 /**
- * Some methods of @1.1::ITunerCallback are updated versions of those from @1.0:ITunerCallback.
- * All 1.1 drivers should call both (eg. tuneComplete and tuneComplete_1_1), while 1.1 clients
- * should ignore 1.0 ones, to avoid receiving a callback twice.
+ * Some methods of @1.1::ITunerCallback are updated versions of those from
+ * @1.0:ITunerCallback. All 1.1 HAL implementations must call both
+ * (eg. tuneComplete and tuneComplete_1_1), while 1.1 clients may ignore 1.0
+ * ones, to avoid receiving a callback twice.
  */
 interface ITunerCallback extends @1.0::ITunerCallback {
     /*
@@ -37,4 +38,27 @@
      * @param info A ProgramInfo structure describing the new tuned station.
      */
     oneway afSwitch_1_1(ProgramInfo info);
+
+    /**
+     * Called by the HAL when background scan initiated by startBackgroundScan
+     * finishes. If the list was changed, programListChanged must be called too.
+     * @param result OK if the scan succeeded, client may retrieve the actual
+     *               list with ITuner::getProgramList.
+     *               TEMPORARILY_UNAVAILABLE if the scan was interrupted due to
+     *               hardware becoming temporarily unavailable.
+     *               NOT_INITIALIZED other error, ie. HW failure.
+     */
+    oneway backgroundScanComplete(ProgramListResult result);
+
+    /**
+     * Called each time the internally cached program list changes. HAL may not
+     * call it immediately, ie. it may wait for a short time to accumulate
+     * multiple list change notifications into a single event.
+     *
+     * It may be triggered either by an explicitly issued background scan,
+     * or a scan issued by the device internally.
+     *
+     * Client may retrieve the actual list with ITuner::getProgramList.
+     */
+    oneway programListChanged();
 };
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index 611267b..68c9b93 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -94,7 +94,7 @@
 }
 
 
-// Methods from ::android::hardware::broadcastradio::V1_0::IBroadcastRadio follow.
+// Methods from ::android::hardware::broadcastradio::V1_1::IBroadcastRadio follow.
 Return<void> BroadcastRadio::getProperties(getProperties_cb _hidl_cb)
 {
     int rc;
@@ -115,6 +115,11 @@
     return Void();
 }
 
+Return<void> BroadcastRadio::getProperties_1_1(getProperties_1_1_cb _hidl_cb __unused)
+{
+    return Status::fromExceptionCode(Status::EX_UNSUPPORTED_OPERATION);
+}
+
 Return<void> BroadcastRadio::openTuner(const BandConfig& config, bool audio,
     const sp<V1_0::ITunerCallback>& callback, openTuner_cb _hidl_cb)
 {
diff --git a/broadcastradio/1.1/default/BroadcastRadio.h b/broadcastradio/1.1/default/BroadcastRadio.h
index 068979d..7de31a0 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.h
+++ b/broadcastradio/1.1/default/BroadcastRadio.h
@@ -16,7 +16,7 @@
 #ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_1_BROADCASTRADIO_H
 #define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_BROADCASTRADIO_H
 
-#include <android/hardware/broadcastradio/1.0/IBroadcastRadio.h>
+#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
 #include <android/hardware/broadcastradio/1.1/types.h>
 #include <hardware/radio.h>
 
@@ -30,12 +30,13 @@
 using V1_0::BandConfig;
 using V1_0::Properties;
 
-struct BroadcastRadio : public V1_0::IBroadcastRadio {
+struct BroadcastRadio : public V1_1::IBroadcastRadio {
 
     BroadcastRadio(Class classId);
 
-    // Methods from ::android::hardware::broadcastradio::V1_0::IBroadcastRadio follow.
+    // Methods from ::android::hardware::broadcastradio::V1_1::IBroadcastRadio follow.
     Return<void> getProperties(getProperties_cb _hidl_cb) override;
+    Return<void> getProperties_1_1(getProperties_1_1_cb _hidl_cb) override;
     Return<void> openTuner(const BandConfig& config, bool audio,
             const sp<V1_0::ITunerCallback>& callback, openTuner_cb _hidl_cb) override;
 
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index b4eb184..f280754 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -200,6 +200,10 @@
     return Void();
 }
 
+Return<ProgramListResult> Tuner::startBackgroundScan() {
+    return ProgramListResult::NOT_INITIALIZED;
+}
+
 Return<void> Tuner::getProgramList(const hidl_string& filter __unused, getProgramList_cb _hidl_cb) {
     hidl_vec<ProgramInfo> pList;
     // TODO(b/34054813): do the actual implementation.
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index fcf053a..d7b4545 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -42,6 +42,7 @@
     Return<Result> cancel() override;
     Return<void> getProgramInformation(getProgramInformation_cb _hidl_cb) override;
     Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
+    Return<ProgramListResult> startBackgroundScan() override;
     Return<void> getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) override;
 
     static void callback(radio_hal_event_t *halEvent, void *cookie);
diff --git a/broadcastradio/1.1/types.hal b/broadcastradio/1.1/types.hal
index b6f72d2..3021f2e 100644
--- a/broadcastradio/1.1/types.hal
+++ b/broadcastradio/1.1/types.hal
@@ -45,6 +45,16 @@
     MUTED = 1 << 1,
 };
 
+struct Properties {
+    @1.0::Properties base;
+
+    /**
+     * The hardware supports background scanning in general. At the given time
+     * it may not be available though, see startBackgroundScan.
+     */
+    bool supportsBackgroundScanning;
+};
+
 /**
  * Radio program information. Returned by the HAL with event RADIO_EVENT_TUNED.
  * Contains information on currently tuned channel.
diff --git a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
index a29f6dc..d3c05c4 100644
--- a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
+++ b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
@@ -47,6 +47,7 @@
 using ::android::hardware::broadcastradio::V1_1::ITunerCallback;
 using ::android::hardware::broadcastradio::V1_1::ProgramInfo;
 using ::android::hardware::broadcastradio::V1_1::Result;
+using ::android::hardware::broadcastradio::V1_1::ProgramListResult;
 
 
 // The main test class for Broadcast Radio HIDL HAL.
@@ -128,6 +129,14 @@
             return Void();
         }
 
+        virtual Return<void> backgroundScanComplete(ProgramListResult result __unused) {
+            return Void();
+        }
+
+        virtual Return<void> programListChanged() {
+            return Void();
+        }
+
                 MyCallback(BroadcastRadioHidlTest *parentTest) : mParentTest(parentTest) {}
 
      private:
diff --git a/camera/device/3.2/ICameraDeviceSession.hal b/camera/device/3.2/ICameraDeviceSession.hal
index d8d3177..e186c8d 100644
--- a/camera/device/3.2/ICameraDeviceSession.hal
+++ b/camera/device/3.2/ICameraDeviceSession.hal
@@ -152,6 +152,7 @@
      *             camera3_stream_configuration_t->operation_mode requirements
      *             for non-NORMAL mode, or the requested operation_mode is not
      *             supported by the HAL.
+     *           - Unsupported usage flag
      *         The camera service cannot filter out all possible illegal stream
      *         configurations, since some devices may support more simultaneous
      *         streams or larger stream resolutions than the minimum required
diff --git a/camera/device/3.2/types.hal b/camera/device/3.2/types.hal
index c7d38c1..ba5bbe0 100644
--- a/camera/device/3.2/types.hal
+++ b/camera/device/3.2/types.hal
@@ -248,6 +248,12 @@
      * streamType INPUT, the value of this field is always 0. For all streams
      * passed via configureStreams(), the HAL must set its own
      * additional usage flags in its output HalStreamConfiguration.
+     *
+     * The usage flag for an output stream may be bitwise combination of usage
+     * flags for multiple consumers, for the purpose of sharing one camera
+     * stream between those consumers. The HAL must fail configureStreams call
+     * with ILLEGAL_ARGUMENT if the combined flags cannot be supported due to
+     * imcompatible buffer format, dataSpace, or other hardware limitations.
      */
     ConsumerUsageFlags usage;
 
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.cpp b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
index 87c9ffb..9469ab4 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.cpp
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
@@ -123,11 +123,6 @@
     return Void();
 }
 
-// Methods from ::android::hidl::base::V1_0::IBase follow.
-ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* /* name */) {
-    return new SurfaceFlingerConfigs();
-}
-
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace configstore
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.h b/configstore/1.0/default/SurfaceFlingerConfigs.h
index 9f9b217..9300511 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.h
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.h
@@ -40,8 +40,6 @@
 
 };
 
-extern "C" ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* name);
-
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace configstore
diff --git a/configstore/utils/include/configstore/Utils.h b/configstore/utils/include/configstore/Utils.h
index 98ccae9..46cc9b0 100644
--- a/configstore/utils/include/configstore/Utils.h
+++ b/configstore/utils/include/configstore/Utils.h
@@ -20,6 +20,10 @@
 #include <hidl/Status.h>
 #include <stdatomic.h>
 
+#pragma push_macro("LOG_TAG")
+#undef LOG_TAG
+#define LOG_TAG "ConfigStoreUtil"
+
 namespace android {
 namespace hardware {
 namespace configstore {
@@ -39,9 +43,13 @@
             // fallback to the default value
             ret.specified = false;
         } else {
-            (*configs.*func)([&ret](V v) {
+            auto status = (*configs.*func)([&ret](V v) {
                 ret = v;
             });
+            if (!status.isOk()) {
+                ALOGE("HIDL call failed. %s", status.description().c_str());
+                ret.specified = false;
+            }
         }
 
         return ret;
@@ -91,4 +99,6 @@
 }  // namespace hardware
 }  // namespace android
 
+#pragma pop_macro("LOG_TAG")
+
 #endif  // ANDROID_HARDWARE_CONFIGSTORE_UTILS_H
diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
index 21b7136..bd5cc2e 100644
--- a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
+++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
@@ -31,10 +31,16 @@
 using android::hardware::gnss::V1_0::GnssLocationFlags;
 using android::hardware::gnss::V1_0::IGnss;
 using android::hardware::gnss::V1_0::IGnssCallback;
+using android::hardware::gnss::V1_0::IGnssDebug;
+using android::hardware::gnss::V1_0::IGnssMeasurement;
 using android::sp;
 
 #define TIMEOUT_SEC 3  // for basic commands/responses
 
+// Set these false for release, true for stronger test
+#define GNSS_SIGNAL_IS_PRESENT false
+#define GNSS_ASSISTANCE_IS_PRESENT false
+
 // The main test class for GNSS HAL.
 class GnssHalTest : public ::testing::VtsHalHidlTargetTestBase {
  public:
@@ -273,7 +279,12 @@
 #define PREFERRED_ACCURACY 0   // Ideally perfect (matches GnssLocationProvider)
 #define PREFERRED_TIME_MSEC 0  // Ideally immediate
 
+#if GNSS_ASSISTANCE_IS_PRESENT
+#define LOCATION_TIMEOUT_FIRST_SEC 15
+#else
 #define LOCATION_TIMEOUT_FIRST_SEC 45
+#endif
+
 #define LOCATION_TIMEOUT_SUBSEQUENT_SEC 3
 #define LOCATIONS_TO_CHECK 5
 
@@ -286,16 +297,21 @@
       PREFERRED_ACCURACY, PREFERRED_TIME_MSEC);
 
   ASSERT_TRUE(result.isOk());
-  ASSERT_TRUE(result);
+  EXPECT_TRUE(result);
 
   result = gnss_hal_->start();
 
   ASSERT_TRUE(result.isOk());
-  ASSERT_TRUE(result);
+  EXPECT_TRUE(result);
 
-  // GPS signals initially optional for this test, so don't expect no timeout
-  // yet
+  /*
+   * GPS signals initially optional for this test, so don't expect no timeout
+   * yet
+   */
   wait(LOCATION_TIMEOUT_FIRST_SEC);
+  if (GNSS_SIGNAL_IS_PRESENT) {
+    ASSERT_GT(location_called_count_, 0);
+  }
   if (location_called_count_ > 0) {
     CheckLocation(last_location_, checkMoreAccuracies);
   }
@@ -313,6 +329,88 @@
   ASSERT_TRUE(result);
 }
 
+/*
+ * InjectDelete:
+ * Ensures that calls to inject and/or delete information state are handled.
+ * Better tests await GPS signal
+ */
+TEST_F(GnssHalTest, InjectDelete) {
+  // confidently, well north of Alaska
+  auto result = gnss_hal_->injectLocation(80.0, -170.0, 1000.0);
+
+  // TODO: full self-diff including TODO's :)
+  ASSERT_TRUE(result.isOk());
+  EXPECT_TRUE(result);
+
+  // fake time, but generally reasonable values (time in Aug. 2018)
+  result = gnss_hal_->injectTime(1534567890123L, 123456L, 10000L);
+
+  ASSERT_TRUE(result.isOk());
+  EXPECT_TRUE(result);
+
+  auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
+
+  ASSERT_TRUE(resultVoid.isOk());
+}
+
+/*
+ * GetAllExtentions:
+ * Tries getting all optional extensions, and ensures a valid return
+ *   null or actual extension, no crash.
+ * Confirms year-based required extensions (Measurement & Debug) are present
+ */
+TEST_F(GnssHalTest, GetAllExtensions) {
+  // Basic call-is-handled checks
+  auto gnssXtra = gnss_hal_->getExtensionXtra();
+  ASSERT_TRUE(gnssXtra.isOk());
+
+  auto gnssRil = gnss_hal_->getExtensionAGnssRil();
+  ASSERT_TRUE(gnssRil.isOk());
+
+  auto gnssAgnss = gnss_hal_->getExtensionAGnss();
+  ASSERT_TRUE(gnssAgnss.isOk());
+
+  auto gnssNi = gnss_hal_->getExtensionGnssNi();
+  ASSERT_TRUE(gnssNi.isOk());
+
+  auto gnssNavigationMessage = gnss_hal_->getExtensionGnssNavigationMessage();
+  ASSERT_TRUE(gnssNavigationMessage.isOk());
+
+  auto gnssConfiguration = gnss_hal_->getExtensionGnssConfiguration();
+  ASSERT_TRUE(gnssConfiguration.isOk());
+
+  auto gnssGeofencing = gnss_hal_->getExtensionGnssGeofencing();
+  ASSERT_TRUE(gnssGeofencing.isOk());
+
+  auto gnssBatching = gnss_hal_->getExtensionGnssBatching();
+  ASSERT_TRUE(gnssBatching.isOk());
+
+  // Verifying, in some cases, that these return actual extensions
+  auto gnssMeasurement = gnss_hal_->getExtensionGnssMeasurement();
+  ASSERT_TRUE(gnssMeasurement.isOk());
+  if (last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS) {
+    sp<IGnssMeasurement> iGnssMeas = gnssMeasurement;
+    EXPECT_NE(iGnssMeas, nullptr);
+  }
+
+  auto gnssDebug = gnss_hal_->getExtensionGnssDebug();
+  ASSERT_TRUE(gnssDebug.isOk());
+  if (info_called_count_ > 0 && last_info_.yearOfHw >= 2017) {
+    sp<IGnssDebug> iGnssDebug = gnssDebug;
+    EXPECT_NE(iGnssDebug, nullptr);
+  }
+}
+
+/*
+ * MeasurementCapabilities:
+ * Verifies that modern hardware supports measurement capabilities.
+ */
+TEST_F(GnssHalTest, MeasurementCapabilites) {
+  if (info_called_count_ > 0 && last_info_.yearOfHw >= 2016) {
+    EXPECT_TRUE(last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS);
+  }
+}
+
 int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);
   int status = RUN_ALL_TESTS();
diff --git a/keymaster/3.0/default/KeymasterDevice.cpp b/keymaster/3.0/default/KeymasterDevice.cpp
index 0969355..01f0795 100644
--- a/keymaster/3.0/default/KeymasterDevice.cpp
+++ b/keymaster/3.0/default/KeymasterDevice.cpp
@@ -525,6 +525,8 @@
             case Tag::ATTESTATION_ID_SERIAL:
             case Tag::ATTESTATION_ID_IMEI:
             case Tag::ATTESTATION_ID_MEID:
+            case Tag::ATTESTATION_ID_MANUFACTURER:
+            case Tag::ATTESTATION_ID_MODEL:
                 // Device id attestation may only be supported if the device is able to permanently
                 // destroy its knowledge of the ids. This device is unable to do this, so it must
                 // never perform any device id attestation.
diff --git a/keymaster/3.0/types.hal b/keymaster/3.0/types.hal
index 9f29b6a..1f4a0cc 100644
--- a/keymaster/3.0/types.hal
+++ b/keymaster/3.0/types.hal
@@ -135,7 +135,10 @@
                                                     in attestation */
     ATTESTATION_ID_MEID = TagType:BYTES | 715,   /* Used to provide the device's MEID to be included
                                                     in attestation */
-
+    ATTESTATION_ID_MANUFACTURER = TagType:BYTES | 716, /* Used to provide the device's manufacturer
+                                                          name to be included in attestation */
+    ATTESTATION_ID_MODEL = TagType:BYTES | 717,  /* Used to provide the device's model name to be
+                                                    included in attestation */
 
     /* Tags used only to provide data to or receive data from operations */
     ASSOCIATED_DATA = TagType:BYTES | 1000, /* Used to provide associated data for AEAD modes. */
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index c610406..d337a36 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -12,7 +12,7 @@
 namespace V1_0 {
 namespace implementation {
 
-sp<INfcClientCallback> Nfc::mCallback = NULL;
+sp<INfcClientCallback> Nfc::mCallback = nullptr;
 
 Nfc::Nfc(nfc_nci_device_t* device) : mDevice(device),
     mDeathRecipient(new NfcDeathRecipient(this)) {
@@ -21,35 +21,58 @@
 // Methods from ::android::hardware::nfc::V1_0::INfc follow.
 ::android::hardware::Return<NfcStatus> Nfc::open(const sp<INfcClientCallback>& clientCallback)  {
     mCallback = clientCallback;
+
+    if (mDevice == nullptr || mCallback == nullptr) {
+        return NfcStatus::FAILED;
+    }
     mCallback->linkToDeath(mDeathRecipient, 0 /*cookie*/);
     int ret = mDevice->open(mDevice, eventCallback, dataCallback);
     return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
 }
 
 ::android::hardware::Return<uint32_t> Nfc::write(const hidl_vec<uint8_t>& data)  {
+    if (mDevice == nullptr) {
+        return -1;
+    }
     return mDevice->write(mDevice, data.size(), &data[0]);
 }
 
 ::android::hardware::Return<NfcStatus> Nfc::coreInitialized(const hidl_vec<uint8_t>& data)  {
     hidl_vec<uint8_t> copy = data;
+
+    if (mDevice == nullptr) {
+        return NfcStatus::FAILED;
+    }
     int ret = mDevice->core_initialized(mDevice, &copy[0]);
     return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
 }
 
 ::android::hardware::Return<NfcStatus> Nfc::prediscover()  {
+    if (mDevice == nullptr) {
+        return NfcStatus::FAILED;
+    }
     return mDevice->pre_discover(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
 ::android::hardware::Return<NfcStatus> Nfc::close()  {
+    if (mDevice == nullptr || mCallback == nullptr) {
+        return NfcStatus::FAILED;
+    }
     mCallback->unlinkToDeath(mDeathRecipient);
     return mDevice->close(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
 ::android::hardware::Return<NfcStatus> Nfc::controlGranted()  {
+    if (mDevice == nullptr) {
+        return NfcStatus::FAILED;
+    }
     return mDevice->control_granted(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
 ::android::hardware::Return<NfcStatus> Nfc::powerCycle()  {
+    if (mDevice == nullptr) {
+        return NfcStatus::FAILED;
+    }
     return mDevice->power_cycle(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
@@ -57,11 +80,10 @@
 INfc* HIDL_FETCH_INfc(const char * /*name*/) {
     nfc_nci_device_t* nfc_device;
     int ret = 0;
-    const hw_module_t* hw_module = NULL;
+    const hw_module_t* hw_module = nullptr;
 
     ret = hw_get_module (NFC_NCI_HARDWARE_MODULE_ID, &hw_module);
-    if (ret == 0)
-    {
+    if (ret == 0) {
         ret = nfc_nci_open (hw_module, &nfc_device);
         if (ret != 0) {
             ALOGE ("nfc_nci_open failed: %d", ret);
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index d21bf0b..42e53a7 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -28,7 +28,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      */
     oneway getIccCardStatusResponse(RadioResponseInfo info, CardStatus cardStatus);
 
@@ -38,9 +37,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT
      */
     oneway supplyIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -51,9 +48,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT (PUK is invalid)
      */
     oneway supplyIccPukForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -64,9 +59,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT
      */
     oneway supplyIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -76,9 +69,7 @@
      * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT (PUK is invalid)
      */
     oneway supplyIccPuk2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -89,9 +80,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT
      */
     oneway changeIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -102,9 +91,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
      */
     oneway changeIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -115,9 +102,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:PASSWORD_INCORRECT (code is invalid)
      */
     oneway supplyNetworkDepersonalizationResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -128,7 +113,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
      *   RadioError:GENERIC_FAILURE (request will be made again in a few hundred msec)
      *   RadioError:NO_MEMORY
@@ -141,7 +125,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:DIAL_MODIFIED_TO_USSD
      *   RadioError:DIAL_MODIFIED_TO_SS
      *   RadioError:DIAL_MODIFIED_TO_DIAL
@@ -167,9 +150,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getIMSIForAppResponse(RadioResponseInfo info, string imsi);
 
@@ -185,7 +166,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
-     *   RadioError:GENERIC_FAILURE
      */
     oneway hangupConnectionResponse(RadioResponseInfo info);
 
@@ -203,7 +183,6 @@
      *   RadioError:NO_RESOURCES
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway hangupWaitingOrBackgroundResponse(RadioResponseInfo info);
 
@@ -221,7 +200,6 @@
      *   RadioError:NO_RESOURCES
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway hangupForegroundResumeBackgroundResponse(RadioResponseInfo info);
 
@@ -239,7 +217,6 @@
      *   RadioError:INVALID_CALL_ID
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway switchWaitingOrHoldingAndActiveResponse(RadioResponseInfo info);
 
@@ -256,7 +233,6 @@
      *   RadioError:INVALID_CALL_ID
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway conferenceResponse(RadioResponseInfo info);
 
@@ -274,7 +250,6 @@
      *   RadioError:INVALID_CALL_ID
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway rejectCallResponse(RadioResponseInfo info);
 
@@ -316,10 +291,8 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:NO_MEMORY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getLastCallFailCauseResponse(RadioResponseInfo info,
             LastCallFailCauseInfo failCauseinfo);
@@ -330,7 +303,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      */
     oneway getSignalStrengthResponse(RadioResponseInfo info, SignalStrength sigStrength);
@@ -342,9 +314,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getVoiceRegistrationStateResponse(RadioResponseInfo info,
             VoiceRegStateResult voiceRegResponse);
@@ -356,9 +326,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getDataRegistrationStateResponse(RadioResponseInfo info,
             DataRegStateResult dataRegResponse);
@@ -371,9 +339,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getOperatorResponse(RadioResponseInfo info, string longName, string shortName,
             string numeric);
@@ -383,9 +349,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:OPERATION_NOT_ALLOWED
      */
     oneway setRadioPowerResponse(RadioResponseInfo info);
@@ -401,7 +365,6 @@
      *   RadioError:NO_MEMORY
      *   RadioError:MODEM_ERR
      *   RadioError:INVALID_CALL_ID
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendDtmfResponse(RadioResponseInfo info);
 
@@ -425,7 +388,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:NETWORK_ERR
      *   RadioError:MODE_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendSmsResponse(RadioResponseInfo info, SendSmsResult sms);
 
@@ -450,7 +412,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:NETWORK_ERR
      *   RadioError:MODE_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendSMSExpectMoreResponse(RadioResponseInfo info, SendSmsResult sms);
 
@@ -462,12 +423,10 @@
      *   RadioError:NONE must be returned on both success and failure of setup with the
      *              DataCallResponse.status containing the actual status
      *              For all other errors the DataCallResponse is ignored.
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW
      *   RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
      *   RadioError:REQUEST_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setupDataCallResponse(RadioResponseInfo info, SetupDataCallResult dcResponse);
 
@@ -477,11 +436,9 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SIM_PIN2
      *   RadioError:SIM_PUK2
-     *   RadioError:GENERIC_FAILURE
      */
     oneway iccIOForAppResponse(RadioResponseInfo info, IccIoResult iccIo);
 
@@ -504,7 +461,6 @@
      *   RadioError:ABORTED
      *   RadioError:SYSTEM_ERR
      *   RadioError:INVALID_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendUssdResponse(RadioResponseInfo info);
 
@@ -513,7 +469,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SIM_BUSY
      *   RadioError:OPERATION_NOT_ALLOWED
@@ -521,7 +476,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:NO_MEMORY
      *   RadioError:INVALID_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway cancelPendingUssdResponse(RadioResponseInfo info);
 
@@ -532,7 +486,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SS_MODIFIED_TO_DIAL
      *   RadioError:SS_MODIFIED_TO_USSD
@@ -542,7 +495,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:FDN_CHECK_FAILURE
      *   RadioError:SYSTEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getClirResponse(RadioResponseInfo info, int32_t n, int32_t m);
 
@@ -558,7 +510,6 @@
      *   RadioError:SS_MODIFIED_TO_SS
      *   RadioError:INVALID_ARGUMENTS
      *   RadioError:SYSTEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setClirResponse(RadioResponseInfo info);
 
@@ -586,7 +537,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCallForwardStatusResponse(RadioResponseInfo info,
             vec<CallForwardInfo> callForwardInfos);
@@ -607,7 +557,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_STATE
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCallForwardResponse(RadioResponseInfo info);
 
@@ -632,7 +581,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCallWaitingResponse(RadioResponseInfo info, bool enable, int32_t serviceClass);
 
@@ -651,7 +599,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_STATE
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCallWaitingResponse(RadioResponseInfo info);
 
@@ -660,9 +607,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo info);
 
@@ -671,7 +616,6 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_STATE
      *   RadioError:NO_MEMORY
@@ -679,7 +623,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
-     *   RadioError:GENERIC_FAILURE
      */
     oneway acceptCallResponse(RadioResponseInfo info);
 
@@ -688,9 +631,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway deactivateDataCallResponse(RadioResponseInfo info);
 
@@ -712,7 +653,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:SYSTEM_ERR
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getFacilityLockForAppResponse(RadioResponseInfo info, int32_t response);
 
@@ -732,7 +672,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_STATE
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setFacilityLockForAppResponse(RadioResponseInfo info, int32_t retry);
 
@@ -751,7 +690,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:SYSTEM_ERR
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setBarringPasswordResponse(RadioResponseInfo info);
 
@@ -761,9 +699,7 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getNetworkSelectionModeResponse(RadioResponseInfo info, bool manual);
 
@@ -772,11 +708,9 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:ILLEGAL_SIM_OR_ME
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      *
      * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
      * no retries needed, such as illegal SIM or ME.
@@ -789,11 +723,9 @@
      *
      * Valid errors returned:
      *   RadioError:NONE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:ILLEGAL_SIM_OR_ME
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      *
      * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
      * no retries needed, such as illegal SIM or ME.
@@ -832,7 +764,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
-     *   RadioError:GENERIC_FAILURE
      */
     oneway startDtmfResponse(RadioResponseInfo info);
 
@@ -850,7 +781,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
-     *   RadioError:GENERIC_FAILURE
      */
     oneway stopDtmfResponse(RadioResponseInfo info);
 
@@ -861,9 +791,7 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:EMPTY_RECORD
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getBasebandVersionResponse(RadioResponseInfo info, string version);
 
@@ -882,7 +810,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway separateConnectionResponse(RadioResponseInfo info);
 
@@ -895,7 +822,6 @@
      *   RadioError:INVALID_ARGUMENTS
      *   RadioError:NO_MEMORY
      *   RadioError:REQUEST_RATE_LIMITED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setMuteResponse(RadioResponseInfo info);
 
@@ -906,13 +832,11 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:SS_MODIFIED_TO_DIAL
      *   RadioError:SS_MODIFIED_TO_USSD
      *   RadioError:SS_MODIFIED_TO_SS
      *   RadioError:NO_MEMORY
      *   RadioError:REQUEST_RATE_LIMITED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getMuteResponse(RadioResponseInfo info, bool enable);
 
@@ -929,7 +853,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:FDN_CHECK_FAILURE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getClipResponse(RadioResponseInfo info, ClipStatus status);
 
@@ -940,8 +863,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getDataCallListResponse(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
 
@@ -957,7 +878,6 @@
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setSuppServiceNotificationsResponse(RadioResponseInfo info);
 
@@ -978,7 +898,6 @@
      *   RadioError:INVALID_MODEM_STATE
      *   RadioError:MODE_NOT_SUPPORTED
      *   RadioError:INVALID_SMSC_ADDRESS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway writeSmsToSimResponse(RadioResponseInfo info, int32_t index);
 
@@ -994,7 +913,6 @@
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
      *   RadioError:NO_SUCH_ENTRY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway deleteSmsOnSimResponse(RadioResponseInfo info);
 
@@ -1004,9 +922,7 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setBandModeResponse(RadioResponseInfo info);
 
@@ -1018,7 +934,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getAvailableBandModesResponse(RadioResponseInfo info, vec<RadioBandMode> bandModes);
 
@@ -1030,10 +945,8 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:SIM_BUSY
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendEnvelopeResponse(RadioResponseInfo info, string commandResponse);
 
@@ -1045,7 +958,6 @@
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_ARGUMENTS
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendTerminalResponseToSimResponse(RadioResponseInfo info);
 
@@ -1057,7 +969,6 @@
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_ARGUMENTS
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway handleStkCallSetupRequestFromSimResponse(RadioResponseInfo info);
 
@@ -1076,7 +987,6 @@
      *   RadioError:INTERNAL_ERR
      *   RadioError:INVALID_CALL_ID
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway explicitCallTransferResponse(RadioResponseInfo info);
 
@@ -1086,10 +996,8 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:OPERATION_NOT_ALLOWED
      *   RadioError:MODE_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setPreferredNetworkTypeResponse(RadioResponseInfo info);
 
@@ -1100,8 +1008,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getPreferredNetworkTypeResponse(RadioResponseInfo info,
             PreferredNetworkType nwType);
@@ -1114,7 +1020,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getNeighboringCidsResponse(RadioResponseInfo info, vec<NeighboringCell> cells);
 
@@ -1124,8 +1029,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setLocationUpdatesResponse(RadioResponseInfo info);
 
@@ -1135,10 +1038,8 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:SIM_ABSENT
      *   RadioError:SUBSCRIPTION_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCdmaSubscriptionSourceResponse(RadioResponseInfo info);
 
@@ -1148,8 +1049,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCdmaRoamingPreferenceResponse(RadioResponseInfo info);
 
@@ -1161,7 +1060,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCdmaRoamingPreferenceResponse(RadioResponseInfo info, CdmaRoamingType type);
 
@@ -1175,7 +1073,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:NO_MEMORY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setTTYModeResponse(RadioResponseInfo info);
 
@@ -1190,7 +1087,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:NO_MEMORY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getTTYModeResponse(RadioResponseInfo info, TtyMode mode);
 
@@ -1204,7 +1100,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:NO_MEMORY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setPreferredVoicePrivacyResponse(RadioResponseInfo info);
 
@@ -1220,7 +1115,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INTERNAL_ERR
      *   RadioError:NO_MEMORY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getPreferredVoicePrivacyResponse(RadioResponseInfo info, bool enable);
 
@@ -1239,7 +1133,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INVALID_CALL_ID
      *   RadioError:INVALID_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendCDMAFeatureCodeResponse(RadioResponseInfo info);
 
@@ -1256,7 +1149,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INVALID_CALL_ID
      *   RadioError:INVALID_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendBurstDtmfResponse(RadioResponseInfo info);
 
@@ -1281,7 +1173,6 @@
      *   RadioError:ENCODING_ERR
      *   RadioError:INVALID_SMSC_ADDRESS
      *   RadioError:MODE_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendCdmaSmsResponse(RadioResponseInfo info, SendSmsResult sms);
 
@@ -1301,7 +1192,6 @@
      *   RadioError:MODE_NOT_SUPPORTED
      *   RadioError:NETWORK_NOT_READY
      *   RadioError:INVALID_MODEM_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway acknowledgeLastIncomingCdmaSmsResponse(RadioResponseInfo info);
 
@@ -1319,7 +1209,6 @@
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
      *   RadioError:NO_RESOURCES
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getGsmBroadcastConfigResponse(RadioResponseInfo info,
             vec<GsmBroadcastSmsConfigInfo> configs);
@@ -1336,7 +1225,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setGsmBroadcastConfigResponse(RadioResponseInfo info);
 
@@ -1352,7 +1240,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setGsmBroadcastActivationResponse(RadioResponseInfo info);
 
@@ -1370,7 +1257,6 @@
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
      *   RadioError:NO_RESOURCES
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCdmaBroadcastConfigResponse(RadioResponseInfo info,
             vec<CdmaBroadcastSmsConfigInfo> configs);
@@ -1387,7 +1273,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCdmaBroadcastConfigResponse(RadioResponseInfo info);
 
@@ -1403,7 +1288,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCdmaBroadcastActivationResponse(RadioResponseInfo info);
 
@@ -1420,9 +1304,7 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:SUBSCRIPTION_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCDMASubscriptionResponse(RadioResponseInfo info, string mdn, string hSid,
             string hNid, string min, string prl);
@@ -1445,7 +1327,6 @@
      *   RadioError:INVALID_MODEM_STATE
      *   RadioError:MODE_NOT_SUPPORTED
      *   RadioError:INVALID_SMSC_ADDRESS
-     *   RadioError:GENERIC_FAILURE
      */
     oneway writeSmsToRuimResponse(RadioResponseInfo info, uint32_t index);
 
@@ -1461,7 +1342,6 @@
      *   RadioError:SYSTEM_ERR
      *   RadioError:MODEM_ERR
      *   RadioError:NO_SUCH_ENTRY
-     *   RadioError:GENERIC_FAILURE
      */
     oneway deleteSmsOnRuimResponse(RadioResponseInfo info);
 
@@ -1475,8 +1355,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:GENERIC_FAILURE
      *
      * If a empty string value is returned for any of the device id, it means that there was error
      * accessing the device.
@@ -1491,9 +1369,7 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
      *   RadioError:OPERATION_NO_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway exitEmergencyCallbackModeResponse(RadioResponseInfo info);
 
@@ -1512,7 +1388,6 @@
      *   RadioError:MODEM_ERR
      *   RadioError:INVALID_MODEM_STATE
      *   RadioError:NOT_PROVISIONED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getSmscAddressResponse(RadioResponseInfo info, string smsc);
 
@@ -1529,7 +1404,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:MODEM_ERR
      *   RadioError:NO_RESOURCES
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setSmscAddressResponse(RadioResponseInfo info);
 
@@ -1545,7 +1419,6 @@
      *   RadioError:REQUEST_RATE_LIMITED
      *   RadioError:MODEM_ERR
      *   RadioError:INVALID_STATE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway reportSmsMemoryStatusResponse(RadioResponseInfo info);
 
@@ -1555,7 +1428,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway reportStkServiceIsRunningResponse(RadioResponseInfo info);
 
@@ -1567,7 +1439,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SUBSCRIPTION_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCdmaSubscriptionSourceResponse(RadioResponseInfo info, CdmaSubscriptionSource source);
 
@@ -1578,7 +1449,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway requestIsimAuthenticationResponse(RadioResponseInfo info, string response);
 
@@ -1588,7 +1458,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway acknowledgeIncomingGsmSmsWithPduResponse(RadioResponseInfo info);
 
@@ -1601,7 +1470,6 @@
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SIM_BUSY
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendEnvelopeWithStatusResponse(RadioResponseInfo info, IccIoResult iccIo);
 
@@ -1612,7 +1480,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getVoiceRadioTechnologyResponse(RadioResponseInfo info, RadioTechnology rat);
 
@@ -1623,7 +1490,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getCellInfoListResponse(RadioResponseInfo info, vec<CellInfo> cellInfo);
 
@@ -1633,7 +1499,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setCellInfoListRateResponse(RadioResponseInfo info);
 
@@ -1644,7 +1509,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SUBSCRIPTION_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setInitialAttachApnResponse(RadioResponseInfo info);
 
@@ -1657,7 +1521,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getImsRegistrationStateResponse(RadioResponseInfo info, bool isRegistered,
             RadioTechnologyFamily ratFamily);
@@ -1682,7 +1545,6 @@
      *   RadioError:NETWORK_ERR
      *   RadioError:ENCODING_ERR
      *   RadioError:MODE_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway sendImsSmsResponse(RadioResponseInfo info, SendSmsResult sms);
 
@@ -1693,7 +1555,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway iccTransmitApduBasicChannelResponse(RadioResponseInfo info, IccIoResult result);
 
@@ -1706,7 +1567,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      *   RadioError:MISSING_RESOURCE
      *   RadioError:NO_SUCH_ELEMENT
      */
@@ -1719,7 +1579,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway iccCloseLogicalChannelResponse(RadioResponseInfo info);
 
@@ -1730,7 +1589,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway iccTransmitApduLogicalChannelResponse(RadioResponseInfo info, IccIoResult result);
 
@@ -1741,7 +1599,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway nvReadItemResponse(RadioResponseInfo info, string result);
 
@@ -1751,7 +1608,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway nvWriteItemResponse(RadioResponseInfo info);
 
@@ -1761,7 +1617,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway nvWriteCdmaPrlResponse(RadioResponseInfo info);
 
@@ -1771,7 +1626,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway nvResetConfigResponse(RadioResponseInfo info);
 
@@ -1782,7 +1636,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:SUBSCRIPTION_NOT_SUPPORTED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setUiccSubscriptionResponse(RadioResponseInfo info);
 
@@ -1792,7 +1645,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setDataAllowedResponse(RadioResponseInfo info);
 
@@ -1833,7 +1685,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway requestShutdownResponse(RadioResponseInfo info);
 
@@ -1845,7 +1696,6 @@
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
 
@@ -1858,7 +1708,6 @@
      *   RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds.
      *   RadioError:RADIO_NOT_AVAILABLE
      *   RadioError:OPERATION_NOT_ALLOWED
-     *   RadioError:GENERIC_FAILURE
      */
     oneway setRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
 
@@ -1902,7 +1751,6 @@
      * Valid errors returned:
      *   RadioError:NONE
      *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:GENERIC_FAILURE
      */
     oneway getModemActivityInfoResponse(RadioResponseInfo info, ActivityStatsInfo activityInfo);
 
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index eabc63d..82409de 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -226,6 +226,44 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (NanDataPathSecurityConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityConfig.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.NanDataPathSecurityConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanDataPathSecurityType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityType.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.NanDataPathSecurityType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (NanDebugConfig)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
@@ -359,6 +397,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (NanParamSizeLimits)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanParamSizeLimits.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.NanParamSizeLimits
+
+$(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
@@ -2048,6 +2105,44 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (NanDataPathSecurityConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityConfig.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.NanDataPathSecurityConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanDataPathSecurityType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityType.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.NanDataPathSecurityType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (NanDebugConfig)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
@@ -2181,6 +2276,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (NanParamSizeLimits)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanParamSizeLimits.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.NanParamSizeLimits
+
+$(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
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index fb93c5a..c005213 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -973,17 +973,41 @@
         hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
   legacy_request->recv_indication_cfg |=
         hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
-  legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
-  legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
-  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
-    LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
-    return false;
+  legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.securityConfig.cipherType;
+  if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+    legacy_request->key_info.body.pmk_info.pmk_len =
+        hidl_request.baseConfigs.securityConfig.pmk.size();
+    if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+      LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.pmk_info.pmk,
+          hidl_request.baseConfigs.securityConfig.pmk.data(),
+          legacy_request->key_info.body.pmk_info.pmk_len);
   }
-  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;
+  if (hidl_request.baseConfigs.securityConfig.securityType
+        == NanDataPathSecurityType::PASSPHRASE) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+    legacy_request->key_info.body.passphrase_info.passphrase_len =
+        hidl_request.baseConfigs.securityConfig.passphrase.size();
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too small";
+      return false;
+    }
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+          hidl_request.baseConfigs.securityConfig.passphrase.data(),
+          legacy_request->key_info.body.passphrase_info.passphrase_len);
+  }
+  legacy_request->sdea_params.security_cfg = (hidl_request.baseConfigs.securityConfig.securityType
+        != NanDataPathSecurityType::OPEN) ? 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;
@@ -1066,17 +1090,40 @@
         hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
   legacy_request->recv_indication_cfg |=
         hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
-  legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
-  legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
-  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
-    LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
-    return false;
+  legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.securityConfig.cipherType;
+  if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+    legacy_request->key_info.body.pmk_info.pmk_len =
+        hidl_request.baseConfigs.securityConfig.pmk.size();
+    if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+      LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.pmk_info.pmk,
+          hidl_request.baseConfigs.securityConfig.pmk.data(),
+          legacy_request->key_info.body.pmk_info.pmk_len);
   }
-  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;
+  if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+    legacy_request->key_info.body.passphrase_info.passphrase_len =
+        hidl_request.baseConfigs.securityConfig.passphrase.size();
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too small";
+      return false;
+    }
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+          hidl_request.baseConfigs.securityConfig.passphrase.data(),
+          legacy_request->key_info.body.passphrase_info.passphrase_len);
+  }
+  legacy_request->sdea_params.security_cfg = (hidl_request.baseConfigs.securityConfig.securityType
+          != NanDataPathSecurityType::OPEN) ? 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;
@@ -1251,8 +1298,9 @@
         (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->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType
+        != NanDataPathSecurityType::OPEN) ? 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) {
     LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len too large";
@@ -1260,13 +1308,43 @@
   }
   memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
         legacy_request->app_info.ndp_app_info_len);
-  legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
-  legacy_request->pmk_len = hidl_request.pmk.size();
-  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
-    LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
+  legacy_request->cipher_type = (unsigned int) hidl_request.securityConfig.cipherType;
+  if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+    legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
+    if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.pmk_info.pmk,
+          hidl_request.securityConfig.pmk.data(),
+          legacy_request->key_info.body.pmk_info.pmk_len);
+  }
+  if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+    legacy_request->key_info.body.passphrase_info.passphrase_len =
+        hidl_request.securityConfig.passphrase.size();
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too small";
+      return false;
+    }
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+          hidl_request.securityConfig.passphrase.data(),
+          legacy_request->key_info.body.passphrase_info.passphrase_len);
+  }
+  legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size();
+  if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: service_name_len too large";
     return false;
   }
-  memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+  memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(),
+        legacy_request->service_name_len);
 
   return true;
 }
@@ -1284,8 +1362,9 @@
         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->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType
+        != NanDataPathSecurityType::OPEN) ? 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) {
     LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: ndp_app_info_len too large";
@@ -1293,13 +1372,43 @@
   }
   memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
         legacy_request->app_info.ndp_app_info_len);
-  legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
-  legacy_request->pmk_len = hidl_request.pmk.size();
-  if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
-    LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
+  legacy_request->cipher_type = (unsigned int) hidl_request.securityConfig.cipherType;
+  if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+    legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
+    if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.pmk_info.pmk,
+          hidl_request.securityConfig.pmk.data(),
+          legacy_request->key_info.body.pmk_info.pmk_len);
+  }
+  if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+    legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+    legacy_request->key_info.body.passphrase_info.passphrase_len =
+        hidl_request.securityConfig.passphrase.size();
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too small";
+      return false;
+    }
+    if (legacy_request->key_info.body.passphrase_info.passphrase_len
+            > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+      LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too large";
+      return false;
+    }
+    memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+          hidl_request.securityConfig.passphrase.data(),
+          legacy_request->key_info.body.passphrase_info.passphrase_len);
+  }
+  legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size();
+  if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+    LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: service_name_len too large";
     return false;
   }
-  memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+  memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(),
+        legacy_request->service_name_len);
 
   return true;
 }
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index d3845c9..17aadee 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -586,6 +586,17 @@
  */
 
 /**
+ * Size limits for parameters used in the NAN interface.
+ */
+enum NanParamSizeLimits : uint32_t {
+  /* Minimum length of Passphrase argument for data-path configuration */
+  MIN_PASSPHRASE_LENGTH = 8,
+
+  /* Maximum length of Passphrase argument for data-path configuration */
+  MAX_PASSPHRASE_LENGTH = 63,
+};
+
+/**
  * A unique short handle provided by the client to identify individual invocations of
  * certain API's like |IWifiNanIface.*|.
  */
@@ -701,6 +712,15 @@
 };
 
 /**
+ * NAN DP (data-path) security configuration options.
+ */
+enum NanDataPathSecurityType : uint32_t {
+  OPEN,       // no security
+  PMK,        // security: PMK
+  PASSPHRASE, // security: passphrase
+};
+
+/**
  * NAN band-specific configuration.
  */
 struct NanBandSpecificConfig {
@@ -910,6 +930,38 @@
 };
 
 /**
+ * Configuration of NAN data-path security.
+ */
+struct NanDataPathSecurityConfig {
+  /**
+   * Security configuration of the data-path (NDP). Security is required if not equal to
+   * |NanDataPathSecurityType.OPEN|.
+   * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
+   */
+  NanDataPathSecurityType securityType;
+  /**
+   * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must
+   * be set to |NanCipherSuiteType.NONE|, otherwise a non-|NanCipherSuiteType.NONE| cipher suite
+   * must be specified.
+   */
+  NanCipherSuiteType cipherType;
+  /**
+   * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is
+   * set to |NanDataPathSecurityType.PMK|.
+   * Ref: IEEE 802.11i
+   */
+  uint8_t[32] pmk;
+  /**
+   * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to
+   * |NanDataPathSecurityType.PASSPHRASE|.
+   * Min length: |MIN_PASSPHRASE_LENGTH|
+   * Max length: |MAX_PASSPHRASE_LENGTH|
+   * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
+   */
+  vec<uint8_t> passphrase;
+};
+
+/**
  * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
  */
 struct NanDiscoveryCommonConfig {
@@ -1009,25 +1061,11 @@
    */
   bool disableFollowupReceivedIndication;
   /**
-   * Cipher type for data-paths constructed in the context of this discovery session. Must be
-   * specified as |NanCipherSuiteType.NONE| if no |pmk| is provided.
+   * Security configuration of data-paths created in the context of this discovery session. Security
+   * parameters can be overridden during the actual construction of the data-path - allowing
+   * individual data-paths to have unique PMKs or Passphrases.
    */
-  NanCipherSuiteType cipherType;
-  /**
-   * Optional Pairwise Master Key (PMK) for data-paths constructed in the context of this discovery
-   * session. A PMK can also be provided during the actual construction of the data-path (which
-   * allows for unique PMKs for each data-path). The |cipherType| must be specified if a PMK is
-   * provided.
-   * Max length: 32
-   * Ref: IEEE 802.11i
-   */
-  vec<uint8_t> pmk;
-  /**
-   * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
-   * of this discovery session.
-   * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
-   */
-  bool securityEnabledInNdp;
+  NanDataPathSecurityConfig securityConfig;
   /**
    * Specifies whether or not there is a ranging requirement in this discovery session.
    * Ranging is only performed if all other match criteria with the peer are met. Ranging must
@@ -1213,10 +1251,9 @@
    */
   string ifaceName;
   /**
-   * Specifies whether or not security is required for the data-path being created.
-   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
+   * Security configuration of the requested data-path.
    */
-  bool securityRequired;
+  NanDataPathSecurityConfig securityConfig;
   /**
    * Arbitrary information communicated to the peer as part of the data-path setup process - there
    * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
@@ -1226,17 +1263,13 @@
    */
   vec<uint8_t> appInfo;
   /**
-   * Cipher type for the data-path being requested. Must be specified as |NanCipherSuiteType.NONE|
-   * if no |pmk| is provided.
+   * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
+   * data-path. Only relevant when a data-path is requested which is not associated with a NAN
+   * discovery session - e.g. using out-of-band discovery.
+   * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
+   * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
    */
-  NanCipherSuiteType cipherType;
-  /**
-   * Pairwise Master Key (PMK) for the data-path being requested (if |securityRequired| is true).
-   * The |cipherType| must be specified if a PMK is provided.
-   * Max length: 32
-   * Ref: IEEE 802.11i
-   */
-  vec<uint8_t> pmk;
+  vec<uint8_t> serviceNameOutOfBand;
 };
 
 /**
@@ -1259,10 +1292,9 @@
    */
   string ifaceName;
   /**
-   * Specifies whether or not security is required for the data-path being created.
-   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
+   * Security configuration of the requested data-path.
    */
-  bool securityRequired;
+  NanDataPathSecurityConfig securityConfig;
   /**
    * Arbitrary information communicated to the peer as part of the data-path setup process - there
    * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
@@ -1272,16 +1304,13 @@
    */
   vec<uint8_t> appInfo;
   /**
-   * Cipher type for the data-path being negotiated. Must be specified as |NanCipherSuiteType.NONE|
-   * if no |pmk| is provided.
+   * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
+   * data-path. Only relevant when a data-path is requested which is not associated with a NAN
+   * discovery session - e.g. using out-of-band discovery.
+   * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
+   * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
    */
-  NanCipherSuiteType cipherType;
-  /**
-   * Pairwise Master Key (PMK) for the data-path being negotiated (if |securityRequired| is true).
-   * The |cipherType| must be specified if a PMK is provided.
-   * Max length: 32
-   */
-  vec<uint8_t> pmk;
+  vec<uint8_t> serviceNameOutOfBand;
 };
 
 /**
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index 9403e98..b454a06 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -17,7 +17,7 @@
 cc_library_static {
     name: "VtsHalWifiV1_0TargetTestUtil",
     srcs: [
-        "VtsHalWifiV1_0TargetTest.cpp",
+
         "wifi_hidl_call_util_selftest.cpp",
         "wifi_hidl_test.cpp",
         "wifi_hidl_test_utils.cpp"],
@@ -38,6 +38,7 @@
     name: "VtsHalWifiV1_0TargetTest",
     defaults: ["hidl_defaults"],
     srcs: [
+        "VtsHalWifiV1_0TargetTest.cpp",
         "wifi_ap_iface_hidl_test.cpp",
         "wifi_chip_hidl_test.cpp",
         "wifi_p2p_iface_hidl_test.cpp",
@@ -63,7 +64,9 @@
 cc_test {
     name: "VtsHalWifiNanV1_0TargetTest",
     defaults: ["hidl_defaults"],
-    srcs: ["wifi_nan_iface_hidl_test.cpp"],
+    srcs: [
+        "VtsHalWifiV1_0TargetTest.cpp",
+        "wifi_nan_iface_hidl_test.cpp"],
     shared_libs: [
         "libbase",
         "liblog",
diff --git a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
index b56ed2b..160fcd2 100644
--- a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
+++ b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
@@ -20,14 +20,6 @@
 
 #include "wifi_hidl_test_utils.h"
 
-class WifiHidlEnvironment : public ::testing::Environment {
-   public:
-    virtual void SetUp() override { stopFramework(); }
-    virtual void TearDown() override { startFramework(); }
-
-   private:
-};
-
 int main(int argc, char** argv) {
     ::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
     ::testing::InitGoogleTest(&argc, argv);
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
index 2d0b081..fefbd79 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
@@ -82,14 +82,6 @@
 }
 }  // namespace
 
-void stopFramework() {
-    ASSERT_EQ(std::system("stop"), 0);
-    stopWifi();
-    sleep(5);
-}
-
-void startFramework() { ASSERT_EQ(std::system("start"), 0); }
-
 sp<IWifi> getWifi() {
     sp<IWifi> wifi = ::testing::VtsHalHidlTargetTestBase::getService<IWifi>();
     return wifi;
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
index a723b2a..39a0eba 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
@@ -24,11 +24,6 @@
 #include <android/hardware/wifi/1.0/IWifiRttController.h>
 #include <android/hardware/wifi/1.0/IWifiStaIface.h>
 
-// Used to stop the android framework (wifi service) before every
-// test.
-void stopFramework();
-void startFramework();
-
 // 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
@@ -49,3 +44,12 @@
     android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
 // Used to trigger IWifi.stop() at the end of every test.
 void stopWifi();
+
+class WifiHidlEnvironment : public ::testing::Environment {
+ public:
+  virtual void SetUp() override {
+      stopWifi();
+      sleep(5);
+  }
+  virtual void TearDown() override {}
+};
\ No newline at end of file