Merge "Update makefiles to use filgroup syntax."
diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp
index 75bf306..a8229d3 100644
--- a/audio/2.0/default/StreamIn.cpp
+++ b/audio/2.0/default/StreamIn.cpp
@@ -105,7 +105,7 @@
     while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
         // TODO: Remove manual event flag handling once blocking MQ is implemented. b/33815422
         uint32_t efState = 0;
-        mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL), &efState, NS_PER_SEC);
+        mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL), &efState);
         if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL))) {
             continue;  // Nothing to do.
         }
diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp
index 4cd25aa..6ccdbcd 100644
--- a/audio/2.0/default/StreamOut.cpp
+++ b/audio/2.0/default/StreamOut.cpp
@@ -103,8 +103,7 @@
     while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
         // TODO: Remove manual event flag handling once blocking MQ is implemented. b/33815422
         uint32_t efState = 0;
-        mEfGroup->wait(
-                static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY), &efState, NS_PER_SEC);
+        mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY), &efState);
         if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY))) {
             continue;  // Nothing to do.
         }
diff --git a/audio/2.0/default/service.cpp b/audio/2.0/default/service.cpp
index 646d898..8b608c8 100644
--- a/audio/2.0/default/service.cpp
+++ b/audio/2.0/default/service.cpp
@@ -33,11 +33,20 @@
 using android::hardware::registerPassthroughServiceImplementation;
 using android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory;
 
+using android::OK;
+
 int main(int /* argc */, char* /* argv */ []) {
     configureRpcThreadpool(16, true /*callerWillJoin*/);
-    registerPassthroughServiceImplementation<IDevicesFactory>("audio_devices_factory");
-    registerPassthroughServiceImplementation<IEffectsFactory>("audio_effects_factory");
-    registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
-    registerPassthroughServiceImplementation<IBroadcastRadioFactory>("broadcastradio");
+    android::status_t status;
+    status = registerPassthroughServiceImplementation<IDevicesFactory>("audio_devices_factory");
+    LOG_ALWAYS_FATAL_IF(status != OK, "Error while registering audio service: %d", status);
+    status = registerPassthroughServiceImplementation<IEffectsFactory>("audio_effects_factory");
+    LOG_ALWAYS_FATAL_IF(status != OK, "Error while registering audio effects service: %d", status);
+    // Soundtrigger and FM radio might be not present.
+    status = registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
+    ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status);
+    status = registerPassthroughServiceImplementation<IBroadcastRadioFactory>("broadcastradio");
+    ALOGE_IF(status != OK, "Error while registering fm radio service: %d", status);
     joinRpcThreadpool();
+    return status;
 }
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
index 0a4aeb7..83c8e09 100644
--- a/audio/effect/2.0/default/Effect.cpp
+++ b/audio/effect/2.0/default/Effect.cpp
@@ -77,10 +77,7 @@
     // as the Thread uses mutexes, and this can lead to priority inversion.
     while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
         uint32_t efState = 0;
-        mEfGroup->wait(
-                static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL),
-                &efState,
-                NS_PER_SEC);
+        mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL), &efState);
         if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL))
                 || (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_QUIT))) {
             continue;  // Nothing to do or time to quit.
diff --git a/automotive/vehicle/2.0/default/impl/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/DefaultConfig.h
index 270bf8c..0c549b9 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/DefaultConfig.h
@@ -174,6 +174,18 @@
         .access = VehiclePropertyAccess::READ,
         .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         .configArray = {0,0}
+    },
+
+    {
+        .prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME_INFO),
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE
+    },
+
+    {
+        .prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME_CLEAR),
+        .access = VehiclePropertyAccess::WRITE,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE
     }
 };
 
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index 88717a9..d3d77b6 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -15,9 +15,9 @@
  */
 
 #define LOG_TAG "DefaultVehicleHal"
+#include <android/log.h>
 
 #include <algorithm>
-#include <android/log.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
 
@@ -181,87 +181,113 @@
     return nullptr;
 }
 
