Merge "audio: add audio HAL service and sound trigger HAL implementation"
diff --git a/Android.bp b/Android.bp
index 293d4a3..d714a74 100644
--- a/Android.bp
+++ b/Android.bp
@@ -6,8 +6,10 @@
     "audio/effect/2.0",
     "benchmarks/msgq/1.0",
     "biometrics/fingerprint/2.1",
-    "gnss/1.0",
     "bluetooth/1.0",
+    "boot/1.0",
+    "example/extension/light/2.0",
+    "gnss/1.0",
     "graphics/allocator/2.0",
     "graphics/allocator/2.0/default",
     "graphics/composer/2.1",
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
new file mode 100644
index 0000000..98341ef
--- /dev/null
+++ b/boot/1.0/Android.bp
@@ -0,0 +1,46 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.boot@1.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.boot@1.0",
+    srcs: [
+        "types.hal",
+        "IBootControl.hal",
+    ],
+    out: [
+        "android/hardware/boot/1.0/types.cpp",
+        "android/hardware/boot/1.0/BootControlAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.boot@1.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.boot@1.0",
+    srcs: [
+        "types.hal",
+        "IBootControl.hal",
+    ],
+    out: [
+        "android/hardware/boot/1.0/types.h",
+        "android/hardware/boot/1.0/IBootControl.h",
+        "android/hardware/boot/1.0/IHwBootControl.h",
+        "android/hardware/boot/1.0/BnBootControl.h",
+        "android/hardware/boot/1.0/BpBootControl.h",
+        "android/hardware/boot/1.0/BsBootControl.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.boot@1.0",
+    generated_sources: ["android.hardware.boot@1.0_genc++"],
+    generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+    ],
+}
diff --git a/boot/1.0/Android.mk b/boot/1.0/Android.mk
new file mode 100644
index 0000000..bb19a79
--- /dev/null
+++ b/boot/1.0/Android.mk
@@ -0,0 +1,136 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.boot@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (BoolResult)
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/BoolResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::types.BoolResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CommandResult)
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/CommandResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::types.CommandResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBootControl.hal
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/IBootControl.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBootControl.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::IBootControl
+
+$(GEN): $(LOCAL_PATH)/IBootControl.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.boot@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (BoolResult)
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/BoolResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::types.BoolResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CommandResult)
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/CommandResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::types.CommandResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBootControl.hal
+#
+GEN := $(intermediates)/android/hardware/boot/1.0/IBootControl.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBootControl.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.boot@1.0::IBootControl
+
+$(GEN): $(LOCAL_PATH)/IBootControl.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/boot/1.0/IBootControl.hal b/boot/1.0/IBootControl.hal
new file mode 100644
index 0000000..2024f1f
--- /dev/null
+++ b/boot/1.0/IBootControl.hal
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.boot@1.0;
+
+/**
+ * The Boot Control HAL is designed to allow for managing sets of redundant
+ * partitions, called slots, that can be booted from independently. Slots
+ * are sets of partitions whose names differ only by a given suffix.
+ * They are identified here by a 0 indexed number and associated with their
+ * suffix, which is appended to the base name for any particular partition
+ * to find the one associated with that slot.
+ * The primary use of this set up is to allow for background updates while
+ * the device is running, and to provide a fallback in the event that the
+ * update fails.
+ */
+interface IBootControl {
+  /**
+   * getNumberSlots() returns the number of available slots.
+   * For instance, a system with a single set of partitions must return
+   * 1, a system with A/B must return 2, A/B/C -> 3 and so on. A system with
+   * less than two slots doesn't support background updates, for example if
+   * running from a virtual machine with only one copy of each partition for the
+   * purpose of testing.
+   */
+  getNumberSlots() generates (uint32_t numSlots);
+
+  /**
+   * getCurrentSlot() returns the slot number of that the current boot is booted
+   * from, for example slot number 0 (Slot A). It is assumed that if the current
+   * slot is A, then the block devices underlying B can be accessed directly
+   * without any risk of corruption.
+   * The returned value is always guaranteed to be strictly less than the
+   * value returned by getNumberSlots. Slots start at 0 and finish at
+   * getNumberSlots() - 1. The value returned here must match the suffix passed
+   * from the bootloader, regardless of which slot is active or successful.
+   */
+  getCurrentSlot() generates (Slot slot);
+
+  /**
+   * markBootSuccessful() marks the current slot as having booted successfully.
+   *
+   * Returns whether the command succeeded.
+   */
+  markBootSuccessful() generates (CommandResult error);
+
+  /**
+   * setActiveBootSlot() marks the slot passed in parameter as the active boot
+   * slot (see getCurrentSlot for an explanation of the "slot" parameter). This
+   * overrides any previous call to setSlotAsUnbootable.
+   * Returns whether the command succeeded.
+   */
+  setActiveBootSlot(Slot slot) generates (CommandResult error);
+
+  /**
+   * setSlotAsUnbootable() marks the slot passed in parameter as
+   * an unbootable. This can be used while updating the contents of the slot's
+   * partitions, so that the system must not attempt to boot a known bad set up.
+   * Returns whether the command succeeded.
+   */
+  setSlotAsUnbootable(Slot slot) generates (CommandResult error);
+
+  /**
+   * isSlotBootable() returns if the slot passed in parameter is bootable. Note
+   * that slots can be made unbootable by both the bootloader and by the OS
+   * using setSlotAsUnbootable.
+   * Returns TRUE if the slot is bootable, FALSE if it's not, and INVALID_SLOT
+   * if slot does not exist.
+   */
+  isSlotBootable(Slot slot) generates (BoolResult bootable);
+
+  /**
+   * isSlotMarkedSucessful() returns if the slot passed in parameter has been
+   * marked as successful using markBootSuccessful. Note that only the current
+   * slot can be marked as successful but any slot can be queried.
+   * Returns TRUE if the slot has been marked as successful, FALSE if it has
+   * not, and INVALID_SLOT if the slot does not exist.
+   */
+  isSlotMarkedSuccessful(Slot slot) generates (BoolResult successful);
+
+  /**
+   * getSuffix() returns the string suffix used by partitions that correspond to
+   * the slot number passed in as a parameter. The bootloader must pass the
+   * suffix of the currently active slot either through a kernel command line
+   * property at androidboot.slot_suffix, or the device tree at
+   * /firmware/android/slot_suffix.
+   * Returns the empty string "" if slot does not match an existing slot.
+   */
+  getSuffix(Slot slot) generates (string slotSuffix);
+};
+
diff --git a/boot/1.0/default/Android.mk b/boot/1.0/default/Android.mk
new file mode 100644
index 0000000..50fd1e4
--- /dev/null
+++ b/boot/1.0/default/Android.mk
@@ -0,0 +1,34 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.boot@1.0-impl
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+    BootControl.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+    liblog \
+    libhidl \
+    libhwbinder \
+    libhardware \
+    libutils \
+    android.hardware.boot@1.0 \
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_MODULE := android.hardware.boot@1.0-service
+LOCAL_INIT_RC := android.hardware.boot@1.0-service.rc
+LOCAL_SRC_FILES := \
+    service.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+    liblog \
+    libhwbinder \
+    libhardware \
+    libhidl \
+    libutils \
+    android.hardware.boot@1.0 \
+
+include $(BUILD_EXECUTABLE)
diff --git a/boot/1.0/default/BootControl.cpp b/boot/1.0/default/BootControl.cpp
new file mode 100644
index 0000000..4c34168
--- /dev/null
+++ b/boot/1.0/default/BootControl.cpp
@@ -0,0 +1,98 @@
+#define LOG_TAG "android.hardware.boot@1.0-impl"
+#include <utils/Log.h>
+
+#include <hardware/hardware.h>
+#include <hardware/boot_control.h>
+#include "BootControl.h"
+
+namespace android {
+namespace hardware {
+namespace boot {
+namespace V1_0 {
+namespace implementation {
+
+BootControl::BootControl(boot_control_module_t *module) : mModule(module){
+}
+
+// Methods from ::android::hardware::boot::V1_0::IBootControl follow.
+Return<uint32_t> BootControl::getNumberSlots()  {
+    return mModule->getNumberSlots(mModule);
+}
+
+Return<uint32_t> BootControl::getCurrentSlot()  {
+    return mModule->getCurrentSlot(mModule);
+}
+
+Return<void> BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb)  {
+    int ret = mModule->markBootSuccessful(mModule);
+    struct CommandResult cr;
+    cr.success = (ret == 0);
+    cr.errMsg = strerror(-ret);
+    _hidl_cb(cr);
+    return Void();
+}
+
+Return<void> BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb)  {
+    int ret = mModule->setActiveBootSlot(mModule, slot);
+    struct CommandResult cr;
+    cr.success = (ret == 0);
+    cr.errMsg = strerror(-ret);
+    _hidl_cb(cr);
+    return Void();
+}
+
+Return<void> BootControl::setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb)  {
+    int ret = mModule->setSlotAsUnbootable(mModule, slot);
+    struct CommandResult cr;
+    cr.success = (ret == 0);
+    cr.errMsg = strerror(-ret);
+    _hidl_cb(cr);
+    return Void();
+}
+
+Return<BoolResult> BootControl::isSlotBootable(uint32_t slot)  {
+    int32_t ret = mModule->isSlotBootable(mModule, slot);
+    if (ret < 0) {
+        return BoolResult::INVALID_SLOT;
+    }
+    return ret ? BoolResult::TRUE : BoolResult::FALSE;
+}
+
+Return<BoolResult> BootControl::isSlotMarkedSuccessful(uint32_t slot)  {
+    int32_t ret = mModule->isSlotMarkedSuccessful(mModule, slot);
+    if (ret < 0) {
+        return BoolResult::INVALID_SLOT;
+    }
+    return ret ? BoolResult::TRUE : BoolResult::FALSE;
+}
+
+Return<void> BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb)  {
+    hidl_string ans;
+    const char *suffix = mModule->getSuffix(mModule, slot);
+    if (suffix) {
+        ans = suffix;
+    }
+    _hidl_cb(ans);
+    return Void();
+}
+
+
+IBootControl* HIDL_FETCH_IBootControl(const char* hal) {
+    int ret = 0;
+    boot_control_module_t* module = NULL;
+    hw_module_t **hwm = reinterpret_cast<hw_module_t**>(&module);
+    ret = hw_get_module(hal, const_cast<const hw_module_t**>(hwm));
+    if (ret)
+    {
+        ALOGE("hw_get_module %s failed: %d", hal, ret);
+        return nullptr;
+    }
+    module->init(module);
+    return new BootControl(module);
+}
+
+} // namespace implementation
+}  // namespace V1_0
+}  // namespace boot
+}  // namespace hardware
+}  // namespace android
diff --git a/boot/1.0/default/BootControl.h b/boot/1.0/default/BootControl.h
new file mode 100644
index 0000000..73af4f4
--- /dev/null
+++ b/boot/1.0/default/BootControl.h
@@ -0,0 +1,46 @@
+#ifndef HIDL_GENERATED_android_hardware_boot_V1_0_BootControl_H_
+#define HIDL_GENERATED_android_hardware_boot_V1_0_BootControl_H_
+
+#include <android/hardware/boot/1.0/IBootControl.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace boot {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::boot::V1_0::BoolResult;
+using ::android::hardware::boot::V1_0::CommandResult;
+using ::android::hardware::boot::V1_0::IBootControl;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct BootControl : public IBootControl {
+    BootControl(boot_control_module_t* module);
+    // Methods from ::android::hardware::boot::V1_0::IBootControl follow.
+    Return<uint32_t> getNumberSlots()  override;
+    Return<uint32_t> getCurrentSlot()  override;
+    Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb)  override;
+    Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb)  override;
+    Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb)  override;
+    Return<BoolResult> isSlotBootable(uint32_t slot)  override;
+    Return<BoolResult> isSlotMarkedSuccessful(uint32_t slot)  override;
+    Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb)  override;
+private:
+    boot_control_module_t* mModule;
+};
+
+extern "C" IBootControl* HIDL_FETCH_IBootControl(const char* name);
+
+}  // namespace implementation
+}  // namespace V1_0
+}  // namespace boot
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HIDL_GENERATED_android_hardware_boot_V1_0_BootControl_H_
diff --git a/boot/1.0/default/android.hardware.boot@1.0-service.rc b/boot/1.0/default/android.hardware.boot@1.0-service.rc
new file mode 100644
index 0000000..57c1aff
--- /dev/null
+++ b/boot/1.0/default/android.hardware.boot@1.0-service.rc
@@ -0,0 +1,4 @@
+service boot-hal-1-0 /system/bin/hw/android.hardware.boot@1.0-service
+    class hal
+    user system
+    group system readproc
diff --git a/boot/1.0/default/service.cpp b/boot/1.0/default/service.cpp
new file mode 100644
index 0000000..b059f9a
--- /dev/null
+++ b/boot/1.0/default/service.cpp
@@ -0,0 +1,44 @@
+#define LOG_TAG "android.hardware.boot@1.0-service"
+#include <utils/Log.h>
+
+#include <iostream>
+#include <unistd.h>
+
+#include <android/hardware/boot/1.0/IBootControl.h>
+
+#include <hidl/IServiceManager.h>
+#include <hwbinder/IPCThreadState.h>
+#include <hwbinder/ProcessState.h>
+#include <utils/Errors.h>
+#include <utils/StrongPointer.h>
+
+using android::sp;
+
+using android::hardware::IPCThreadState;
+using android::hardware::ProcessState;
+
+using ::android::hardware::boot::V1_0::IBootControl;
+
+int main (int /* argc */, char * /* argv */ []) {
+    ALOGI("Service is starting.");
+    const char instance[] = "bootctrl";
+    ALOGI("Retrieving default implementation of instance %s.",
+          instance);
+
+    sp<IBootControl> service = IBootControl::getService(instance, true /* getStub */);
+
+    if (service.get() == nullptr) {
+        ALOGE("IBootControl::getService returned NULL, exiting");
+        return -1;
+    }
+
+    LOG_FATAL_IF(service->isRemote(), "Implementation is REMOTE!");
+
+    ALOGI("Registering instance %s.", instance);
+    service->registerAsService(instance);
+    ALOGI("Ready.");
+
+    ProcessState::self()->setThreadPoolMaxThreadCount(0);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+}
diff --git a/boot/1.0/types.hal b/boot/1.0/types.hal
new file mode 100644
index 0000000..87f6109
--- /dev/null
+++ b/boot/1.0/types.hal
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.boot@1.0;
+
+/**
+ * A command result encapsulating whether the command succeeded and
+ * an error string.
+ */
+struct CommandResult {
+    bool success;
+    string errMsg;
+};
+
+/**
+ * An identifier for a slot number.
+ */
+typedef uint32_t Slot;
+
+/**
+ * A result encapsulating whether a function returned true, false or
+ * failed due to an invalid slot number
+ */
+enum BoolResult : int32_t {
+    FALSE = 0,
+    TRUE = 1,
+    INVALID_SLOT = -1
+};
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
new file mode 100644
index 0000000..42f34f2
--- /dev/null
+++ b/example/extension/light/2.0/Android.bp
@@ -0,0 +1,47 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.example.extension.light@2.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.example.extension.light@2.0",
+    srcs: [
+        "types.hal",
+        "IExtLight.hal",
+    ],
+    out: [
+        "android/hardware/example/extension/light/2.0/types.cpp",
+        "android/hardware/example/extension/light/2.0/ExtLightAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.example.extension.light@2.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.example.extension.light@2.0",
+    srcs: [
+        "types.hal",
+        "IExtLight.hal",
+    ],
+    out: [
+        "android/hardware/example/extension/light/2.0/types.h",
+        "android/hardware/example/extension/light/2.0/IExtLight.h",
+        "android/hardware/example/extension/light/2.0/IHwExtLight.h",
+        "android/hardware/example/extension/light/2.0/BnExtLight.h",
+        "android/hardware/example/extension/light/2.0/BpExtLight.h",
+        "android/hardware/example/extension/light/2.0/BsExtLight.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.example.extension.light@2.0",
+    generated_sources: ["android.hardware.example.extension.light@2.0_genc++"],
+    generated_headers: ["android.hardware.example.extension.light@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.example.extension.light@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+        "android.hardware.light@2.0",
+    ],
+}
diff --git a/example/extension/light/2.0/Android.mk b/example/extension/light/2.0/Android.mk
new file mode 100644
index 0000000..75157a8
--- /dev/null
+++ b/example/extension/light/2.0/Android.mk
@@ -0,0 +1,178 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.example.extension.light@2.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+    android.hardware.light@2.0-java \
+
+
+#
+# Build types.hal (Default)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/Default.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.Default
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ExtBrightness)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/ExtBrightness.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.ExtBrightness
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ExtLightState)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/ExtLightState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.ExtLightState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IExtLight.hal
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/IExtLight.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IExtLight.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::IExtLight
+
+$(GEN): $(LOCAL_PATH)/IExtLight.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.example.extension.light@2.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    android.hardware.light@2.0-java-static \
+
+
+#
+# Build types.hal (Default)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/Default.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.Default
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ExtBrightness)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/ExtBrightness.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.ExtBrightness
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ExtLightState)
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/ExtLightState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::types.ExtLightState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IExtLight.hal
+#
+GEN := $(intermediates)/android/hardware/example/extension/light/2.0/IExtLight.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IExtLight.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.example.extension.light@2.0::IExtLight
+
+$(GEN): $(LOCAL_PATH)/IExtLight.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/example/extension/light/2.0/IExtLight.hal b/example/extension/light/2.0/IExtLight.hal
new file mode 100644
index 0000000..f12a272
--- /dev/null
+++ b/example/extension/light/2.0/IExtLight.hal
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Would normally be 'vendor.example.extension.light@2.0' however, this is
+// a google extension example. A vendor extension should also live in the
+// vendor partition.
+package android.hardware.example.extension.light@2.0;
+
+import android.hardware.light@2.0;
+
+interface IExtLight extends android.hardware.light@2.0::ILight {
+
+    /**
+     * Set the provided lights to the provided values.
+     *
+     * @param type logical light to set
+     * @param state describes what the light should look like.
+     * @return status result of applying state transformation.
+     */
+    setExtLight(Type type, ExtLightState state) generates (Status status);
+
+};
diff --git a/example/extension/light/2.0/default/Android.mk b/example/extension/light/2.0/default/Android.mk
new file mode 100644
index 0000000..fa68787
--- /dev/null
+++ b/example/extension/light/2.0/default/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.example.extension.light@2.0-service
+LOCAL_INIT_RC := android.hardware.example.extension.light@2.0-service.rc
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+    Light.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+    libhidl \
+    libhwbinder \
+    libutils \
+    android.hardware.light@2.0 \
+    android.hardware.example.extension.light@2.0 \
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/example/extension/light/2.0/default/Light.cpp b/example/extension/light/2.0/default/Light.cpp
new file mode 100644
index 0000000..d738a6d
--- /dev/null
+++ b/example/extension/light/2.0/default/Light.cpp
@@ -0,0 +1,56 @@
+#include "Light.h"
+
+namespace android {
+namespace hardware {
+namespace example {
+namespace extension {
+namespace light {
+namespace V2_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::light::V2_0::ILight follow.
+Return<Status> Light::setLight(Type type, const LightState& state)  {
+    // Forward types for new methods.
+
+    ExtLightState extState {
+        .state = state,
+        .interpolationOmega =
+            static_cast<int32_t>(Default::INTERPOLATION_OMEGA),
+        .brightness = // ExtBrightness inherits from Brightness
+            static_cast<ExtBrightness>(state.brightnessMode)
+    };
+
+    return setExtLight(type, extState);
+}
+
+Return<void> Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb)  {
+    // implement unchanged method as you would always
+    hidl_vec<Type> vec{};
+
+    // ******************************************************
+    // Note: awesome proprietary hardware implementation here
+    // ******************************************************
+
+    _hidl_cb(vec);
+
+    return Void();
+}
+
+// Methods from ::android::hardware::example::extension::light::V2_0::ILight follow.
+Return<Status> Light::setExtLight(Type /* type */,
+                                  const ExtLightState& /* state */)  {
+
+    // ******************************************************
+    // Note: awesome proprietary hardware implementation here
+    // ******************************************************
+
+    return Status::SUCCESS;
+}
+
+} // namespace implementation
+}  // namespace V2_0
+}  // namespace light
+}  // namespace extension
+}  // namespace example
+}  // namespace hardware
+}  // namespace android
diff --git a/example/extension/light/2.0/default/Light.h b/example/extension/light/2.0/default/Light.h
new file mode 100644
index 0000000..e09ec92
--- /dev/null
+++ b/example/extension/light/2.0/default/Light.h
@@ -0,0 +1,46 @@
+#ifndef HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
+#define HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
+
+#include <android/hardware/example/extension/light/2.0/IExtLight.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace example {
+namespace extension {
+namespace light {
+namespace V2_0 {
+namespace implementation {
+
+using ::android::hardware::example::extension::light::V2_0::ExtLightState;
+using ::android::hardware::example::extension::light::V2_0::IExtLight;
+using ::android::hardware::light::V2_0::ILight;
+using ::android::hardware::light::V2_0::LightState;
+using ::android::hardware::light::V2_0::Status;
+using ::android::hardware::light::V2_0::Type;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Light : public IExtLight {
+    // Methods from ::android::hardware::light::V2_0::ILight follow.
+    Return<Status> setLight(Type type, const LightState& state)  override;
+    Return<void> getSupportedTypes(getSupportedTypes_cb _hidl_cb)  override;
+
+    // Methods from ::android::hardware::example::extension::light::V2_0::ILight follow.
+    Return<Status> setExtLight(Type type, const ExtLightState& state)  override;
+
+};
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace light
+}  // namespace extension
+}  // namespace example
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
diff --git a/example/extension/light/2.0/default/android.hardware.example.extension.light@2.0-service.rc b/example/extension/light/2.0/default/android.hardware.example.extension.light@2.0-service.rc
new file mode 100644
index 0000000..8a90d81
--- /dev/null
+++ b/example/extension/light/2.0/default/android.hardware.example.extension.light@2.0-service.rc
@@ -0,0 +1,4 @@
+service light-ext-2-0 /system/bin/hw/android.hardware.example.extension.light@2.0-service
+    class hal
+    user system
+    group system readproc
\ No newline at end of file
diff --git a/example/extension/light/2.0/default/service.cpp b/example/extension/light/2.0/default/service.cpp
new file mode 100644
index 0000000..55121d9
--- /dev/null
+++ b/example/extension/light/2.0/default/service.cpp
@@ -0,0 +1,34 @@
+#define LOG_TAG "android.hardware.light@2.0-service"
+#include <utils/Log.h>
+
+// #include <iostream>
+// #include <unistd.h>
+
+// #include <hidl/IServiceManager.h>
+// #include <hwbinder/IPCThreadState.h>
+// #include <hwbinder/ProcessState.h>
+// #include <utils/Errors.h>
+// #include <utils/StrongPointer.h>
+
+#include "Light.h"
+
+using android::sp;
+
+// libhwbinder:
+using android::hardware::IPCThreadState;
+using android::hardware::ProcessState;
+
+// Generated HIDL files
+using android::hardware::light::V2_0::ILight;
+
+int main() {
+    const char instance[] = "light";
+
+    android::sp<ILight> service = new Light();
+
+    service->registerAsService(instance);
+
+    ProcessState::self()->setThreadPoolMaxThreadCount(0);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+}
diff --git a/example/extension/light/2.0/types.hal b/example/extension/light/2.0/types.hal
new file mode 100644
index 0000000..5be41bb
--- /dev/null
+++ b/example/extension/light/2.0/types.hal
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.example.extension.light@2.0;
+
+import android.hardware.light@2.0;
+
+enum Default : int32_t {
+    // for calls to setLight from the framework that don't know about this
+    // extension or its requirements
+    INTERPOLATION_OMEGA = 2
+};
+
+/**
+ * One possibility is renaming an old type. Another possibility is taking
+ * advantages of the different namespaces.
+ */
+enum ExtBrightness : Brightness {
+    /**
+     * Say we're really going to use the phone as a heater.
+     */
+    EXTREME,
+
+    /**
+     * Sometimes at night, we need it to be day.
+     */
+     THE_SUN,
+};
+
+/**
+ * Structs can't inherit eachother in hidl. Use composition instead. In this
+ * case, I won't use inheritence because I want to replace Brightness with
+ * ExtBrightness.
+ */
+struct ExtLightState {
+    LightState state;
+
+    /**
+     * This is the secret sauce that will really make this extension shine.
+     * No other person has such a cool feature in their hals. Don't forget
+     * to describe all details of parameters. An interface is a contract, and
+     * specifying this contract to the letter is what allows that contracted
+     * to be maintained. :)
+     *
+     * So, this parameter represents the speed at which brightness is changed
+     * to the new value in the three dimensional space with coordinates RGB
+     * from the red, blue, and green.
+     */
+    int32_t interpolationOmega;
+
+    /**
+     * Include new values.
+     */
+    ExtBrightness brightness;
+};
diff --git a/graphics/allocator/2.0/default/Android.bp b/graphics/allocator/2.0/default/Android.bp
index 9a24773..8eac8f5 100644
--- a/graphics/allocator/2.0/default/Android.bp
+++ b/graphics/allocator/2.0/default/Android.bp
@@ -15,6 +15,21 @@
     ],
 }
 
+cc_binary {
+    name: "android.hardware.graphics.allocator@2.0-service",
+    relative_install_path: "hw",
+    srcs: ["service.cpp"],
+    init_rc: ["android.hardware.graphics.allocator@2.0-service.rc"],
+
+    shared_libs: [
+        "android.hardware.graphics.allocator@2.0",
+        "libhidl",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+    ],
+}
+
 cc_library_static {
     name: "libgralloc1-adapter",
     srcs: ["gralloc1-adapter.c"],
diff --git a/graphics/allocator/2.0/default/android.hardware.graphics.allocator@2.0-service.rc b/graphics/allocator/2.0/default/android.hardware.graphics.allocator@2.0-service.rc
new file mode 100644
index 0000000..8bb0d85
--- /dev/null
+++ b/graphics/allocator/2.0/default/android.hardware.graphics.allocator@2.0-service.rc
@@ -0,0 +1,5 @@
+service gralloc-2-0 /system/bin/hw/android.hardware.graphics.allocator@2.0-service
+    class hal
+    user system
+    group graphics drmrpc readproc
+    onrestart restart surfaceflinger
diff --git a/graphics/allocator/2.0/default/service.cpp b/graphics/allocator/2.0/default/service.cpp
new file mode 100644
index 0000000..fd89aa8
--- /dev/null
+++ b/graphics/allocator/2.0/default/service.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "GrallocService"
+
+#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
+#include <hwbinder/IPCThreadState.h>
+#include <hwbinder/ProcessState.h>
+#include <utils/StrongPointer.h>
+
+using android::sp;
+using android::hardware::IPCThreadState;
+using android::hardware::ProcessState;
+using android::hardware::graphics::allocator::V2_0::IAllocator;
+
+int main()
+{
+    const char instance[] = "gralloc";
+
+    ALOGI("Service is starting.");
+
+    sp<IAllocator> service = IAllocator::getService(instance,
+            true /* getStub */);
+    if (service == nullptr) {
+        ALOGI("getService returned NULL");
+        return -1;
+    }
+
+    LOG_FATAL_IF(service->isRemote(), "Service is REMOTE!");
+
+    service->registerAsService(instance);
+
+    ProcessState::self()->setThreadPoolMaxThreadCount(0);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+
+    return 0;
+}
diff --git a/graphics/composer/2.1/default/Android.bp b/graphics/composer/2.1/default/Android.bp
index f91c9a2..6936347 100644
--- a/graphics/composer/2.1/default/Android.bp
+++ b/graphics/composer/2.1/default/Android.bp
@@ -14,3 +14,24 @@
         "libutils",
     ],
 }