-void DefaultVehicleHal::initObd2LiveFrame(VehiclePropConfig& obd2LiveFramePropConfig) {
-    mObd2SensorStore.reset(new Obd2SensorStore(
-        obd2LiveFramePropConfig.configArray[0],
-        obd2LiveFramePropConfig.configArray[1]));
-    // precalculate OBD2 sensor values
-    mObd2SensorStore->setIntegerSensor(
+static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(
+        size_t numVendorIntegerSensors,
+        size_t numVendorFloatSensors) {
+    std::unique_ptr<Obd2SensorStore> sensorStore(new Obd2SensorStore(
+            numVendorIntegerSensors, numVendorFloatSensors));
+
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
         toInt(FuelSystemStatus::CLOSED_LOOP));
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
         toInt(IgnitionMonitorKind::SPARK));
-    mObd2SensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
+    sensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
         CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
         CommonIgnitionMonitors::MISFIRE_AVAILABLE |
         SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
         SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
         toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
-    mObd2SensorStore->setIntegerSensor(
+    sensorStore->setIntegerSensor(
         Obd2IntegerSensorIndex::FUEL_TYPE, toInt(FuelType::GASOLINE));
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::ENGINE_RPM, 1250.);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::VEHICLE_SPEED, 40.);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
-    mObd2SensorStore->setFloatSensor(
+    sensorStore->setFloatSensor(
         Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
+
+    return sensorStore;
+}
+
+void DefaultVehicleHal::initObd2LiveFrame(VehiclePropConfig& propConfig) {
+    auto sensorStore = fillDefaultObd2Frame(propConfig.configArray[0],
+            propConfig.configArray[1]);
+    mLiveObd2Frame = createVehiclePropValue(VehiclePropertyType::COMPLEX, 0);
+    sensorStore->fillPropValue(mLiveObd2Frame.get(), "");
+}
+
+void DefaultVehicleHal::initObd2FreezeFrame(VehiclePropConfig& propConfig) {
+    auto sensorStore = fillDefaultObd2Frame(propConfig.configArray[0],
+            propConfig.configArray[1]);
+
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+
+    sensorStore->fillPropValue(mFreezeObd2Frames[0].get(), "P0070");
+    sensorStore->fillPropValue(mFreezeObd2Frames[1].get(), "P0102");
+    sensorStore->fillPropValue(mFreezeObd2Frames[2].get(), "P0123");
 }
 
 void DefaultVehicleHal::parseRxProtoBuf(std::vector<uint8_t>& msg) {
@@ -598,11 +624,15 @@
     switch (propId) {
     case toInt(VehicleProperty::OBD2_LIVE_FRAME):
         v = pool.obtainComplex();
-        status = fillObd2LiveFrame(&v);
+        status = fillObd2LiveFrame(v.get());
         break;
     case toInt(VehicleProperty::OBD2_FREEZE_FRAME):
         v = pool.obtainComplex();
-        status = fillObd2FreezeFrame(&v);
+        status = fillObd2FreezeFrame(requestedPropValue, v.get());
+        break;
+    case toInt(VehicleProperty::OBD2_FREEZE_FRAME_INFO):
+        v = pool.obtainComplex();
+        status = fillObd2DtcInfo(v.get());
         break;
     default:
         {
@@ -627,16 +657,24 @@
 }
 
 StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) {
-    StatusCode status = updateProperty(propValue);
-
-    if (status == StatusCode::OK) {
-        // Send property update to emulator
-        emulator::EmulatorMessage msg;
-        emulator::VehiclePropValue *val = msg.add_value();
-        populateProtoVehiclePropValue(val, &propValue);
-        msg.set_status(emulator::RESULT_OK);
-        msg.set_msg_type(emulator::SET_PROPERTY_ASYNC);
-        txMsg(msg);
+    auto propId = propValue.prop;
+    StatusCode status;
+    switch (propId) {
+        case toInt(VehicleProperty::OBD2_FREEZE_FRAME_CLEAR):
+            status = clearObd2FreezeFrames(propValue);
+            break;
+        default:
+            status = updateProperty(propValue);
+            if (status == StatusCode::OK) {
+                // Send property update to emulator
+                emulator::EmulatorMessage msg;
+                emulator::VehiclePropValue *val = msg.add_value();
+                populateProtoVehiclePropValue(val, &propValue);
+                msg.set_status(emulator::RESULT_OK);
+                msg.set_msg_type(emulator::SET_PROPERTY_ASYNC);
+                txMsg(msg);
+            }
+            break;
     }
 
     return status;
@@ -680,6 +718,9 @@
             case toInt(VehicleProperty::OBD2_LIVE_FRAME):
                 initObd2LiveFrame(cfg);
                 break;
+            case toInt(VehicleProperty::OBD2_FREEZE_FRAME):
+                initObd2FreezeFrame(cfg);
+                break;
             default:
                 // Need to handle each complex property separately
                 break;
@@ -721,21 +762,78 @@
     mThread = std::thread(&DefaultVehicleHal::rxThread, this);
 }
 
-StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValuePtr* v) {
-    (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors();
-    (*v)->value.floatValues = mObd2SensorStore->getFloatSensors();
-    (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask();
+StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValue* v) {
+    v->prop = toInt(VehicleProperty::OBD2_LIVE_FRAME);
+    v->value.int32Values = mLiveObd2Frame->value.int32Values;
+    v->value.floatValues = mLiveObd2Frame->value.floatValues;
+    v->value.bytes = mLiveObd2Frame->value.bytes;
     return StatusCode::OK;
 }
 
-StatusCode DefaultVehicleHal::fillObd2FreezeFrame(VehiclePropValuePtr* v) {
-    (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors();
-    (*v)->value.floatValues = mObd2SensorStore->getFloatSensors();
-    (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask();
-    (*v)->value.stringValue = "P0010";
+template<typename Iterable>
+typename Iterable::const_iterator findPropValueAtTimestamp(
+        const Iterable& frames,
+        int64_t timestamp) {
+    return std::find_if(frames.begin(),
+            frames.end(),
+            [timestamp] (const std::unique_ptr<VehiclePropValue>&
+                         propValue) -> bool {
+                             return propValue->timestamp == timestamp;
+            });
+}
+
+StatusCode DefaultVehicleHal::fillObd2FreezeFrame(
+        const VehiclePropValue& requestedPropValue, VehiclePropValue* v) {
+    if (requestedPropValue.value.int64Values.size() != 1) {
+        ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp");
+        return StatusCode::INVALID_ARG;
+    }
+    auto timestamp = requestedPropValue.value.int64Values[0];
+    auto freezeFrameIter = findPropValueAtTimestamp(mFreezeObd2Frames,
+            timestamp);
+    if(mFreezeObd2Frames.end() == freezeFrameIter) {
+        ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
+        return StatusCode::INVALID_ARG;
+    }
+    const std::unique_ptr<VehiclePropValue>& freezeFrame = *freezeFrameIter;
+    v->prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME);
+    v->value.int32Values = freezeFrame->value.int32Values;
+    v->value.floatValues = freezeFrame->value.floatValues;
+    v->value.bytes = freezeFrame->value.bytes;
+    v->value.stringValue = freezeFrame->value.stringValue;
+    v->timestamp = freezeFrame->timestamp;
     return StatusCode::OK;
 }
 
+StatusCode DefaultVehicleHal::clearObd2FreezeFrames(
+    const VehiclePropValue& propValue) {
+    if (propValue.value.int64Values.size() == 0) {
+        mFreezeObd2Frames.clear();
+        return StatusCode::OK;
+    } else {
+        for(int64_t timestamp: propValue.value.int64Values) {
+            auto freezeFrameIter = findPropValueAtTimestamp(mFreezeObd2Frames,
+                    timestamp);
+            if(mFreezeObd2Frames.end() == freezeFrameIter) {
+                ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
+                return StatusCode::INVALID_ARG;
+            }
+            mFreezeObd2Frames.erase(freezeFrameIter);
+        }
+    }
+    return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::fillObd2DtcInfo(VehiclePropValue* v) {
+    std::vector<int64_t> timestamps;
+    for(const auto& freezeFrame: mFreezeObd2Frames) {
+        timestamps.push_back(freezeFrame->timestamp);
+    }
+    v->value.int64Values = timestamps;
+    return StatusCode::OK;
+}
+
+
 
 }  // impl
 
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
index edfc224..4b89f55 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -85,7 +85,8 @@
     void doGetPropertyAll(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
     void doSetProperty(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
     VehiclePropValue* getVehiclePropValueLocked(int32_t propId, int32_t areaId);
-    void initObd2LiveFrame(VehiclePropConfig& obd2LiveFramePropConfig);
+    void initObd2LiveFrame(VehiclePropConfig& propConfig);
+    void initObd2FreezeFrame(VehiclePropConfig& propConfig);
     void parseRxProtoBuf(std::vector<uint8_t>& msg);
     void populateProtoVehicleConfig(emulator::VehiclePropConfig* protoCfg,
                                     const VehiclePropConfig& cfg);
@@ -96,14 +97,18 @@
     void rxThread(void);
     void txMsg(emulator::EmulatorMessage& txMsg);
     StatusCode updateProperty(const VehiclePropValue& propValue);
-    StatusCode fillObd2LiveFrame(VehiclePropValuePtr* v);
-    StatusCode fillObd2FreezeFrame(VehiclePropValuePtr* v);
+    StatusCode fillObd2LiveFrame(VehiclePropValue* v);
+    StatusCode fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue,
+            VehiclePropValue* v);
+    StatusCode fillObd2DtcInfo(VehiclePropValue *v);
+    StatusCode clearObd2FreezeFrames(const VehiclePropValue& propValue);
 private:
     // TODO:  Use a hashtable to support indexing props
     std::vector<std::unique_ptr<VehiclePropValue>> mProps;
     std::atomic<int> mCurSocket;
     std::atomic<int> mExit;
-    std::unique_ptr<Obd2SensorStore> mObd2SensorStore{nullptr};
+    std::unique_ptr<VehiclePropValue> mLiveObd2Frame {nullptr};
+    std::vector<std::unique_ptr<VehiclePropValue>> mFreezeObd2Frames;
     std::mutex mPropsMutex;
     int mSocket;
     std::mutex mTxMutex;
diff --git a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
index 7c9a4d9..6922b86 100644
--- a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
@@ -50,7 +50,7 @@
 
     ASSERT_TRUE(parser->parseFromStream(&file, &aclMap));
 
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
     ASSERT_EQ(VehiclePropertyAccess::READ_WRITE, it->second.access);
@@ -74,7 +74,7 @@
     for (auto it = range.first; it != range.second; ++it) {
         auto& acl = it->second;
 
-        ASSERT_EQ(1, expectedUids.count(acl.uid))
+        ASSERT_EQ(1u, expectedUids.count(acl.uid))
                 << " uid: " << std::hex << acl.uid;
 
         if (acl.uid == 0xbeef) {
@@ -93,12 +93,12 @@
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
 
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
     ASSERT_EQ(VehiclePropertyAccess::READ, it->second.access);
     ASSERT_EQ(toInt(VehicleProperty::HVAC_FAN_SPEED), it->second.propId);
-    ASSERT_EQ(0xbeef, it->second.uid);
+    ASSERT_EQ(0xBEEFu, it->second.uid);
 }
 
 TEST_F(AccessControlConfigParserTest, badIntegerFormat) {
@@ -106,7 +106,7 @@
     file << "S:0x0500 A12 RW " << std::endl;
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
-    ASSERT_EQ(0, aclMap.size());
+    ASSERT_EQ(0u, aclMap.size());
 }
 
 TEST_F(AccessControlConfigParserTest, ignoreNotSupportedProperties) {
@@ -114,7 +114,7 @@
     file << "S:0x0666 1000 RW " << std::endl;
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
-    ASSERT_EQ(0, aclMap.size());
+    ASSERT_EQ(0u, aclMap.size());
 }
 
 TEST_F(AccessControlConfigParserTest, multipleCalls) {
@@ -122,12 +122,12 @@
     configFile << "S:0x0500 1000 RW" << std::endl;
 
     ASSERT_TRUE(parser->parseFromStream(&configFile, &aclMap));
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
 
     std::stringstream configFile2;
     configFile2 << "S:0x0501 1004 RW" << std::endl;
     ASSERT_TRUE(parser->parseFromStream(&configFile2, &aclMap));
-    ASSERT_EQ(2, aclMap.size());
+    ASSERT_EQ(2u, aclMap.size());
 
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
index 1ca5824..274a843 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -103,13 +103,13 @@
         return StatusCode::OK;
     }
 
-    StatusCode subscribe(int32_t property,
-                         int32_t areas,
-                         float sampleRate) override {
+    StatusCode subscribe(int32_t /* property */,
+                         int32_t /* areas */,
+                         float /* sampleRate */) override {
         return StatusCode::OK;
     }
 
-    StatusCode unsubscribe(int32_t property) override {
+    StatusCode unsubscribe(int32_t /* property */) override {
         return StatusCode::OK;
     }
 
@@ -323,20 +323,20 @@
     ASSERT_EQ(StatusCode::OK, actualStatusCode);
     ASSERT_EQ(toInt(VehicleProperty::VEHICLE_MAP_SERVICE), actualValue.prop);
 
-    ASSERT_EQ(3, actualValue.value.bytes.size());
+    ASSERT_EQ(3u, actualValue.value.bytes.size());
     ASSERT_EQ(1, actualValue.value.bytes[0]);
     ASSERT_EQ(2, actualValue.value.bytes[1]);
     ASSERT_EQ(3, actualValue.value.bytes[2]);
 
-    ASSERT_EQ(2, actualValue.value.int32Values.size());
+    ASSERT_EQ(2u, actualValue.value.int32Values.size());
     ASSERT_EQ(10, actualValue.value.int32Values[0]);
     ASSERT_EQ(20, actualValue.value.int32Values[1]);
 
-    ASSERT_EQ(2, actualValue.value.floatValues.size());
+    ASSERT_EQ(2u, actualValue.value.floatValues.size());
     ASSERT_FLOAT_EQ(1.1, actualValue.value.floatValues[0]);
     ASSERT_FLOAT_EQ(2.2, actualValue.value.floatValues[1]);
 
-    ASSERT_EQ(2, actualValue.value.int64Values.size());
+    ASSERT_EQ(2u, actualValue.value.int64Values.size());
     ASSERT_FLOAT_EQ(30, actualValue.value.int64Values[0]);
     ASSERT_FLOAT_EQ(40, actualValue.value.int64Values[1]);
 
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index a512fcf..8ba36d8 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -131,12 +131,12 @@
         mEventCond.notify_one();
         return Return<void>();
     }
-    Return<void> onPropertySet(const VehiclePropValue& value) override {
+    Return<void> onPropertySet(const VehiclePropValue& /* value */) override {
         return Return<void>();
     }
-    Return<void> onPropertySetError(StatusCode errorCode,
-                                    int32_t propId,
-                                    int32_t areaId) override {
+    Return<void> onPropertySetError(StatusCode /* errorCode */,
+                                    int32_t /* propId */,
+                                    int32_t /* areaId */) override {
         return Return<void>();
     }
 
diff --git a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
index 0d57284..7d37355 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
@@ -85,9 +85,9 @@
     // In this test we have T threads that concurrently in C cycles
     // obtain and release O VehiclePropValue objects of FLOAT / INT32 types.
 
-    const auto T = 2;
-    const auto C  = 500;
-    const auto O = 100;
+    const int T = 2;
+    const int C = 500;
+    const int O = 100;
 
     auto poolPtr = valuePool.get();
 
@@ -112,10 +112,10 @@
     }
     auto finish = elapsedRealtimeNano();
 
-    ASSERT_EQ(T * C * O, stats->Obtained);
-    ASSERT_EQ(T * C * O, stats->Recycled);
+    ASSERT_EQ(static_cast<uint32_t>(T * C * O), stats->Obtained);
+    ASSERT_EQ(static_cast<uint32_t>(T * C * O), stats->Recycled);
     // Created less than obtained.
-    ASSERT_GE(T * O, stats->Created);
+    ASSERT_GE(static_cast<uint32_t>(T * O), stats->Created);
 
     auto elapsedMs = (finish - start) / 1000000;
     ASSERT_GE(1000, elapsedMs);  // Less a second to access 100K objects.
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
index 3a252af..761e550 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
@@ -16,6 +16,7 @@
 
 #include "Obd2SensorStore.h"
 
+#include <utils/SystemClock.h>
 #include <vehicle_hal_manager/VehicleUtils.h>
 
 namespace android {
@@ -98,6 +99,16 @@
     return mSensorsBitmask.getBitmask();
 }
 
+void Obd2SensorStore::fillPropValue(VehiclePropValue *propValue,
+                                    std::string dtc) const {
+    propValue->timestamp = elapsedRealtimeNano();
+    propValue->value.int32Values = getIntegerSensors();
+    propValue->value.floatValues = getFloatSensors();
+    propValue->value.bytes = getSensorsBitmask();
+    propValue->value.stringValue = dtc;
+}
+
+
 
 }  // namespace V2_0
 }  // namespace vehicle
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
index cbe9893..3e2a08e 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
@@ -54,6 +54,10 @@
     // Returns a vector that contains a bitmask for all stored sensors.
     const std::vector<uint8_t>& getSensorsBitmask() const;
 
+    // Given a stringValue, fill in a VehiclePropValue
+    void fillPropValue(VehiclePropValue *propValue,
+            std::string dtc) const;
+
 private:
     class BitmaskInVector {
     public:
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp b/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
index a79c55c..ac1245a 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
@@ -129,7 +129,7 @@
     if (!check(&o->value)) {
         ALOGE("Discarding value for prop 0x%x because it contains "
                   "data that is not consistent with this pool. "
-                  "Expected type: %d, vector size: %d",
+                  "Expected type: %d, vector size: %zu",
               o->prop, mPropType, mVectorSize);
         delete o;
     } else {
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 05e10be..fa432f4 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -1829,6 +1829,10 @@
      *   configArray[1] : number of vendor-specific float-valued sensors
      *                    that can be returned in a frame.
      *
+     * A get of this property must take the following form:
+     *   int64Values[0]: timestamp of the freeze frame to retrieve.
+     *                   Valid timestamps are given by OBD2_DTC_INFO.
+     *
      * The values are to be interpreted as follows:
      * the indices defined in Obd2IntegerSensorIndex are to be used to
      * read from int32Values;
@@ -1860,8 +1864,49 @@
         | VehiclePropertyType:COMPLEX
         | VehicleArea:GLOBAL),
 
-};
+    /*
+     * OBD2 Freeze Frame Information
+     *
+     * This property describes the current freeze frames stored in vehicle
+     * memory and available for retrieval via OBD2_FREEZE_FRAME.
+     *
+     * The values are to be interpreted as follows:
+     * each element of int64Values is the timestamp at which a a fault code
+     * has been detected and the corresponding freeze frame stored, and each
+     * such element can be used as the key to OBD2_FREEZE_FRAME to retrieve
+     * the corresponding freeze frame.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ
+     */
+    OBD2_FREEZE_FRAME_INFO = (
+        0x0D02
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
 
+    /*
+     * OBD2 Freeze Frame Clear
+     *
+     * This property allows deletion of any of the freeze frames stored in
+     * vehicle memory, as described by OBD2_DTC_INFO.
+     *
+     * A set of this property is to be interpreted as follows:
+     * if int64Values contains no elements, then all DTCs stored will be cleared;
+     * if int64Values contains one or more elements, then DTCs at the timestamps
+     * stored in int64Values will be cleared, and the others not cleared, except
+     * the memory will be compacted so that all remaining DTCs are stored
+     * contiguously.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:WRITE
+     */
+    OBD2_FREEZE_FRAME_CLEAR = (
+        0x0D03
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
+};
 /*
  * Bit flags for fan direction
  */
diff --git a/biometrics/Android.bp b/biometrics/Android.bp
index eea4604..b4681e4 100644
--- a/biometrics/Android.bp
+++ b/biometrics/Android.bp
@@ -1,4 +1,5 @@
 // This is an autogenerated file, do not edit.
 subdirs = [
     "fingerprint/2.1",
+    "fingerprint/2.1/vts/functional"
 ]
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 7f0d005..b106481 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 652a3e0..5923c84 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/default/service.cpp b/biometrics/fingerprint/2.1/default/service.cpp
index 0563acb..d6b91c6 100644
--- a/biometrics/fingerprint/2.1/default/service.cpp
+++ b/biometrics/fingerprint/2.1/default/service.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/types.hal b/biometrics/fingerprint/2.1/types.hal
index f462906..e389773 100644
--- a/biometrics/fingerprint/2.1/types.hal
+++ b/biometrics/fingerprint/2.1/types.hal
@@ -49,6 +49,8 @@
  * followed by ERROR_CANCELED.
  */
 enum FingerprintError : int32_t {
+  /* Used for testing, no error returned */
+  ERROR_NO_ERROR = 0,
   /* The hardware has an error that can't be resolved. */
   ERROR_HW_UNAVAILABLE = 1,
   /* Bad data; operation can't continue */
diff --git a/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts b/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts
new file mode 100644
index 0000000..475333e
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts
@@ -0,0 +1,461 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "IBiometricsFingerprint"
+
+package: "android.hardware.biometrics.fingerprint"
+
+import: "android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback"
+import: "android.hardware.biometrics.fingerprint@2.1::types"
+import: "android.hidl.base@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "SYS_UNKNOWN"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "SYS_OK"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "SYS_ENOENT"
+            scalar_value: {
+                int32_t: -2
+            }
+            enumerator: "SYS_EINTR"
+            scalar_value: {
+                int32_t: -4
+            }
+            enumerator: "SYS_EIO"
+            scalar_value: {
+                int32_t: -5
+            }
+            enumerator: "SYS_EAGAIN"
+            scalar_value: {
+                int32_t: -11
+            }
+            enumerator: "SYS_ENOMEM"
+            scalar_value: {
+                int32_t: -12
+            }
+            enumerator: "SYS_EACCES"
+            scalar_value: {
+                int32_t: -13
+            }
+            enumerator: "SYS_EFAULT"
+            scalar_value: {
+                int32_t: -14
+            }
+            enumerator: "SYS_EBUSY"
+            scalar_value: {
+                int32_t: -16
+            }
+            enumerator: "SYS_EINVAL"
+            scalar_value: {
+                int32_t: -22
+            }
+            enumerator: "SYS_ENOSPC"
+            scalar_value: {
+                int32_t: -28
+            }
+            enumerator: "SYS_ETIMEDOUT"
+            scalar_value: {
+                int32_t: -110
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR_NO_ERROR"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ERROR_HW_UNAVAILABLE"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ERROR_UNABLE_TO_PROCESS"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ERROR_TIMEOUT"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ERROR_NO_SPACE"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ERROR_CANCELED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ERROR_UNABLE_TO_REMOVE"
+            scalar_value: {
+                int32_t: 6
+            }
+            enumerator: "ERROR_LOCKOUT"
+            scalar_value: {
+                int32_t: 7
+            }
+            enumerator: "ERROR_VENDOR"
+            scalar_value: {
+                int32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ACQUIRED_GOOD"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ACQUIRED_PARTIAL"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ACQUIRED_INSUFFICIENT"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ACQUIRED_IMAGER_DIRTY"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ACQUIRED_TOO_SLOW"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ACQUIRED_TOO_FAST"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ACQUIRED_VENDOR"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "gid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "fid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "samplesRemaining"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "msg"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "remainingTemplates"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "acquiredInfo"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "hat"
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR"
+            scalar_value: {
+                int32_t: -1
+            }
+            enumerator: "ACQUIRED"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "TEMPLATE_ENROLLING"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "TEMPLATE_REMOVED"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "AUTHENTICATED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "TEMPLATE_ENUMERATING"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hidl::base::V1_0::DebugInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "pid"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "ptr"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "setNotify"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback"
+        }
+        callflow: {
+            next: "setActiveGroup"
+        }
+        callflow: {
+            entry: true
+        }
+    }
+
+    api: {
+        name: "preEnroll"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            next: "enroll"
+            next: "postEnroll"
+        }
+    }
+
+    api: {
+        name: "enroll"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "cancel"
+            next: "enroll"
+            next: "postEnroll"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "postEnroll"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "authenticate"
+            next: "setActiveGroup"
+            next: "enumerate"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "getAuthenticatorId"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            next: "authenticate"
+        }
+    }
+
+    api: {
+        name: "cancel"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "authenticate"
+            next: "enroll"
+            next: "enumerate"
+            next: "remove"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "enumerate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "remove"
+            next: "enroll"
+            next: "authenticate"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "remove"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "enumerate"
+            next: "authenticate"
+            next: "cancel"
+            next: "getAuthenticatorId"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "setActiveGroup"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        callflow: {
+            next: "authenticate"
+            next: "preEnroll"
+            next: "enumerate"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "authenticate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "cancel"
+            next: "preEnroll"
+            next: "remove"
+        }
+    }
+
+}
diff --git a/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts b/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts
new file mode 100644
index 0000000..7cf4003
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts
@@ -0,0 +1,396 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "IBiometricsFingerprintClientCallback"
+
+package: "android.hardware.biometrics.fingerprint"
+
+import: "android.hardware.biometrics.fingerprint@2.1::types"
+import: "android.hidl.base@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "SYS_UNKNOWN"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "SYS_OK"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "SYS_ENOENT"
+            scalar_value: {
+                int32_t: -2
+            }
+            enumerator: "SYS_EINTR"
+            scalar_value: {
+                int32_t: -4
+            }
+            enumerator: "SYS_EIO"
+            scalar_value: {
+                int32_t: -5
+            }
+            enumerator: "SYS_EAGAIN"
+            scalar_value: {
+                int32_t: -11
+            }
+            enumerator: "SYS_ENOMEM"
+            scalar_value: {
+                int32_t: -12
+            }
+            enumerator: "SYS_EACCES"
+            scalar_value: {
+                int32_t: -13
+            }
+            enumerator: "SYS_EFAULT"
+            scalar_value: {
+                int32_t: -14
+            }
+            enumerator: "SYS_EBUSY"
+            scalar_value: {
+                int32_t: -16
+            }
+            enumerator: "SYS_EINVAL"
+            scalar_value: {
+                int32_t: -22
+            }
+            enumerator: "SYS_ENOSPC"
+            scalar_value: {
+                int32_t: -28
+            }
+            enumerator: "SYS_ETIMEDOUT"
+            scalar_value: {
+                int32_t: -110
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR_NO_ERROR"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ERROR_HW_UNAVAILABLE"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ERROR_UNABLE_TO_PROCESS"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ERROR_TIMEOUT"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ERROR_NO_SPACE"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ERROR_CANCELED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ERROR_UNABLE_TO_REMOVE"
+            scalar_value: {
+                int32_t: 6
+            }
+            enumerator: "ERROR_LOCKOUT"
+            scalar_value: {
+                int32_t: 7
+            }
+            enumerator: "ERROR_VENDOR"
+            scalar_value: {
+                int32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ACQUIRED_GOOD"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ACQUIRED_PARTIAL"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ACQUIRED_INSUFFICIENT"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ACQUIRED_IMAGER_DIRTY"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ACQUIRED_TOO_SLOW"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ACQUIRED_TOO_FAST"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ACQUIRED_VENDOR"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "gid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "fid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "samplesRemaining"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "msg"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "remainingTemplates"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "acquiredInfo"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "hat"
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR"
+            scalar_value: {
+                int32_t: -1
+            }
+            enumerator: "ACQUIRED"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "TEMPLATE_ENROLLING"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "TEMPLATE_REMOVED"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "AUTHENTICATED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "TEMPLATE_ENUMERATING"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hidl::base::V1_0::DebugInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "pid"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "ptr"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "onEnrollResult"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onAcquired"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "onAuthenticated"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onError"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "onRemoved"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onEnumerate"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+}
diff --git a/biometrics/fingerprint/2.1/vts/functional/Android.bp b/biometrics/fingerprint/2.1/vts/functional/Android.bp
new file mode 100644
index 0000000..7d2e83f
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/functional/Android.bp
@@ -0,0 +1,41 @@
+//
+// 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.
+//
+
+cc_test {
+    name: "fingerprint_hidl_hal_test",
+    gtest: true,
+    srcs: ["fingerprint_hidl_hal_test.cpp"],
+    shared_libs: [
+        "libbase",
+        "libhidltransport",
+        "libhardware",
+        "libhwbinder",
+        "libhidlbase",
+        "liblog",
+        "libutils",
+        "android.hardware.biometrics.fingerprint@2.1",
+    ],
+    static_libs: ["libgtest"],
+    cflags: [
+        "--coverage",
+        "-O0",
+        "-g",
+    ],
+    ldflags: [
+        "--coverage"
+    ]
+}
+
diff --git a/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp b/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp
new file mode 100644
index 0000000..9138000
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp
@@ -0,0 +1,158 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "fingerprint_hidl_hal_test"
+
+#include <android-base/logging.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h>
+#include <chrono>
+#include <gtest/gtest.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
+using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
+using android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo;
+using android::hardware::biometrics::fingerprint::V2_1::FingerprintError;
+using android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
+using android::hardware::hidl_vec;
+using android::hardware::Return;
+
+#define SERVICE_NAME "fingerprint_hal"
+
+class FingerprintHidlTest : public ::testing::Test,
+    public IBiometricsFingerprintClientCallback {
+
+protected:
+    android::sp<IBiometricsFingerprint> service;
+    FingerprintError err;
+    // State changes should occur within this threshold, otherwise the
+    // framework' will assume things have broken.
+    std::chrono::seconds threshold;
+
+public:
+    FingerprintHidlTest ():
+        err(FingerprintError::ERROR_NO_ERROR), threshold(1) {}
+
+    virtual void SetUp() override {
+        service = IBiometricsFingerprint::getService(SERVICE_NAME);
+
+        ASSERT_NE(service, nullptr);
+        clearErr();
+
+        // TODO: instantly fail any test that receives a death notification
+    }
+
+    virtual void TearDown() override {}
+
+    // implement methods of IBiometricsFingerprintClientCallback
+    virtual Return<void> onEnrollResult(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+    virtual Return<void> onAcquired(uint64_t, FingerprintAcquiredInfo, int32_t)
+            override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onAuthenticated(uint64_t, uint32_t, uint32_t, const
+            hidl_vec<uint8_t>&) override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onError(uint64_t, FingerprintError error, int32_t)
+            override {
+        err = error;
+        return Return<void>();
+    }
+
+    virtual Return<void> onRemoved(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onEnumerate(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+
+    void clearErr () {
+        err = FingerprintError::ERROR_NO_ERROR;
+    }
+};
+
+class FingerprintHidlEnvironment : public ::testing::Environment {
+public:
+    virtual void SetUp() {}
+    virtual void TearDown() {}
+};
+
+// The service should be reachable.
+TEST_F(FingerprintHidlTest, ConnectTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+}
+
+// Cancel should always return ERROR_CANCELED from any starting state including
+// the IDLE state.
+TEST_F(FingerprintHidlTest, CancelTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+
+    auto start = std::chrono::system_clock::now();
+    Return<RequestStatus> res = service->cancel();
+    auto end = std::chrono::system_clock::now();
+    auto diff = end - start;
+
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+    // check error should be ERROR_CANCELED
+    EXPECT_EQ(FingerprintError::ERROR_CANCELED, err);
+    // check that this did not take longer than a threshold
+    EXPECT_TRUE(diff <= threshold);
+}
+
+// A call to cancel should after any other method call should set the error
+// state to canceled.
+TEST_F(FingerprintHidlTest, AuthTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+
+    Return<RequestStatus> res = service->authenticate(0, 0);
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+
+    auto start = std::chrono::system_clock::now();
+    res = service->cancel();
+    auto end = std::chrono::system_clock::now();
+    auto diff = end - start;
+
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+    // check error should be ERROR_CANCELED
+    EXPECT_EQ(FingerprintError::ERROR_CANCELED, err);
+    // check that this did not take longer than a threshold
+    EXPECT_TRUE(diff <= threshold);
+}
+
+int main(int argc, char **argv) {
+    ::testing::AddGlobalTestEnvironment(new FingerprintHidlEnvironment);
+    ::testing::InitGoogleTest(&argc, argv);
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+    return status;
+}
diff --git a/biometrics/fingerprint/2.1/vts/types.vts b/biometrics/fingerprint/2.1/vts/types.vts
new file mode 100644
index 0000000..9f9fd37
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/types.vts
@@ -0,0 +1,262 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "types"
+
+package: "android.hardware.biometrics.fingerprint"
+
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SYS_UNKNOWN"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SYS_OK"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SYS_ENOENT"
+        scalar_value: {
+            int32_t: -2
+        }
+        enumerator: "SYS_EINTR"
+        scalar_value: {
+            int32_t: -4
+        }
+        enumerator: "SYS_EIO"
+        scalar_value: {
+            int32_t: -5
+        }
+        enumerator: "SYS_EAGAIN"
+        scalar_value: {
+            int32_t: -11
+        }
+        enumerator: "SYS_ENOMEM"
+        scalar_value: {
+            int32_t: -12
+        }
+        enumerator: "SYS_EACCES"
+        scalar_value: {
+            int32_t: -13
+        }
+        enumerator: "SYS_EFAULT"
+        scalar_value: {
+            int32_t: -14
+        }
+        enumerator: "SYS_EBUSY"
+        scalar_value: {
+            int32_t: -16
+        }
+        enumerator: "SYS_EINVAL"
+        scalar_value: {
+            int32_t: -22
+        }
+        enumerator: "SYS_ENOSPC"
+        scalar_value: {
+            int32_t: -28
+        }
+        enumerator: "SYS_ETIMEDOUT"
+        scalar_value: {
+            int32_t: -110
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ERROR_NO_ERROR"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ERROR_HW_UNAVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ERROR_UNABLE_TO_PROCESS"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ERROR_TIMEOUT"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ERROR_NO_SPACE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ERROR_CANCELED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ERROR_UNABLE_TO_REMOVE"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "ERROR_LOCKOUT"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "ERROR_VENDOR"
+        scalar_value: {
+            int32_t: 8
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ACQUIRED_GOOD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ACQUIRED_PARTIAL"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ACQUIRED_INSUFFICIENT"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ACQUIRED_IMAGER_DIRTY"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ACQUIRED_TOO_SLOW"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ACQUIRED_TOO_FAST"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ACQUIRED_VENDOR"
+        scalar_value: {
+            int32_t: 6
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "gid"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "fid"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "samplesRemaining"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "msg"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "remainingTemplates"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "acquiredInfo"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "hat"
+        type: TYPE_ARRAY
+        vector_size: 69
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ERROR"
+        scalar_value: {
+            int32_t: -1
+        }
+        enumerator: "ACQUIRED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "TEMPLATE_ENROLLING"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "TEMPLATE_REMOVED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "AUTHENTICATED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "TEMPLATE_ENUMERATING"
+        scalar_value: {
+            int32_t: 6
+        }
+    }
+}
+
diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp
index f1a66a8..5714f83 100644
--- a/camera/provider/2.4/default/CameraProvider.cpp
+++ b/camera/provider/2.4/default/CameraProvider.cpp
@@ -51,8 +51,7 @@
         const struct camera_module_callbacks* callbacks,
         int camera_id,
         int new_status) {
-    ALOGI("%s++", __FUNCTION__);
-    sp<CameraProvider> cp = const_cast<CameraProvider*>(
+    CameraProvider* cp = const_cast<CameraProvider*>(
             static_cast<const CameraProvider*>(callbacks));
 
     if (cp == nullptr) {
@@ -60,7 +59,7 @@
         return;
     }
 
-    ALOGI("%s resolved provider %p", __FUNCTION__, cp.get());
+    ALOGI("%s resolved provider %p", __FUNCTION__, cp);
 
     Mutex::Autolock _l(cp->mCbLock);
     char cameraId[kMaxCameraIdLen];
@@ -76,15 +75,13 @@
             }
         }
     }
-    ALOGI("%s--", __FUNCTION__);
 }
 
 void CameraProvider::sTorchModeStatusChange(
         const struct camera_module_callbacks* callbacks,
         const char* camera_id,
         int new_status) {
-    ALOGI("%s++", __FUNCTION__);
-    sp<CameraProvider> cp = const_cast<CameraProvider*>(
+    CameraProvider* cp = const_cast<CameraProvider*>(
             static_cast<const CameraProvider*>(callbacks));
 
     if (cp == nullptr) {
@@ -92,7 +89,7 @@
         return;
     }
 
-    ALOGI("%s resolved provider %p", __FUNCTION__, cp.get());
+    ALOGI("%s resolved provider %p", __FUNCTION__, cp);
 
     Mutex::Autolock _l(cp->mCbLock);
     if (cp->mCallbacks != nullptr) {
@@ -105,7 +102,6 @@
             }
         }
     }
-    ALOGI("%s--", __FUNCTION__);
 }
 
 Status CameraProvider::getHidlStatus(int status) {
@@ -234,8 +230,10 @@
 
     // Setup vendor tags here so HAL can setup vendor keys in camera characteristics
     VendorTagDescriptor::clearGlobalVendorTagDescriptor();
-    bool setupSucceed = setUpVendorTags();
-    return !setupSucceed; // return flag here is mInitFailed
+    if (!setUpVendorTags()) {
+        ALOGE("%s: Vendor tag setup failed, will not be available.", __FUNCTION__);
+    }
+    return false; // mInitFailed
 }
 
 bool CameraProvider::setUpVendorTags() {
@@ -245,7 +243,7 @@
     // Check if vendor operations have been implemented
     if (!mModule->isVendorTagDefined()) {
         ALOGI("%s: No vendor tags defined for this device.", __FUNCTION__);
-        return false;
+        return true;
     }
 
     mModule->getVendorTagOps(&vOps);
diff --git a/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc b/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
index fc21d59..9548d41 100644
--- a/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
+++ b/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
@@ -2,4 +2,5 @@
     class hal
     user system
     group graphics drmrpc readproc
+    capabilities SYS_NICE
     onrestart restart surfaceflinger
diff --git a/graphics/composer/2.1/default/service.cpp b/graphics/composer/2.1/default/service.cpp
index a31decd..656673e 100644
--- a/graphics/composer/2.1/default/service.cpp
+++ b/graphics/composer/2.1/default/service.cpp
@@ -16,6 +16,8 @@
 
 #define LOG_TAG "android.hardware.graphics.composer@2.1-service"
 
+#include <sched.h>
+
 #include <android/hardware/graphics/composer/2.1/IComposer.h>
 
 #include <binder/ProcessState.h>
@@ -29,5 +31,13 @@
     android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
     android::ProcessState::self()->startThreadPool();
 
+    // same as SF main thread
+    struct sched_param param = {0};
+    param.sched_priority = 2;
+    if (sched_setscheduler(0, SCHED_FIFO | SCHED_RESET_ON_FORK,
+                &param) != 0) {
+        ALOGE("Couldn't set SCHED_FIFO: %d", errno);
+    }
+
     return defaultPassthroughServiceImplementation<IComposer>("hwcomposer");
 }
diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal
index 450fba0..d1d4ca5 100644
--- a/wifi/1.0/IWifiNanIface.hal
+++ b/wifi/1.0/IWifiNanIface.hal
@@ -21,6 +21,9 @@
 
 /**
  * Interface used to represent a single NAN(Neighbour Aware Network) iface.
+ *
+ * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
+ * Networking (NAN) Technical Specification".
  */
 interface IWifiNanIface extends IWifiIface {
   /**
@@ -39,7 +42,8 @@
       generates (WifiStatus status);
 
   /**
-   * Get NAN capabilities.
+   * Get NAN capabilities. Asynchronous response is with
+   * |IWifiNanIfaceEventCallback.notifyCapabilitiesResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @return status WifiStatus of the operation.
@@ -53,8 +57,9 @@
   /**
    * Enable NAN: configures and activates NAN clustering (does not start
    * a discovery session or set up data-interfaces or data-paths). Use the
-   * |configureRequest| method to change the configuration of an already enabled
+   * |IWifiNanIface.configureRequest| method to change the configuration of an already enabled
    * NAN interface.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyEnableResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanEnableRequest|.
@@ -70,7 +75,8 @@
 
   /**
    * Configure NAN: configures an existing NAN functionality (i.e. assumes
-   * |enableRequest| already submitted and succeeded).
+   * |IWifiNanIface.enableRequest| already submitted and succeeded).
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyConfigResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanConfigRequest|.
@@ -86,6 +92,7 @@
 
   /**
    * Disable NAN functionality.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDisableResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @return status WifiStatus of the operation.
@@ -98,6 +105,7 @@
 
   /**
    * Publish request to start advertising a discovery service.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartPublishResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanPublishRequest|.
@@ -113,6 +121,7 @@
 
   /**
    * Stop publishing a discovery service.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopPublishResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param sessionId ID of the publish discovery session to be stopped.
@@ -127,6 +136,7 @@
 
   /**
    * Subscribe request to start searching for a discovery service.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanSubscribeRequest|.
@@ -142,6 +152,7 @@
 
   /**
    * Stop subscribing to a discovery service.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopSubscribeResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param sessionId ID of the subscribe discovery session to be stopped.
@@ -156,6 +167,7 @@
 
   /**
    * NAN transmit follow up message request.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanTransmitFollowupRequest|.
@@ -171,6 +183,7 @@
 
   /**
    * Create a NAN Data Interface.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyCreateDataInterfaceResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @return status WifiStatus of the operation.
@@ -184,6 +197,7 @@
 
   /**
    * Delete a NAN Data Interface.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDeleteDataInterfaceResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @return status WifiStatus of the operation.
@@ -197,6 +211,7 @@
 
   /**
    * Initiate a data-path (NDP) setup operation: Initiator.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiateDataPathResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanInitiateDataPathRequest|.
@@ -213,6 +228,8 @@
   /**
    * Respond to a received data indication as part of a data-path (NDP) setup operation. An
    * indication is received by the Responder from the Initiator.
+   * Asynchronous response is with
+   * |IWifiNanIfaceEventCallback.notifyRespondToDataPathIndicationResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
@@ -229,6 +246,7 @@
 
   /**
    * Data-path (NDP) termination request: executed by either Initiator or Responder.
+   * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminateDataPathResponse|.
    *
    * @param cmdId command Id to use for this invocation.
    * @param ndpInstanceId Data-path instance ID to be terminated.
diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal
index c9fea8f..80d67ce 100644
--- a/wifi/1.0/IWifiNanIfaceEventCallback.hal
+++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal
@@ -18,10 +18,19 @@
 
 /**
  * NAN Response and Asynchronous Event Callbacks.
+ *
+ * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
+ * Networking (NAN) Technical Specification".
  */
 interface IWifiNanIfaceEventCallback {
   /**
-   * Callback invoked in response to a capability request |getCapabilitiesRequest|.
+   * Notify callbacks are asynchronous callbacks - but in response to |IWifiNanIface| method calls.
+   * Each method will receive a notify callback to return results (on success) or failure status.
+   */
+
+  /**
+   * Asynchronous callback invoked in response to a capability request
+   * |IWifiNanIface.getCapabilitiesRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -32,7 +41,7 @@
                                     NanCapabilities capabilities);
 
   /**
-   * Callback invoked in response to an enable request |enableRequest|.
+   * Asynchronous callback invoked in response to an enable request |IWifiNanIface.enableRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -46,7 +55,7 @@
   oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a config request |configRequest|.
+   * Asynchronous callback invoked in response to a config request |IWifiNanIface.configRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -58,7 +67,7 @@
   oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a disable request |disableRequest|.
+   * Asynchronous callback invoked in response to a disable request |IWifiNanIface.disableRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -68,7 +77,8 @@
   oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked to notify the status of the start publish request |startPublishRequest|.
+   * Asynchronous callback invoked to notify the status of the start publish request
+   * |IWifiNanIface.startPublishRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -82,7 +92,8 @@
   oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
 
   /**
-   * Callback invoked in response to a stop publish request |stopPublishRequest|.
+   * Asynchronous callback invoked in response to a stop publish request
+   * |IWifiNanIface.stopPublishRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -93,7 +104,8 @@
   oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
+   * Asynchronous callback invoked to notify the status of the start subscribe request
+   * |IWifiNanIface.startSubscribeRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -107,7 +119,8 @@
   oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
 
   /**
-   * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
+   * Asynchronous callback invoked in response to a stop subscribe request
+   * |IWifiNanIface.stopSubscribeRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -118,7 +131,8 @@
   oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
+   * Asynchronous callback invoked in response to a transmit followup request
+   * |IWifiNanIface.transmitFollowupRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -131,7 +145,8 @@
   oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
+   * Asynchronous callback invoked in response to a create data interface request
+   * |IWifiNanIface.createDataInterfaceRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -142,7 +157,8 @@
   oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
+   * Asynchronous callback invoked in response to a delete data interface request
+   * |IWifiNanIface.deleteDataInterfaceRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -153,7 +169,8 @@
   oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
+   * Asynchronous callback invoked in response to an initiate data path request
+   * |IWifiNanIface.initiateDataPathRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -168,8 +185,8 @@
         uint32_t ndpInstanceId );
 
   /**
-   * Callback invoked in response to a respond to data path indication request
-   * |respondToDataPathIndicationRequest|.
+   * Asynchronous callback invoked in response to a respond to data path indication request
+   * |IWifiNanIface.respondToDataPathIndicationRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
@@ -182,7 +199,8 @@
   oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
+   * Asynchronous callback invoked in response to a terminate data path request
+   * |IWifiNanIface.terminateDataPathRequest|.
    *
    * @param cmdId command Id corresponding to the original request.
    * @param status WifiNanStatus of the operation. Possible status codes are:
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 691f913..28ad6c3 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -780,12 +780,13 @@
   legacy_request->discovery_indication_cfg |=
         hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
-  if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
-    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfServiceIdsInBeacon > 127";
+  if (hidl_request.configParams.numberOfPublishServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
     return false;
   }
-  legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
-        | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
+  legacy_request->sid_beacon_val =
+        (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
+            | (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1);
   legacy_request->config_rssi_window_size = 1;
   legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
   legacy_request->config_disc_mac_addr_randomization = 1;
@@ -809,7 +810,7 @@
   legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.configParams.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
   legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
         hidl_request.configParams.bandSpecificConfig[
@@ -832,7 +833,7 @@
   legacy_request->config_5g_rssi_close_proximity = 1;
   legacy_request->rssi_close_proximity_5g_val =
         hidl_request.configParams.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -850,8 +851,8 @@
   legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
         .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
   if (hidl_request.debugConfigs.validClusterIdVals) {
-    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
-    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
+    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdBottomRangeVal;
+    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdTopRangeVal;
   } else { // need 'else' since not configurable in legacy HAL
     legacy_request->cluster_low = 0x0000;
     legacy_request->cluster_high = 0xFFFF;
@@ -916,6 +917,7 @@
   memcpy(legacy_request->service_specific_info,
         hidl_request.baseConfigs.serviceSpecificInfo.data(),
         legacy_request->service_specific_info_len);
+  // TODO: b/35193423 add support for extended service specific info
   legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
   if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
     LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: rx_match_filter_len too large";
@@ -994,6 +996,7 @@
   memcpy(legacy_request->service_specific_info,
         hidl_request.baseConfigs.serviceSpecificInfo.data(),
         legacy_request->service_specific_info_len);
+  // TODO: b/35193423 add support for extended service specific info
   legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
   if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
     LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: rx_match_filter_len too large";
@@ -1072,14 +1075,15 @@
         legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
   legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
         legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
-  legacy_request->service_specific_info_len = hidl_request.message.size();
+  legacy_request->service_specific_info_len = hidl_request.serviceSpecificInfo.size();
   if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
     LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: service_specific_info_len too large";
     return false;
   }
   memcpy(legacy_request->service_specific_info,
-        hidl_request.message.data(),
+        hidl_request.serviceSpecificInfo.data(),
         legacy_request->service_specific_info_len);
+  // TODO: b/35193423 add support for extended service specific info
   legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;
 
   return true;
@@ -1104,12 +1108,12 @@
   legacy_request->discovery_indication_cfg |=
         hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
-  if (hidl_request.numberOfServiceIdsInBeacon > 127) {
-    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfServiceIdsInBeacon > 127";
+  if (hidl_request.numberOfPublishServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
     return false;
   }
-  legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
-        | (hidl_request.numberOfServiceIdsInBeacon << 1);
+  legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
+        | (hidl_request.numberOfPublishServiceIdsInBeacon << 1);
   legacy_request->config_rssi_window_size = 1;
   legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
   legacy_request->config_disc_mac_addr_randomization = 1;
@@ -1130,7 +1134,7 @@
   legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
   */
   legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
@@ -1156,7 +1160,7 @@
   legacy_request->config_5g_rssi_close_proximity = 1;
   legacy_request->rssi_close_proximity_5g_val =
         hidl_request.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -1271,6 +1275,7 @@
   hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len;
   hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len;
   hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len;
+  // TODO: b/35193423 add support for extended service specific info
   hidl_response->maxVsaDataLen = legacy_response.max_vsa_data_len;
   hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces;
   hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions;
@@ -1295,6 +1300,7 @@
   hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
   hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
         legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
+  // TODO: b/35193423 add support for extended service specific info
   hidl_ind->matchFilter = std::vector<uint8_t>(legacy_ind.sdf_match_filter,
         legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len);
   hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1;
@@ -1322,7 +1328,7 @@
   hidl_ind->peerId = legacy_ind.requestor_instance_id;
   hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
   hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
-  hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
+  hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
         legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
 
   return true;
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index c4bdc23..dd09820 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -211,7 +211,7 @@
 
 /**
  * STA specific types.
- * TODO(b/32159498): Move to a separate nan_types.hal.
+ * TODO(b/32159498): Move to a separate sta_types.hal.
  */
 /**
  * Parameters to specify the APF capabilities of this iface.
@@ -562,6 +562,9 @@
 /**
  * NAN specific types.
  * TODO(b/32159498): Move to a separate nan_types.hal.
+ *
+ * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
+ * Networking (NAN) Technical Specification".
  */
 
 /**
@@ -624,55 +627,59 @@
 };
 
 /**
- * NAN Match indication type.
+ * NAN Match indication type: control how often to trigger |IWifiNanIfaceEventCallback.eventMatch|
+ * for a single discovery session - i.e. continuously discovering the same publisher with no new
+ * data.
  */
 enum NanMatchAlg : uint32_t {
-  MATCH_ONCE = 0,
-  MATCH_CONTINUOUS,
-  MATCH_NEVER,
+  MATCH_ONCE = 0,   // Only trigger |IWifiNanIfaceEventCallback.eventMatch| once
+  MATCH_CONTINUOUS, // Trigger |IWifiNanIfaceEventCallback.eventMatch| every time
+  MATCH_NEVER,      // Never trigger |IWifiNanIfaceEventCallback.eventMatch|
 };
 
 /**
  * NAN publish discovery session types.
  */
 enum NanPublishType : uint32_t {
-  UNSOLICITED = 0,
-  SOLICITED,
-  UNSOLICITED_SOLICITED,
+  UNSOLICITED = 0,       // Publish session broadcasts discovery packets
+  SOLICITED,             // Publish session silent, responds to active subscribes queries
+  UNSOLICITED_SOLICITED, // Both
 };
 
 /**
  * NAN transmit type used in |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
- * publish discovery sessions.
+ * publish discovery sessions. Describes the addressing of the packet responding to an ACTIVE
+ * subscribe query.
  */
 enum NanTxType : uint32_t {
-  BROADCAST = 0,
-  UNICAST,
+  BROADCAST = 0, // Respond with a broadcast packet
+  UNICAST,       // Respond with a unicast packet
 };
 
 /**
- * NAN subscribe discovery session ypes.
+ * NAN subscribe discovery session types.
  */
 enum NanSubscribeType : uint32_t {
-  PASSIVE = 0,
-  ACTIVE,
+  PASSIVE = 0, // Subscribe session scans for |NanPublishType.UNSOLICITED| publish sessions.
+  ACTIVE,      // Subscribe session probes for |NanPublishType.SOLICITED| publish sessions.
 };
 
 /**
  * NAN Service Response Filter Attribute Bit.
  */
 enum NanSrfType : uint32_t {
-  BLOOM_FILTER = 0,
-  PARTIAL_MAC_ADDR,
+  BLOOM_FILTER = 0, // Use a Bloom filter.
+  PARTIAL_MAC_ADDR, // Use a list of MAC addresses.
 };
 
 /**
- * NAN DP channel config options.
+ * NAN DP (data-path) channel config options.
  */
 enum NanDataPathChannelCfg : uint32_t {
-  CHANNEL_NOT_REQUESTED = 0,
-  REQUEST_CHANNEL_SETUP,
-  FORCE_CHANNEL_SETUP,
+  CHANNEL_NOT_REQUESTED = 0, // No channel request is specified.
+  REQUEST_CHANNEL_SETUP,     // Channel request is specified - but may be overridden by firmware.
+  FORCE_CHANNEL_SETUP,       // Channel request is specified and must be respected. If the firmware
+                             // cannot honor the request then the data-path request is rejected.
 };
 
 /**
@@ -680,86 +687,100 @@
  */
 struct NanBandSpecificConfig {
   /**
-   * RSSI values controlling clustering behavior per spec.
+   * RSSI values controlling clustering behavior per spec. RSSI values are specified without a sign,
+   * e.g. a value of -65dBm would be specified as 65.
    */
-  uint8_t rssiClose;
-  uint8_t rssiMiddle;
+  uint8_t rssiClose;  // NAN Spec: RSSI_close
+  uint8_t rssiMiddle; // NAN Spec: RSSI_middle
   /**
-   * RSSI value determining whether discovery is near (used if enabled in discovery).
+   * RSSI value determining whether discovery is near (used if enabled in discovery by
+   * |NanDiscoveryCommonConfig.useRssiThreshold|).
+   * RSSI values are specified without a sign, e.g. a value of -65dBm would be specified as 65.
+   * NAN Spec: RSSI_close_proximity
    */
-  uint8_t rssiProximity;
+  uint8_t rssiCloseProximity;
   /**
-   * Dwell time of each discovery channel in milliseconds.
-   * If time set to 0 then the FW default time must be used.
+   * Dwell time of each discovery channel in milliseconds. If set to 0 then the firmware determines
+   * the dwell time to use.
    */
   uint8_t dwellTimeMs;
   /**
-   * Scan period of each discovery channel in seconds.
-   * If time set to 0 then the FW default time must be used.
+   * Scan period of each discovery channel in seconds. If set to 0 then the firmware determines
+   * the scan period to use.
    */
   uint16_t scanPeriodSec;
    /**
-    * Specifies the interval for Sync beacons and SDF's.
+    * Specifies the discovery window interval for Sync beacons and SDF's.
     * Valid values of DW Interval are: 1, 2, 3, 4 and 5 corresponding to 1, 2, 4, 8, and 16 DWs.
     * Value of 0:
     *  - reserved in 2.4GHz band
     *  - no wakeup at all in 5GHz band
     * The publish/subscribe period values don't override the device level configurations if
-    * specified (if 'valid' is true).
+    * specified.
+    * Configuration is only used only if |validDiscoveryWindowIntervalVal| is set to true.
+    * NAN Spec: Device Capability Attribute / 2.4 GHz DW, Device Capability Attribute / 5 GHz DW
     */
   bool validDiscoveryWindowIntervalVal;
   uint8_t discoveryWindowIntervalVal;
 };
 
 /**
- * Configuration parameters
+ * Debug configuration parameters. Many of these allow non-standard-compliant operation and are
+ * not intended for normal operational mode.
  */
 struct NanDebugConfig {
   /**
-   * The low and high values of the cluster ID: standard values are 0x0000 - 0xFFFF.
-   * A clusterLow == clusterHigh indicates a request to join or create a cluster with that ID.
-   * Used if 'valid' is true.
+   * Specification of the lower 2 bytes of the cluster ID. The cluster ID is 50-60-9a-01-00-00 to
+   * 50-60-9a-01-FF-FF. Configuration of the bottom and top values of the range (which defaults to
+   * 0x0000 and 0xFFFF respectively).
+   * Configuration is only used if |validClusterIdVals| is set to true.
    */
   bool validClusterIdVals;
-  uint16_t clusterIdLowVal;
-  uint16_t clusterIdHighVal;
+  uint16_t clusterIdBottomRangeVal;
+  uint16_t clusterIdTopRangeVal;
   /**
-   * NAN management interface address, If specified ('valid' is true) then overrides any other
-   * configuration (specifically the default randomization).
+   * NAN management interface address, if specified (|validIntfAddrVal| is true) then overrides any
+   * other configuration (specifically the default randomization configured by
+   * |NanConfigRequest.macAddressRandomizationIntervalSec|).
    */
   bool validIntfAddrVal;
   MacAddress intfAddrVal;
   /**
-   * The 24 bit Organizationally Unique ID + the 8 bit Network Id. Used if 'valid' is true.
+   * Combination of the 24 bit Organizationally Unique ID (OUI) and the 8 bit OUI Type.
+   * Used if |validOuiVal| is set to true.
    */
   bool validOuiVal;
   uint32_t ouiVal;
   /**
-   * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons
-   * if the 'valid' flag is true.
+   * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons.
+   * Used if |validRandomFactorForceVal| is set to true.
+   * NAN Spec: Master Indication Attribute / Random Factor
    */
   bool validRandomFactorForceVal;
   uint8_t randomFactorForceVal;
   /**
    * Forces the hop-count for all transmitted Sync and Discovery Beacons NO matter the real
-   * hop-count being received over the air. Used if the 'valid' flag is true.
+   * hop-count being received over the air. Used if the |validHopCountForceVal}| flag is set to
+   * true.
+   * NAN Spec: Cluster Attribute / Anchor Master Information / Hop Count to Anchor Master
    */
   bool validHopCountForceVal;
   uint8_t hopCountForceVal;
   /**
    * Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
+   * Used if the |validDiscoveryChannelVal| is set to true.
    */
   bool validDiscoveryChannelVal;
   WifiChannelInMhz[2] discoveryChannelMhzVal;
   /**
    * Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
-   * |NanBandIndex|.
+   * |NanBandIndex|. Used if the |validUseBeaconsInBandVal| is set to true.
    */
   bool validUseBeaconsInBandVal;
   bool[2] useBeaconsInBandVal;
   /**
-   * Specified whether SDF (service discovery frames) are transmitted in the specified band. Indexed
-   * by |NanBandIndex|.
+   * Specifies whether SDF (service discovery frames) are transmitted in the specified band. Indexed
+   * by |NanBandIndex|. Used if the |validUseSdfInBandVal| is set to true.
    */
   bool validUseSdfInBandVal;
   bool[2] useSdfInBandVal;
@@ -771,34 +792,36 @@
 struct NanConfigRequest {
   /**
    * Master preference of this device.
+   * NAN Spec: Master Indication Attribute / Master Preference
    */
   uint8_t masterPref;
   /**
    * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
-   * for DISCOVERY_MAC_ADDRESS_CHANGED.
+   * for |NanClusterEventType.DISCOVERY_MAC_ADDRESS_CHANGED|.
    */
   bool disableDiscoveryAddressChangeIndication;
   /**
    * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
-   * for STARTED_CLUSTER.
+   * for |NanClusterEventType.STARTED_CLUSTER|.
    */
   bool disableStartedClusterIndication;
   /**
    * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
-   * for JOINED_CLUSTER.
+   * for |NanClusterEventType.JOINED_CLUSTER|.
    */
   bool disableJoinedClusterIndication;
   /**
-   * Control whether service IDs are included in Sync/Discovery beacons.
+   * Control whether publish service IDs are included in Sync/Discovery beacons.
+   * NAN Spec: Service ID List Attribute
    */
-  bool includeServiceIdsInBeacon;
+  bool includePublishServiceIdsInBeacon;
   /**
-   * If |includeServiceIdInBeacon| is true then specifies the number of service IDs to include
-   * in the Sync/Discovery beacons:
+   * If |includePublishServiceIdsInBeacon| is true then specifies the number of publish service IDs
+   * to include in the Sync/Discovery beacons:
    *  Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
    *  Value must fit within 7 bits - i.e. <= 127.
    */
-  uint8_t numberOfServiceIdsInBeacon;
+  uint8_t numberOfPublishServiceIdsInBeacon;
   /**
    * Number of samples used to calculate RSSI.
    */
@@ -820,7 +843,7 @@
 };
 
 /**
- * Enable requests for NAN: start-up configuration.
+ * Enable requests for NAN: start-up configuration |IWifiNanIface.enableRequest|.
  */
 struct NanEnableRequest {
   /**
@@ -833,30 +856,31 @@
   uint8_t hopCountMax;
   /**
    * Configurations of NAN cluster operation. Can also be modified at run-time using
-   * |configRequest|.
+   * |IWifiNanIface.configRequest|.
    */
   NanConfigRequest configParams;
   /**
-   * Non-standard configurations of NAN cluster operation - useful for debugging opeations.
+   * Non-standard configurations of NAN cluster operation - useful for debugging operations.
    */
   NanDebugConfig debugConfigs;
 };
 
 /**
- * Cipher suite flags - to be used as a bitmask.
+ * Cipher suite flags.
  */
 enum NanCipherSuiteType : uint32_t {
-  SHARED_KEY_128_MASK = 1 << 0,
-  SHARED_KEY_256_MASK = 1 << 1
+  SHARED_KEY_128_MASK = 1 << 0, // NCS-SK-128
+  SHARED_KEY_256_MASK = 1 << 1  // NCS-SK-256
 };
 
 /**
- * Ranging in the context of discovery sessions indication controls - to be used as a bitmask.
+ * Ranging in the context of discovery sessions indication controls. Controls the frequency of
+ * ranging-driven |IWifiNanIfaceEventCallback.eventMatch|.
  */
 enum NanRangingIndication : uint32_t {
-  CONTINUOUS_INDICATION_MASK = 1 << 0,
-  INGRESS_MET_MASK = 1 << 1,
-  EGRESS_MET_MASK = 1 << 2
+  CONTINUOUS_INDICATION_MASK = 1 << 0, // trigger event on every RTT measurement
+  INGRESS_MET_MASK = 1 << 1,           // trigger event only when ingress conditions met
+  EGRESS_MET_MASK = 1 << 2             // trigger event only when egress conditions met
 };
 
 /**
@@ -865,58 +889,82 @@
 struct NanDiscoveryCommonConfig {
   /**
    * The ID of the discovery session being configured. A value of 0 specifies a request to create
-   * a new discovery session.
+   * a new discovery session. The new discovery session ID is returned with
+   * |IWifiNanIfaceEventCallback.notifyStartPublishResponse| or
+   * |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
    */
   uint8_t sessionId;
   /**
    * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
-   * canceled.
+   * canceled using |IWifiIface.stopPublishRequest| or |IWifiIface.stopSubscribeRequest|.
    */
   uint16_t ttlSec;
   /**
    * Indicates the interval between two Discovery Windows in which the device supporting the
-   * service is awake to transmit or receive the Service Discovery frames.
-   * Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1.
+   * service is awake to transmit or receive the Service Discovery frames. Valid values of Awake
+   * DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1. Overrides any
+   * |NanBandSpecificConfig.discoveryWindowIntervalVal| configurations.
    */
   uint16_t discoveryWindowPeriod;
   /**
-   * Number of other-air-air operations (i.e. active transmissions), 0 means forever or until
-   * canceled.
+   * The lifetime of the discovery session in number of transmitted SDF discovery packets. A value
+   * of 0 means forever or until canceled using |IWifiIface.stopPublishRequest| or
+   * |IWifiIface.stopSubscribeRequest|.
    */
   uint8_t discoveryCount;
   /**
    * UTF-8 encoded string identifying the service.
    * Max length: |NanCapabilities.maxServiceNameLen|.
+   * NAN Spec: The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
+   * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8
+   * characters are acceptable in a Service Name.
    */
   vec<uint8_t> serviceName;
   /**
-   * Specifies the matching indication to host: once, continuous, or never.
+   * Specifies how often to trigger |IWifiNanIfaceEventCallback.eventMatch| when continuously
+   * discovering the same discovery session (with no changes).
    */
   NanMatchAlg discoveryMatchIndicator;
   /**
-   * Arbitrary information communicated as part of discovery.
+   * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
+   * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
    * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
    */
   vec<uint8_t> serviceSpecificInfo;
   /**
-   * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
-   * criteria (beyond the service name).
+   * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
+   * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
+   * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
+   * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
+   */
+  vec<uint8_t> extendedServiceSpecificInfo;
+  /**
+   * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
+   * bytes in the |value| field) which specify further match criteria (beyond the service name).
+   * The match behavior is specified in details in the NAN spec.
    * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
    * Subscriber: used in ACTIVE or PASSIVE sessions.
    * Max length: |NanCapabilities.maxMatchFilterLen|.
+   * NAN Spec: matching_filter_rx
    */
   vec<uint8_t> rxMatchFilter;
   /**
-   * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
-   * criteria (beyond the service name).
+   * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
+   * bytes in the |value| field) which specify further match criteria (beyond the service name).
+   * The match behavior is specified in details in the NAN spec.
    * Publisher: used if provided.
-   * Subscriber: used in ACTIVE sessions.
+   * Subscriber: used (if provided) only in ACTIVE sessions.
    * Max length: |NanCapabilities.maxMatchFilterLen|.
+   * NAN Spec: matching_filter_tx and Service Descriptor Attribute (SDA) / Matching Filter
    */
   vec<uint8_t> txMatchFilter;
   /**
-   * Specifies whether or not the discovery session uses the |rssiProximity| value (configured
-   * in enable/configure requests) to filter out matched discovered peers.
+   * Specifies whether or not the discovery session uses the
+   * |NanBandSpecificConfig.rssiCloseProximity| value (configured in enable/configure requests) to
+   * filter out matched discovered peers.
+   * NAN Spec: Service Descriptor Attribute / Service Control / Discovery Range Limited.
    */
   bool useRssiThreshold;
   /**
@@ -935,45 +983,49 @@
    */
   bool disableFollowupReceivedIndication;
   /**
-   * Cipher types supported in data-paths constructed in the context of this discovery session. The
-   * |NanCipherSuiteType| bit fields are used to set this value.
+   * Cipher types supported in data-paths constructed in the context of this discovery session.
    */
   bitfield<NanCipherSuiteType> supportedCipherTypes;
   /**
-   * Optional PMK for data-paths constructed in the context of this discovery session. A PMK could
-   * also be provided during the actual construction of the data-path (which allows unique PMKs for
-   * each data-path).
+   * 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).
    * 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;
   /**
    * Specifies whether or not there is a ranging requirement in this discovery session.
    * Note that ranging is only performed if all other match criteria with the peer are met.
+   * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
    */
   bool rangingRequired;
    /**
-    * Interval in msec between two ranging measurements.
-    * If the Awake DW interval in Enable/Config is larger than the ranging interval - priority is
-    * given to Awake DW interval.
+    * Interval in msec between two ranging measurements. Only relevant if |rangingRequired| is true.
+    * If the Awake DW interval specified either in |discoveryWindowPeriod| or in
+    * |NanBandSpecificConfig.discoveryWindowIntervalVal| is larger than the ranging interval then
+    * priority is given to Awake DW interval.
     */
   uint32_t rangingIntervalMsec;
   /**
-   * The type of ranging indication feedback to be provided by discovery session matches. Use
-   * bit-fields from |NanRangingIndication|.
+   * The type of ranging feedback to be provided by discovery session matches
+   * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true.
    */
    bitfield<NanRangingIndication> configRangingIndications;
    /**
-    * The ingress and egress distance in cm. If ranging is eanbled (|rangingEnabled| is true) then
-    * \configRangingIndications\ is used to determine whether ingress and/or egress (or neither)
+    * The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then
+    * |configRangingIndications| is used to determine whether ingress and/or egress (or neither)
     * are used to determine whether a match has occurred.
+    * NAN Spec: Service Discovery Extension Attribute (SDEA) / Ingress & Egress Range Limit
     */
-   uint32_t distanceIngressCm;
-   uint32_t distanceEgressCm;
+   uint16_t distanceIngressCm;
+   uint16_t distanceEgressCm;
 };
 
 /**
@@ -1009,27 +1061,35 @@
    */
   NanSubscribeType subscribeType;
   /**
-   * For Active subscribe discovery sessions specify how the Service Response Filter (SRF)
-   * attribute is populated.
+   * For |NanSubscribeType.ACTIVE| subscribe discovery sessions specify how the Service Response
+   * Filter (SRF) attribute is populated. Relevant only if |shouldUseSrf| is set to true.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / SRF Control / SRF Type
    */
   NanSrfType srfType;
   /**
-   * Configure the requested response of the Service Response Filter (SRF).
+   * Configure whether inclusion of an address in |intfAddr| indicates that those devices should
+   * respond or the reverse. Relevant only if |shouldUseSrf| is set to true and |srfType| is set to
+   * |NanSrfType.PARTIAL_MAC_ADDR|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / SRF Control / Include
    */
   bool srfRespondIfInAddressSet;
   /**
-   * Control whether the Service Response Filter (SRF) is transmitted OTA.
+   * Control whether the Service Response Filter (SRF) is used.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Control /
+   *           Service Response Filter Present
    */
   bool shouldUseSrf;
   /**
-   * Control whether the Service Specific Info (SSI) is needed in the Publish message to trigger
-   * service discovery (a match).
+   * Control whether the presence of |NanDiscoveryCommonConfig.serviceSpecificInfo| data is needed
+   * in the publisher in order to trigger service discovery, i.e. a
+   * |IWifiNanIfaceEventCallback.eventMatch|. The test is for presence of data - not for the
+   * specific contents of the data.
    */
   bool isSsiRequiredForMatch;
   /**
-   * NAN Interface Address, conforming to the format as described in
-   * 8.2.4.3.2 of IEEE Std. 802.11-2012.
-   * Max length: |NanCapabilities.maxSubscribeInterfaceAddresses|.
+   * NAN Interface Addresses constituting the Service Response Filter (SRF).
+   * Max length (number of addresses): |NanCapabilities.maxSubscribeInterfaceAddresses|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / Address Set
    */
   vec<MacAddress> intfAddr;
 };
@@ -1041,15 +1101,17 @@
   /**
    * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
    * context of the discovery session.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
    */
   uint8_t discoverySessionId;
   /**
-   * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
+   * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or
+   * |IWifiNanIfaceEventCallback.eventFollowupReceived|.
    */
   uint32_t peerId;
   /**
-   * MAC address of the peer. Obtained as part of an earlier |eventMatch| or
-   * |eventFollowupReceived|.
+   * MAC address of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch|
+   * or |IWifiNanIfaceEventCallback.eventFollowupReceived|.
    */
   MacAddress addr;
   /**
@@ -1062,13 +1124,22 @@
    */
   bool shouldUseDiscoveryWindow;
   /**
-   * Message as a byte sequence.
+   * Arbitrary information communicated to the peer - there is no semantic meaning to these
+   * bytes. They are passed-through from sender to receiver as-is with no parsing.
    * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
    */
-  vec<uint8_t> message;
+  vec<uint8_t> serviceSpecificInfo;
   /**
-   * Disable |eventTransmitFollowup| - i.e. do not get indication on whether the follow-up
-   * was transmitted and received successfully.
+   * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
+   * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
+   * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
+   * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
+   */
+  vec<uint8_t> extendedServiceSpecificInfo;
+  /**
+   * Disable |IWifiNanIfaceEventCallback.eventTransmitFollowup| - i.e. do not get indication on
+   * whether the follow-up was transmitted and received successfully.
    */
   bool disableFollowupResultIndication;
 };
@@ -1078,11 +1149,13 @@
  */
 struct NanInitiateDataPathRequest {
   /**
-   * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
+   * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or
+   * |IWifiNanIfaceEventCallback.eventFollowupReceived|.
    */
   uint32_t peerId;
   /**
-   * NAN management interface MAC address of the peer.
+   * NAN management interface MAC address of the peer. Obtained as part of an earlier
+   * |IWifiNanIfaceEventCallback.eventMatch| or |IWifiNanIfaceEventCallback.eventFollowupReceived|.
    */
   MacAddress peerDiscMacAddr;
   /**
@@ -1090,31 +1163,36 @@
    */
   NanDataPathChannelCfg channelRequestType;
   /**
-   * Channel frequency in MHz to start data-path.
+   * Channel frequency in MHz to start data-path. Not relevant if |channelRequestType| is
+   * |NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED|.
    */
   WifiChannelInMhz channel;
   /**
-   * NAN data interface name on which this data-path session is to be started.
-   * This must be an interface created using |createDataInterfaceRequest|.
+   * NAN data interface name on which this data-path session is to be initiated.
+   * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
    */
   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
    */
   bool securityRequired;
   /**
-   * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+   * 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
+   * with no parsing.
    * Max length: |NanCapabilities.maxAppInfoLen|.
+   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
    */
   vec<uint8_t> appInfo;
   /**
-   * Cipher types supported in data-paths constructed in the context of this discovery session. The
-   * |NanCipherSuiteType| bit fields are used to set this value.
+   * Cipher types supported in data-paths constructed in the context of this discovery session.
    */
   bitfield<NanCipherSuiteType> supportedCipherTypes;
   /**
-   * PMK of the data-path being requested (if |securityRequired| is true).
+   * Pairwise Master Key (PMK) for the data-path being requested (if |securityRequired| is true).
    * Max length: 32
+   * Ref: IEEE 802.11i
    */
   vec<uint8_t> pmk;
 };
@@ -1125,34 +1203,38 @@
 struct NanRespondToDataPathIndicationRequest {
   /**
    * Accept (true) or reject (false) the request.
+   * NAN Spec: Data Path Attributes / NDP Attribute / Type and Status
    */
   bool acceptRequest;
   /**
    * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
-   * |NanDataPathRequestInd|.
+   * |IWifiNanIfaceEventCallback.eventDataPathRequest|.
    */
   uint32_t ndpInstanceId;
   /**
    * NAN data interface name on which this data-path session is to be started.
-   * This must be an interface created using |createDataInterfaceRequest|.
+   * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
    */
   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
    */
   bool securityRequired;
   /**
-   * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+   * 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
+   * with no parsing.
    * Max length: |NanCapabilities.maxAppInfoLen|.
+   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
    */
   vec<uint8_t> appInfo;
   /**
-   * Cipher types supported in data-paths constructed in the context of this discovery session. The
-   * |NanCipherSuiteType| bit fields are used to set this value.
+   * Cipher types supported in data-paths constructed in the context of this discovery session.
    */
   bitfield<NanCipherSuiteType> supportedCipherTypes;
   /**
-   * PMK of the data-path being requested (if |securityRequired| is true).
+   * Pairwise Master Key (PMK) for the data-path being negotiated (if |securityRequired| is true).
    * Max length: 32
    */
   vec<uint8_t> pmk;
@@ -1183,24 +1265,28 @@
    */
   uint32_t maxMatchFilterLen;
   /**
-   * Maximum length (in bytes) of aggregate match filters.
+   * Maximum length (in bytes) of aggregate match filters across all active sessions.
    */
   uint32_t maxTotalMatchFilterLen;
   /**
-   * Maximum length (in bytes) of the service specific info length or message length in follow-ups.
+   * Maximum length (in bytes) of the service specific info field.
    */
   uint32_t maxServiceSpecificInfoLen;
   /**
+   * Maximum length (in bytes) of the extended service specific info field.
+   */
+  uint32_t maxExtendedServiceSpecificInfoLen;
+  /**
    * Maximum length (in bytes) of vendor-specific (VSA) data.
    */
   uint32_t maxVsaDataLen;
   /**
-   * Maximum number of data interfaces which can be created concurrently on the device.
+   * Maximum number of data interfaces (NDI) which can be created concurrently on the device.
    */
   uint32_t maxNdiInterfaces;
   /**
-   * Maximum number of data paths which can be created concurrently on each individual
-   * data interface.
+   * Maximum number of data paths (NDP) which can be created concurrently on each individual
+   * data interface (NDI).
    */
   uint32_t maxNdpSessions;
   /**
@@ -1214,7 +1300,7 @@
   /**
    * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
    */
-  uint32_t maxSubscribeInterfaceAddresses; // TODO: (hard-code to 42) get from HAL
+  uint32_t maxSubscribeInterfaceAddresses;
   /**
    * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
    */
@@ -1227,10 +1313,12 @@
 struct NanMatchInd {
   /**
    * Publish or subscribe discovery session ID of an existing discovery session.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
    */
   uint8_t discoverySessionId;
   /**
-   * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+   * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or
+   * to set up a data-path.
    */
   uint32_t peerId;
   /**
@@ -1238,47 +1326,60 @@
    */
   MacAddress addr;
   /**
-   * The arbitrary information contained in the |serviceSpecificInfo| of the peer's discovery
-   * session.
+   * The arbitrary information contained in the |NanDiscoveryCommonConfig.serviceSpecificInfo| of
+   * the peer's discovery session configuration.
    * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
    */
   vec<uint8_t> serviceSpecificInfo;
   /**
-   * Ordered sequence of <length, value> pairs (length uses 1 byte) of the peer's discovery session
-   * match filter.
+   * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
+   * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
+   * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
+   * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
+   */
+  vec<uint8_t> extendedServiceSpecificInfo;
+  /**
+   * The match filter from the discovery packet (publish or subscribe) which caused service
+   * discovery. Matches the peer's |NanDiscoveryCommonConfig.txMatchFilter|.
    * Max length: |NanCapabilities.maxMatchFilterLen|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Matching Filter
    */
   vec<uint8_t> matchFilter;
   /**
-   * Indicates the type of discovery: Beacon if true, Service Discovery Frames (SDF) if false.
+   * Indicates the type of discovery: true if match occurred on a Beacon frame, false if the match
+   * occurred on a Service Discovery Frames (SDF).
    */
   bool matchOccuredInBeaconFlag;
   /**
-   * Flag to indicate FW is out of resource and that it can no longer
-   * track this Service Name.
+   * Flag to indicate firmware is out of resource and that it can no longer track this Service Name.
+   * Indicates that while |IWifiNanIfaceEventCallback.eventMatch| will be received, the
+   * |NanDiscoveryCommonConfig.discoveryMatchIndicator| configuration will not be honored.
    */
   bool outOfResourceFlag;
   /**
-   * If RSSI filtering was configured in discovery session setup then this
-   * field must contain the received RSSI value. It will contain 0 if RSSI filtering was not
-   * configured.
+   * If RSSI filtering was enabled using |NanDiscoveryCommonConfig.useRssiThreshold| in discovery
+   * session setup then this field contains the received RSSI value. It will contain 0 if RSSI
+   * filtering was not enabled.
    * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
    */
   uint8_t rssiValue;
   /**
    * Cipher types supported by the peer for data-paths constructed in the context of this discovery
-   * session. The |NanCipherSuiteType| bit fields are used to set this value.
+   * session.
    */
   bitfield<NanCipherSuiteType> peerSupportedCipherTypes;
   /**
    * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
    * in the context of this discovery session.
+   * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
    */
   bool peerRequiresSecurityEnabledInNdp;
   /**
-   * Indicates whether or not the peer requires (and hence allows) ranging in this discovery
-   * session.
+   * Indicates whether or not the peer requires (and hence allows) ranging in the context of this
+   * discovery session.
    * Note that ranging is only performed if all other match criteria with the peer are met.
+   * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
    */
   bool peerRequiresRanging;
   /**
@@ -1299,8 +1400,8 @@
    */
   uint32_t rangingMeasurementInCm;
   /**
-   * The ranging event(s) which triggered the ranging. Uses bit-fields from |NanRangingIndication|.
-   * E.g. can indicate that continuous ranging is required, or else that an ingress event occurred.
+   * The ranging event(s) which triggered the ranging. E.g. can indicate that continuous ranging was
+   * requested, or else that an ingress event occurred.
    */
    bitfield<NanRangingIndication> rangingIndicationType;
 };
@@ -1312,10 +1413,12 @@
   /**
    * Discovery session (publish or subscribe) ID of a previously created discovery session. The
    * message is received in the context of this discovery session.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
    */
   uint8_t discoverySessionId;
   /**
-   * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+   * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or
+   * to set up a data-path.
    */
   uint32_t peerId;
   /**
@@ -1328,10 +1431,19 @@
    */
   bool receivedInFaw;
   /**
-   * Received message as a byte sequence.
+   * Received message from the peer - there is no semantic meaning to these bytes. They are
+   * passed-through from sender to receiver as-is with no parsing.
    * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+   * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
    */
-  vec<uint8_t> message;
+  vec<uint8_t> serviceSpecificInfo;
+  /**
+   * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
+   * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
+   * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
+   * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
+   */
+  vec<uint8_t> extendedServiceSpecificInfo;
 };
 
 /**
@@ -1377,6 +1489,7 @@
   /**
    * ID of an active publish or subscribe discovery session - the data-path request is in the
    * context of this discovery session.
+   * NAN Spec: Data Path Attributes / NDP Attribute / Publish ID
    */
   uint8_t discoverySessionId;
   /**
@@ -1390,11 +1503,15 @@
   uint32_t ndpInstanceId;
   /**
    * Specifies whether or not security is required by the peer for the data-path being created.
+   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
    */
   bool securityRequired;
   /**
-   * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+   * Arbitrary information communicated from 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
+   * with no parsing.
    * Max length: |NanCapabilities.maxAppInfoLen|.
+   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
    */
   vec<uint8_t> appInfo;
 };
@@ -1418,8 +1535,11 @@
    */
   MacAddress peerNdiMacAddr;
   /**
-   * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+   * Arbitrary information communicated from 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
+   * with no parsing.
    * Max length: |NanCapabilities.maxAppInfoLen|.
+   * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
    */
   vec<uint8_t> appInfo;
   /**