+
+cc_binary {
+    name: "android.hardware.graphics.composer@2.1-service",
+    relative_install_path: "hw",
+    srcs: ["service.cpp", "Hwc.cpp"],
+    cppflags: ["-DBINDERIZED"],
+    init_rc: ["android.hardware.graphics.composer@2.1-service.rc"],
+
+    shared_libs: [
+        "android.hardware.graphics.allocator@2.0",
+        "android.hardware.graphics.composer@2.1",
+        "libbase",
+        "libbinder",
+        "libcutils",
+        "libhardware",
+        "libhidl",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+    ],
+}
diff --git a/graphics/composer/2.1/default/Hwc.cpp b/graphics/composer/2.1/default/Hwc.cpp
index 09c62f0..d45a955 100644
--- a/graphics/composer/2.1/default/Hwc.cpp
+++ b/graphics/composer/2.1/default/Hwc.cpp
@@ -698,6 +698,14 @@
 Return<Error> HwcHal::destroyLayer(Display display, Layer layer)
 {
     auto error = mDispatch.destroyLayer(mDevice, display, layer);
+    if (error == HWC2_ERROR_NONE) {
+        std::lock_guard<std::mutex> lock(mDisplayMutex);
+
+        auto dpy = mDisplays.find(display);
+        dpy->second.LayerBuffers.erase(layer);
+        dpy->second.LayerSidebandStreams.erase(layer);
+    }
+
     return static_cast<Error>(error);
 }
 
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
new file mode 100644
index 0000000..fc21d59
--- /dev/null
+++ b/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
@@ -0,0 +1,5 @@
+service hwcomposer-2-1 /system/bin/hw/android.hardware.graphics.composer@2.1-service
+    class hal
+    user system
+    group graphics drmrpc readproc
+    onrestart restart surfaceflinger
diff --git a/graphics/composer/2.1/default/service.cpp b/graphics/composer/2.1/default/service.cpp
new file mode 100644
index 0000000..0384a53
--- /dev/null
+++ b/graphics/composer/2.1/default/service.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "HWComposerService"
+
+#include <binder/ProcessState.h>
+#include <hwbinder/IPCThreadState.h>
+#include <hwbinder/ProcessState.h>
+#include <utils/StrongPointer.h>
+#include "Hwc.h"
+
+using android::sp;
+using android::hardware::IPCThreadState;
+using android::hardware::ProcessState;
+using android::hardware::graphics::composer::V2_1::IComposer;
+using android::hardware::graphics::composer::V2_1::implementation::HIDL_FETCH_IComposer;
+
+int main()
+{
+    const char instance[] = "hwcomposer";
+
+    ALOGI("Service is starting.");
+
+    sp<IComposer> service = HIDL_FETCH_IComposer(instance);
+    if (service == nullptr) {
+        ALOGI("getService returned NULL");
+        return -1;
+    }
+
+    LOG_FATAL_IF(service->isRemote(), "Service is REMOTE!");
+
+    service->registerAsService(instance);
+
+    // the conventional HAL might start binder services
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
+    android::ProcessState::self()->startThreadPool();
+
+    ProcessState::self()->setThreadPoolMaxThreadCount(0);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+
+    return 0;
+}
diff --git a/memtrack/1.0/IMemtrack.hal b/memtrack/1.0/IMemtrack.hal
index 064f2fe..ae9d960 100644
--- a/memtrack/1.0/IMemtrack.hal
+++ b/memtrack/1.0/IMemtrack.hal
@@ -57,7 +57,7 @@
      * GRAPHICS is requested and not when GL
      * is requested.
      *
-     * @param pid process for which memory infromation is requested
+     * @param pid process for which memory information is requested
      * @param type memory type that information is being requested about
      * @return records vector of MemtrackRecord containing memory information
      * @return retval SUCCESS on success, TYPE_NOT_FOUND if the type is not
diff --git a/nfc/1.0/default/service.cpp b/nfc/1.0/default/service.cpp
index e70388d..32f9c28 100644
--- a/nfc/1.0/default/service.cpp
+++ b/nfc/1.0/default/service.cpp
@@ -1,44 +1,13 @@
 #define LOG_TAG "android.hardware.nfc@1.0-service"
-#include <utils/Log.h>
-
-#include <iostream>
-#include <unistd.h>
 
 #include <android/hardware/nfc/1.0/INfc.h>
 
-#include <hidl/IServiceManager.h>
-#include <hwbinder/IPCThreadState.h>
-#include <hwbinder/ProcessState.h>
-#include <utils/Errors.h>
-#include <utils/StrongPointer.h>
-
-using android::sp;
-
-// libhwbinder:
-using android::hardware::IPCThreadState;
-using android::hardware::ProcessState;
+#include <hidl/LegacySupport.h>
 
 // Generated HIDL files
 using android::hardware::nfc::V1_0::INfc;
+using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-    ALOGI("Service is starting.");
-    const char instance[] = "nfc_nci";
-    ALOGI("Retrieving default implementation of instance %s.",
-          instance);
-    android::sp<INfc> service = INfc::getService(instance, true /* getStub */);
-    if (service.get() == nullptr) {
-        ALOGE("INfc::getService returned NULL, exiting");
-        return -1;
-    }
-    ALOGI("Default implementation using %s is %s",
-          instance, (service->isRemote() ? "REMOTE" : "LOCAL"));
-    LOG_FATAL_IF(service->isRemote(), "Implementation is REMOTE!");
-    ALOGI("Registering instance %s.", instance);
-    service->registerAsService(instance);
-    ALOGI("Ready.");
-
-    ProcessState::self()->setThreadPoolMaxThreadCount(0);
-    ProcessState::self()->startThreadPool();
-    IPCThreadState::self()->joinThreadPool();
+    return defaultPassthroughServiceImplementation<INfc>("nfc_nci");
 }
diff --git a/nfc/1.0/vts/Nfc.vts b/nfc/1.0/vts/Nfc.vts
index 8c18653..1f50698 100644
--- a/nfc/1.0/vts/Nfc.vts
+++ b/nfc/1.0/vts/Nfc.vts
@@ -1,7 +1,6 @@
 component_class: HAL_HIDL
 component_type_version: 1.0
 component_name: "INfc"
-component_type: NFC
 
 package: "android.hardware.nfc"
 
diff --git a/nfc/1.0/vts/NfcClientCallback.vts b/nfc/1.0/vts/NfcClientCallback.vts
index e468935..e2a3e5b 100644
--- a/nfc/1.0/vts/NfcClientCallback.vts
+++ b/nfc/1.0/vts/NfcClientCallback.vts
@@ -1,7 +1,6 @@
 component_class: HAL_HIDL
 component_type_version: 1.0
 component_name: "INfcClientCallback"
-component_type: NFC
 
 package: "android.hardware.nfc"
 
diff --git a/nfc/1.0/vts/types.vts b/nfc/1.0/vts/types.vts
index f56ddf1..969a8af 100644
--- a/nfc/1.0/vts/types.vts
+++ b/nfc/1.0/vts/types.vts
@@ -1,7 +1,6 @@
 component_class: HAL_HIDL
 component_type_version: 1.0
 component_name: "types"
-component_type: NFC
 
 package: "android.hardware.nfc"
 
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 4433802..6da9eec 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -118,6 +118,22 @@
     return mFoo->sendVecVec(_hidl_cb);
 }
 
+Return<void> Bar::haveAVectorOfInterfaces(
+        const hidl_vec<sp<ISimple> > &in,
+        haveAVectorOfInterfaces_cb _hidl_cb) {
+    _hidl_cb(in);
+
+    return Void();
+}
+
+Return<void> Bar::haveAVectorOfGenericInterfaces(
+        const hidl_vec<sp<android::hardware::IBinder> > &in,
+        haveAVectorOfGenericInterfaces_cb _hidl_cb) {
+    _hidl_cb(in);
+
+    return Void();
+}
+
 // Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
 Return<void> Bar::thisIsNew()  {
     ALOGI("SERVER(Bar) thisIsNew");
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
index 58d9f9a..ae18d93 100644
--- a/tests/bar/1.0/default/Bar.h
+++ b/tests/bar/1.0/default/Bar.h
@@ -16,6 +16,7 @@
 using ::android::hardware::tests::foo::V1_0::Abc;
 using ::android::hardware::tests::foo::V1_0::IFoo;
 using ::android::hardware::tests::foo::V1_0::IFooCallback;
+using ::android::hardware::tests::foo::V1_0::ISimple;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::hardware::hidl_vec;
@@ -49,6 +50,14 @@
     virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb)  override;
     virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb)  override;
 
+    Return<void> haveAVectorOfInterfaces(
+            const hidl_vec<sp<ISimple> > &in,
+            haveAVectorOfInterfaces_cb _hidl_cb) override;
+
+    Return<void> haveAVectorOfGenericInterfaces(
+            const hidl_vec<sp<android::hardware::IBinder> > &in,
+            haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
+
     // Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
     Return<void> thisIsNew()  override;
 
diff --git a/tests/baz/1.0/IBase.hal b/tests/baz/1.0/IBase.hal
index 3f18d41..add4153 100644
--- a/tests/baz/1.0/IBase.hal
+++ b/tests/baz/1.0/IBase.hal
@@ -76,6 +76,9 @@
 
     someMethodWithVectorOfArray(VectorOfArray in) generates (VectorOfArray out);
 
+    someMethodTakingAVectorOfArray(vec<MacAddress> in)
+        generates (vec<MacAddress> out);
+
     transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out);
     transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out);
 };
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 1fbb7bd..e7bcad2 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -9,6 +9,7 @@
         "IFoo.hal",
         "IFooCallback.hal",
         "IMyTypes.hal",
+        "ISimple.hal",
         "ITheirTypes.hal",
     ],
     out: [
@@ -16,6 +17,7 @@
         "android/hardware/tests/foo/1.0/FooAll.cpp",
         "android/hardware/tests/foo/1.0/FooCallbackAll.cpp",
         "android/hardware/tests/foo/1.0/MyTypesAll.cpp",
+        "android/hardware/tests/foo/1.0/SimpleAll.cpp",
         "android/hardware/tests/foo/1.0/TheirTypesAll.cpp",
     ],
 }
@@ -29,6 +31,7 @@
         "IFoo.hal",
         "IFooCallback.hal",
         "IMyTypes.hal",
+        "ISimple.hal",
         "ITheirTypes.hal",
     ],
     out: [
@@ -48,6 +51,11 @@
         "android/hardware/tests/foo/1.0/BnMyTypes.h",
         "android/hardware/tests/foo/1.0/BpMyTypes.h",
         "android/hardware/tests/foo/1.0/BsMyTypes.h",
+        "android/hardware/tests/foo/1.0/ISimple.h",
+        "android/hardware/tests/foo/1.0/IHwSimple.h",
+        "android/hardware/tests/foo/1.0/BnSimple.h",
+        "android/hardware/tests/foo/1.0/BpSimple.h",
+        "android/hardware/tests/foo/1.0/BsSimple.h",
         "android/hardware/tests/foo/1.0/ITheirTypes.h",
         "android/hardware/tests/foo/1.0/IHwTheirTypes.h",
         "android/hardware/tests/foo/1.0/BnTheirTypes.h",
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index 614f1e4..b6ef5c8 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -18,6 +18,7 @@
 
 import IFooCallback;
 import IMyTypes.SomeStruct;
+import ISimple;
 import ITheirTypes.FloatArray;
 
 interface IFoo {
@@ -107,4 +108,9 @@
     sendVec(vec<uint8_t> data) generates (vec<uint8_t> data);
 
     sendVecVec() generates (vec<vec<uint8_t>> vecvec);
+
+    haveAVectorOfInterfaces(vec<ISimple> in) generates (vec<ISimple> out);
+
+    haveAVectorOfGenericInterfaces(vec<interface> in)
+        generates (vec<interface> out);
 };
diff --git a/tests/foo/1.0/ISimple.hal b/tests/foo/1.0/ISimple.hal
new file mode 100644
index 0000000..92e9d95
--- /dev/null
+++ b/tests/foo/1.0/ISimple.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.foo@1.0;
+
+interface ISimple {
+    getCookie() generates (int32_t cookie);
+};
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index 81aa78b..57d4b6b 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -396,6 +396,21 @@
     return Void();
 }
 
+Return<void> Foo::haveAVectorOfInterfaces(
+        const hidl_vec<sp<ISimple> > &in,
+        haveAVectorOfInterfaces_cb _hidl_cb) {
+    _hidl_cb(in);
+
+    return Void();
+}
+
+Return<void> Foo::haveAVectorOfGenericInterfaces(
+        const hidl_vec<sp<android::hardware::IBinder> > &in,
+        haveAVectorOfGenericInterfaces_cb _hidl_cb) {
+    _hidl_cb(in);
+
+    return Void();
+}
 
 IFoo* HIDL_FETCH_IFoo(const char* /* name */) {
     return new Foo();
diff --git a/tests/foo/1.0/default/Foo.h b/tests/foo/1.0/default/Foo.h
index 00a29f5..804a6a3 100644
--- a/tests/foo/1.0/default/Foo.h
+++ b/tests/foo/1.0/default/Foo.h
@@ -15,6 +15,7 @@
 using ::android::hardware::tests::foo::V1_0::Abc;
 using ::android::hardware::tests::foo::V1_0::IFoo;
 using ::android::hardware::tests::foo::V1_0::IFooCallback;
+using ::android::hardware::tests::foo::V1_0::ISimple;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::hardware::hidl_vec;
@@ -45,6 +46,13 @@
     virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb)  override;
     virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb)  override;
 
+    Return<void> haveAVectorOfInterfaces(
+            const hidl_vec<sp<ISimple> > &in,
+            haveAVectorOfInterfaces_cb _hidl_cb) override;
+
+    Return<void> haveAVectorOfGenericInterfaces(
+            const hidl_vec<sp<android::hardware::IBinder> > &in,
+            haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
 };
 
 extern "C" IFoo* HIDL_FETCH_IFoo(const char* name);
diff --git a/tests/foo/1.0/default/FooCallback.cpp b/tests/foo/1.0/default/FooCallback.cpp
index 08d3ce0..d3eef77 100644
--- a/tests/foo/1.0/default/FooCallback.cpp
+++ b/tests/foo/1.0/default/FooCallback.cpp
@@ -1,3 +1,6 @@
+
+#define LOG_TAG "hidl_test"
+
 #include "FooCallback.h"
 #include <android-base/logging.h>
 #include <inttypes.h>
@@ -9,68 +12,111 @@
 namespace V1_0 {
 namespace implementation {
 
+enum {
+    NOT_REPORTED = -1LL
+};
+
+FooCallback::FooCallback()
+        : mLock{}, mCond{} {
+    for (size_t i = 0; i < invokeInfo.size(); i++) {
+        invokeInfo[i].invoked = false;
+        invokeInfo[i].timeNs = NOT_REPORTED;
+        invokeInfo[i].callerBlockedNs = NOT_REPORTED;
+    }
+}
+
 Return<void> FooCallback::heyItsYou(
         const sp<IFooCallback> &_cb) {
     nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) heyItsYou cb = %p", _cb.get());
-    mLock.lock();
-    invokeInfo[0].invoked = true;
-    invokeInfo[0].timeNs = systemTime() - start;
-    mCond.signal();
-    mLock.unlock();
+    ALOGI("SERVER(FooCallback) 1: heyItsYou cb = %p", _cb.get());
+    nsecs_t end = systemTime();
+    {
+        Mutex::Autolock lock(mLock);
+        invokeInfo[0].invoked = true;
+        invokeInfo[0].timeNs = end - start;
+        mCond.signal();
+    }
+    ALOGI("SERVER(FooCallback) 2: heyItsYou returned");
     return Void();
 }
 
 Return<bool> FooCallback::heyItsYouIsntIt(const sp<IFooCallback> &_cb) {
     nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) heyItsYouIsntIt cb = %p sleeping for %" PRId64 " seconds", _cb.get(), DELAY_S);
+    ALOGI("SERVER(FooCallback) 3: heyItsYouIsntIt cb = %p sleeping for %" PRId64 " seconds", _cb.get(), DELAY_S);
     sleep(DELAY_S);
-    ALOGI("SERVER(FooCallback) heyItsYouIsntIt cb = %p responding", _cb.get());
-    mLock.lock();
-    invokeInfo[1].invoked = true;
-    invokeInfo[1].timeNs = systemTime() - start;
-    mCond.signal();
-    mLock.unlock();
+    ALOGI("SERVER(FooCallback) 4: heyItsYouIsntIt cb = %p responding", _cb.get());
+    nsecs_t end = systemTime();
+    {
+        Mutex::Autolock lock(mLock);
+        invokeInfo[1].invoked = true;
+        invokeInfo[1].timeNs = end - start;
+        mCond.signal();
+    }
+    ALOGI("SERVER(FooCallback) 5: heyItsYouIsntIt cb = %p responding", _cb.get());
     return true;
 }
 
 Return<void> FooCallback::heyItsTheMeaningOfLife(uint8_t tmol) {
     nsecs_t start = systemTime();
-    ALOGI("SERVER(FooCallback) heyItsTheMeaningOfLife = %d sleeping for %" PRId64 " seconds", tmol, DELAY_S);
+    ALOGI("SERVER(FooCallback) 6.1: heyItsTheMeaningOfLife = %d sleeping for %" PRId64 " seconds", tmol, DELAY_S);
     sleep(DELAY_S);
-    ALOGI("SERVER(FooCallback) heyItsTheMeaningOfLife = %d done sleeping", tmol);
-    mLock.lock();
-    invokeInfo[2].invoked = true;
-    invokeInfo[2].timeNs = systemTime() - start;
-    mCond.signal();
-    mLock.unlock();
+    ALOGI("SERVER(FooCallback) 6.2: heyItsTheMeaningOfLife = %d done sleeping", tmol);
+    nsecs_t end = systemTime();
+    {
+        Mutex::Autolock lock(mLock);
+        invokeInfo[2].invoked = true;
+        invokeInfo[2].timeNs = end - start;
+        mCond.signal();
+    }
+    ALOGI("SERVER(FooCallback) 6.3: heyItsTheMeaningOfLife returned");
     return Void();
 }
 
 Return<void> FooCallback::reportResults(int64_t ns, reportResults_cb cb) {
-    ALOGI("SERVER(FooCallback) reportResults(%" PRId64 " seconds)", nanoseconds_to_seconds(ns));
+    ALOGI("SERVER(FooCallback) 8.1: reportResults(%" PRId64 " seconds)", nanoseconds_to_seconds(ns));
     nsecs_t leftToWaitNs = ns;
-    mLock.lock();
-    while (!(invokeInfo[0].invoked && invokeInfo[1].invoked && invokeInfo[2].invoked) &&
-           leftToWaitNs > 0) {
-      nsecs_t start = systemTime();
-      ::android::status_t rc = mCond.waitRelative(mLock, leftToWaitNs);
-      if (rc != ::android::OK) {
-          ALOGI("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative(%" PRId64 ") returned error (%d)", ns, leftToWaitNs, rc);
-          break;
-      }
-      ALOGI("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative was signalled", ns);
-      leftToWaitNs -= systemTime() - start;
+    bool cond;
+    {
+        Mutex::Autolock lock(mLock);
+        while ((cond = ((!invokeInfo[0].invoked ||
+                !invokeInfo[1].invoked ||
+                !invokeInfo[2].invoked ||
+                invokeInfo[0].callerBlockedNs == NOT_REPORTED ||
+                invokeInfo[1].callerBlockedNs == NOT_REPORTED ||
+                invokeInfo[2].callerBlockedNs == NOT_REPORTED)   &&
+               leftToWaitNs > 0))) {
+            nsecs_t start = systemTime();
+            ::android::status_t rc = mCond.waitRelative(mLock, leftToWaitNs);
+            if (rc != ::android::OK) {
+                ALOGW("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative(%" PRId64 ") returned error (%d)", ns, leftToWaitNs, rc);
+                if (rc == -ETIMEDOUT) {
+                    // time's up
+                    leftToWaitNs = -1;
+                }
+                break;
+            }
+            ALOGI("SERVER(FooCallback)::reportResults(%" PRId64 " ns) Condition::waitRelative was signalled", ns);
+            leftToWaitNs -= systemTime() - start;
+        }
     }
-    mLock.unlock();
+    ALOGI("SERVER(FooCallback) 8.2: reportResults returned;"
+            "invoked? %d, %d, %d; leftToWaitNs = %" PRId64 "; cond = %d",
+            invokeInfo[0].invoked, invokeInfo[1].invoked, invokeInfo[2].invoked,
+            leftToWaitNs, cond);
     cb(leftToWaitNs, invokeInfo);
     return Void();
 }
 
 Return<void> FooCallback::youBlockedMeFor(const hidl_array<int64_t, 3> &ns) {
-    for (size_t i = 0; i < 3; i++) {
-        invokeInfo[i].callerBlockedNs = ns[i];
+    ALOGI("SERVER(FooCallback) 7.1: youBlockedMeFor");
+    {
+        Mutex::Autolock lock(mLock);
+        for (size_t i = 0; i < 3; i++) {
+            invokeInfo[i].callerBlockedNs = ns[i];
+        }
+        mCond.signal();
     }
+    ALOGI("SERVER(FooCallback) 7.2: returned");
     return Void();
 }
 
diff --git a/tests/foo/1.0/default/FooCallback.h b/tests/foo/1.0/default/FooCallback.h
index 6c284ca..5921972 100644
--- a/tests/foo/1.0/default/FooCallback.h
+++ b/tests/foo/1.0/default/FooCallback.h
@@ -22,7 +22,7 @@
 using ::android::sp;
 
 struct FooCallback : public IFooCallback {
-    FooCallback() : mLock{}, mCond{} {}
+    FooCallback();
     // Methods from ::android::hardware::tests::foo::V1_0::IFooCallback follow.
     Return<void> heyItsYou(const sp<IFooCallback>& cb)  override;
     Return<bool> heyItsYouIsntIt(const sp<IFooCallback>& cb)  override;
diff --git a/thermal/1.0/IThermal.hal b/thermal/1.0/IThermal.hal
index 4697f32..a60bc7d 100644
--- a/thermal/1.0/IThermal.hal
+++ b/thermal/1.0/IThermal.hal
@@ -56,11 +56,11 @@
      *         the status.debugMessage must be populated with the human-readable
      *         error message.
      * @return devices If status code is SUCCESS, it's filled with the current
-     *         cooling device information. The order of built-in coolling
+     *         cooling device information. The order of built-in cooling
      *         devices in the list must be kept the same regardless the number
      *         of calls to this method even if they go offline, if these devices
      *         exist on boot. The method always returns and never removes from
-     *         the list such coolling devices.
+     *         the list such cooling devices.
      *
      */
     getCoolingDevices()
diff --git a/vibrator/1.0/vts/Android.mk b/vibrator/1.0/vts/Android.mk
new file mode 100644
index 0000000..cb70548
--- /dev/null
+++ b/vibrator/1.0/vts/Android.mk
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# build VTS driver for Vibrator v1.0.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_driver_hidl_vibrator@1.0
+
+LOCAL_SRC_FILES := \
+  Vibrator.vts \
+  types.vts \
+
+LOCAL_C_INCLUDES := \
+  android.hardware.vibrator@1.0 \
+  system/core/base/include \
+  system/core/include \
+
+LOCAL_SHARED_LIBRARIES += \
+  android.hardware.vibrator@1.0 \
+  libbase \
+  libutils \
+  libcutils \
+  liblog \
+  libhidl \
+  libhwbinder \
+  libprotobuf-cpp-full \
+  libvts_common \
+  libvts_datatype \
+  libvts_measurement \
+  libvts_multidevice_proto \
+
+LOCAL_CFLAGS += -DENABLE_TREBLE
+
+LOCAL_STATIC_LIBRARIES := \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+LOCAL_MULTILIB := both
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/vibrator/1.0/vts/Vibrator.vts b/vibrator/1.0/vts/Vibrator.vts
new file mode 100644
index 0000000..f1ab053
--- /dev/null
+++ b/vibrator/1.0/vts/Vibrator.vts
@@ -0,0 +1,30 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IVibrator"
+
+package: "android.hardware.vibrator"
+
+import: "android.hardware.vibrator@1.0::types"
+
+interface: {
+    api: {
+        name: "on"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "Status"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "off"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "Status"
+        }
+    }
+
+}
diff --git a/vibrator/1.0/vts/types.vts b/vibrator/1.0/vts/types.vts
new file mode 100644
index 0000000..0eba051
--- /dev/null
+++ b/vibrator/1.0/vts/types.vts
@@ -0,0 +1,24 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.vibrator"
+
+
+attribute: {
+    name: "Status"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "uint32_t"
+
+        enumerator: "OK"
+        scalar_value: {
+            uint32_t: 0
+        }
+        enumerator: "ERR"
+        scalar_value: {
+            uint32_t: 1
+        }
+    }
+}
+