Merge changes from topic "fix-omx-dependencies" am: d429b1f9e7 am: 4e8e84e10b am: 4b5313cbdf
am: c36e35f5a7

Change-Id: Id44fa23e3d441ee10785589ad977f6d7a2d6422d
diff --git a/CleanSpec.mk b/CleanSpec.mk
index dd4cee0..e82fefa 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -60,6 +60,5 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/hw/android.hardware.automotive*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/hw/android.hardware.automotive*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/android.hardware.automotive*)
-$(call add-clean-step, find $(PRODUCT_OUT)/system $(PRODUCT_OUT)/vendor -type f -name "android\.hardware\.configstore\@1\.1*" -print0 | xargs -0 rm -f)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/android.hardware.tests*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk/android.hardware.tests*)
diff --git a/automotive/evs/1.0/vts/functional/Android.bp b/automotive/evs/1.0/vts/functional/Android.bp
index 555ff5b..6ac2458 100644
--- a/automotive/evs/1.0/vts/functional/Android.bp
+++ b/automotive/evs/1.0/vts/functional/Android.bp
@@ -15,7 +15,7 @@
 //
 
 cc_test {
-    name: "VtsHalEvsV1_0Target",
+    name: "VtsHalEvsV1_0TargetTest",
 
     srcs: [
         "VtsHalEvsV1_0TargetTest.cpp",
diff --git a/automotive/vehicle/2.0/Android.mk b/automotive/vehicle/2.0/Android.mk
index 5919487..697d333 100644
--- a/automotive/vehicle/2.0/Android.mk
+++ b/automotive/vehicle/2.0/Android.mk
@@ -15,6 +15,8 @@
 LOCAL_JAVA_LIBRARIES := \
     android.hidl.base-V1.0-java \
 
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES += core-oj hwbinder
 
 #
 # Build types.hal (DiagnosticFloatSensorIndex)
@@ -1291,6 +1293,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android.hidl.base-V1.0-java-static \
 
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj hwbinder
 
 #
 # Build types.hal (DiagnosticFloatSensorIndex)
diff --git a/cas/1.0/Android.mk b/cas/1.0/Android.mk
new file mode 100644
index 0000000..1ff2b04
--- /dev/null
+++ b/cas/1.0/Android.mk
@@ -0,0 +1,150 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.cas-V1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+    android.hidl.base-V1.0-java \
+
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES += core-oj hwbinder
+
+#
+# Build types.hal (HidlCasPluginDescriptor)
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/HidlCasPluginDescriptor.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::types.HidlCasPluginDescriptor
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Status)
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/Status.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::types.Status
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ICas.hal
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/ICas.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ICas.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::ICas
+
+$(GEN): $(LOCAL_PATH)/ICas.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ICasListener.hal
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/ICasListener.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ICasListener.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::ICasListener
+
+$(GEN): $(LOCAL_PATH)/ICasListener.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IDescramblerBase.hal
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/IDescramblerBase.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IDescramblerBase.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::IDescramblerBase
+
+$(GEN): $(LOCAL_PATH)/IDescramblerBase.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IMediaCasService.hal
+#
+GEN := $(intermediates)/android/hardware/cas/V1_0/IMediaCasService.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IMediaCasService.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ICas.hal
+$(GEN): $(LOCAL_PATH)/ICas.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ICasListener.hal
+$(GEN): $(LOCAL_PATH)/ICasListener.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IDescramblerBase.hal
+$(GEN): $(LOCAL_PATH)/IDescramblerBase.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.cas@1.0::IMediaCasService
+
+$(GEN): $(LOCAL_PATH)/IMediaCasService.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/cas/1.0/CasHal.mk b/cas/1.0/CasHal.mk
deleted file mode 100644
index 3cae6bf..0000000
--- a/cas/1.0/CasHal.mk
+++ /dev/null
@@ -1,192 +0,0 @@
-#
-# 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.
-
-
-########################################################################
-# Included by frameworks/base for MediaCas. Hidl HAL can't be linked as
-# Java lib from frameworks because it has dependency on frameworks itself.
-#
-
-intermediates := $(TARGET_OUT_COMMON_GEN)/JAVA_LIBRARIES/android.hardware.cas-V1.0-java_intermediates
-
-HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
-HIDL_PATH := system/libhidl/transport/base/1.0
-
-#
-# Build types.hal (DebugInfo)
-#
-GEN := $(intermediates)/android/hidl/base/V1_0/DebugInfo.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hidl:system/libhidl/transport \
-        android.hidl.base@1.0::types.DebugInfo
-
-$(GEN): $(HIDL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build IBase.hal
-#
-GEN := $(intermediates)/android/hidl/base/V1_0/IBase.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/IBase.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/types.hal
-$(GEN): $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hidl:system/libhidl/transport \
-        android.hidl.base@1.0::IBase
-
-$(GEN): $(HIDL_PATH)/IBase.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-HIDL_PATH := hardware/interfaces/cas/1.0
-
-#
-# Build types.hal (HidlCasPluginDescriptor)
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/HidlCasPluginDescriptor.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::types.HidlCasPluginDescriptor
-
-$(GEN): $(HIDL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (Status)
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/Status.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::types.Status
-
-$(GEN): $(HIDL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build ICas.hal
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/ICas.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/ICas.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/types.hal
-$(GEN): $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::ICas
-
-$(GEN): $(HIDL_PATH)/ICas.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build ICasListener.hal
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/ICasListener.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/ICasListener.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::ICasListener
-
-$(GEN): $(HIDL_PATH)/ICasListener.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build IDescramblerBase.hal
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/IDescramblerBase.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/IDescramblerBase.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/types.hal
-$(GEN): $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::IDescramblerBase
-
-$(GEN): $(HIDL_PATH)/IDescramblerBase.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build IMediaCasService.hal
-#
-GEN := $(intermediates)/android/hardware/cas/V1_0/IMediaCasService.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(HIDL_PATH)/IMediaCasService.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/ICas.hal
-$(GEN): $(HIDL_PATH)/ICas.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/ICasListener.hal
-$(GEN): $(HIDL_PATH)/ICasListener.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/IDescramblerBase.hal
-$(GEN): $(HIDL_PATH)/IDescramblerBase.hal
-$(GEN): PRIVATE_DEPS += $(HIDL_PATH)/types.hal
-$(GEN): $(HIDL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.cas@1.0::IMediaCasService
-
-$(GEN): $(HIDL_PATH)/IMediaCasService.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
diff --git a/compatibility_matrix.26.xml b/compatibility_matrix.26.xml
index 5c81f26..6692de0 100644
--- a/compatibility_matrix.26.xml
+++ b/compatibility_matrix.26.xml
@@ -81,7 +81,7 @@
     </hal>
     <hal format="hidl" optional="false">
         <name>android.hardware.configstore</name>
-        <version>1.0</version>
+        <version>1.0-1</version>
         <interface>
             <name>ISurfaceFlingerConfigs</name>
             <instance>default</instance>
diff --git a/compatibility_matrix.current.xml b/compatibility_matrix.current.xml
index 5c81f26..6692de0 100644
--- a/compatibility_matrix.current.xml
+++ b/compatibility_matrix.current.xml
@@ -81,7 +81,7 @@
     </hal>
     <hal format="hidl" optional="false">
         <name>android.hardware.configstore</name>
-        <version>1.0</version>
+        <version>1.0-1</version>
         <interface>
             <name>ISurfaceFlingerConfigs</name>
             <instance>default</instance>
diff --git a/compatibility_matrix.legacy.xml b/compatibility_matrix.legacy.xml
index 5655fb9..5f06a8e 100644
--- a/compatibility_matrix.legacy.xml
+++ b/compatibility_matrix.legacy.xml
@@ -81,7 +81,7 @@
     </hal>
     <hal format="hidl" optional="false">
         <name>android.hardware.configstore</name>
-        <version>1.0</version>
+        <version>1.0-1</version>
         <interface>
             <name>ISurfaceFlingerConfigs</name>
             <instance>default</instance>
diff --git a/configstore/1.0/default/android.hardware.configstore@1.0-service.rc b/configstore/1.0/default/android.hardware.configstore@1.0-service.rc
deleted file mode 100644
index 563d854..0000000
--- a/configstore/1.0/default/android.hardware.configstore@1.0-service.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service configstore-hal-1-0 /vendor/bin/hw/android.hardware.configstore@1.0-service
-    class hal animation
-    user system
-    group system
diff --git a/configstore/1.1/Android.bp b/configstore/1.1/Android.bp
new file mode 100644
index 0000000..92fb7c1
--- /dev/null
+++ b/configstore/1.1/Android.bp
@@ -0,0 +1,64 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+    name: "android.hardware.configstore@1.1_hal",
+    srcs: [
+        "ISurfaceFlingerConfigs.hal",
+    ],
+}
+
+genrule {
+    name: "android.hardware.configstore@1.1_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.1",
+    srcs: [
+        ":android.hardware.configstore@1.1_hal",
+    ],
+    out: [
+        "android/hardware/configstore/1.1/SurfaceFlingerConfigsAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.configstore@1.1_genc++_headers",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.1",
+    srcs: [
+        ":android.hardware.configstore@1.1_hal",
+    ],
+    out: [
+        "android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h",
+        "android/hardware/configstore/1.1/IHwSurfaceFlingerConfigs.h",
+        "android/hardware/configstore/1.1/BnHwSurfaceFlingerConfigs.h",
+        "android/hardware/configstore/1.1/BpHwSurfaceFlingerConfigs.h",
+        "android/hardware/configstore/1.1/BsSurfaceFlingerConfigs.h",
+    ],
+}
+
+cc_library {
+    name: "android.hardware.configstore@1.1",
+    defaults: ["hidl-module-defaults"],
+    generated_sources: ["android.hardware.configstore@1.1_genc++"],
+    generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
+    export_generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "android.hardware.configstore@1.0",
+    ],
+    export_shared_lib_headers: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hardware.configstore@1.0",
+    ],
+}
diff --git a/configstore/1.1/Android.mk b/configstore/1.1/Android.mk
new file mode 100644
index 0000000..b3f7053
--- /dev/null
+++ b/configstore/1.1/Android.mk
@@ -0,0 +1,44 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.configstore-V1.1-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+    android.hardware.configstore-V1.0-java \
+    android.hidl.base-V1.0-java \
+
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES += core-oj hwbinder
+
+#
+# Build ISurfaceFlingerConfigs.hal
+#
+GEN := $(intermediates)/android/hardware/configstore/V1_1/ISurfaceFlingerConfigs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.configstore@1.1::ISurfaceFlingerConfigs
+
+$(GEN): $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/configstore/1.1/ISurfaceFlingerConfigs.hal b/configstore/1.1/ISurfaceFlingerConfigs.hal
new file mode 100644
index 0000000..5eacbe0
--- /dev/null
+++ b/configstore/1.1/ISurfaceFlingerConfigs.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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.configstore@1.1;
+
+import @1.0::ISurfaceFlingerConfigs;
+
+/**
+ * New revision of ISurfaceFlingerConfigs
+ */
+
+interface ISurfaceFlingerConfigs extends @1.0::ISurfaceFlingerConfigs {
+};
diff --git a/configstore/1.0/default/Android.mk b/configstore/1.1/default/Android.mk
similarity index 70%
rename from configstore/1.0/default/Android.mk
rename to configstore/1.1/default/Android.mk
index 8b24031..58b67c1 100644
--- a/configstore/1.0/default/Android.mk
+++ b/configstore/1.1/default/Android.mk
@@ -2,18 +2,19 @@
 
 ################################################################################
 include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.0-service
-LOCAL_REQUIRED_MODULES_arm64 := configstore@1.0.policy
+LOCAL_MODULE := android.hardware.configstore@1.1-service
+LOCAL_REQUIRED_MODULES_arm64 := configstore@1.1.policy
 LOCAL_PROPRIETARY_MODULE := true
 LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.configstore@1.0-service.rc
+LOCAL_INIT_RC := android.hardware.configstore@1.1-service.rc
 LOCAL_SRC_FILES:= service.cpp
 
 include $(LOCAL_PATH)/surfaceflinger.mk
 
 LOCAL_SHARED_LIBRARIES := \
     android.hardware.configstore@1.0 \
+    android.hardware.configstore@1.1 \
     libhidlbase \
     libhidltransport \
     libbase \
@@ -26,9 +27,9 @@
 # seccomp filter for configstore
 ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm64))
 include $(CLEAR_VARS)
-LOCAL_MODULE := configstore@1.0.policy
+LOCAL_MODULE := configstore@1.1.policy
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/seccomp_policy
-LOCAL_SRC_FILES := seccomp_policy/configstore@1.0-$(TARGET_ARCH).policy
+LOCAL_SRC_FILES := seccomp_policy/configstore@1.1-$(TARGET_ARCH).policy
 include $(BUILD_PREBUILT)
 endif
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.cpp b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
similarity index 96%
rename from configstore/1.0/default/SurfaceFlingerConfigs.cpp
rename to configstore/1.1/default/SurfaceFlingerConfigs.cpp
index 3239274..5a040f2 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.cpp
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
@@ -19,7 +19,7 @@
 namespace android {
 namespace hardware {
 namespace configstore {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 
 // Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs
@@ -139,10 +139,13 @@
     return Void();
 }
 
+// Methods from ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs
+// follow.
+
 // Methods from ::android::hidl::base::V1_0::IBase follow.
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace configstore
 }  // namespace hardware
 }  // namespace android
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.h b/configstore/1.1/default/SurfaceFlingerConfigs.h
similarity index 77%
rename from configstore/1.0/default/SurfaceFlingerConfigs.h
rename to configstore/1.1/default/SurfaceFlingerConfigs.h
index 32e5fc3..53e8ae8 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.h
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.h
@@ -1,17 +1,17 @@
-#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
-#define ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
+#define ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
 
-#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
 #include <hidl/MQDescriptor.h>
 #include <hidl/Status.h>
 
 namespace android {
 namespace hardware {
 namespace configstore {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 
-using ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
+using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::sp;
@@ -32,13 +32,16 @@
     Return<void> maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) override;
     Return<void> startGraphicsAllocatorService(startGraphicsAllocatorService_cb _hidl_cb) override;
 
+    // Methods from
+    // ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs follow.
+
     // Methods from ::android::hidl::base::V1_0::IBase follow.
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace configstore
 }  // namespace hardware
 }  // namespace android
 
-#endif  // ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
+#endif  // ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
diff --git a/configstore/1.1/default/android.hardware.configstore@1.1-service.rc b/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
new file mode 100644
index 0000000..018ef10
--- /dev/null
+++ b/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
@@ -0,0 +1,4 @@
+service configstore-hal /vendor/bin/hw/android.hardware.configstore@1.1-service
+    class hal animation
+    user system
+    group system
diff --git a/configstore/1.0/default/seccomp_policy/configstore@1.0-arm64.policy b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
similarity index 100%
rename from configstore/1.0/default/seccomp_policy/configstore@1.0-arm64.policy
rename to configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
diff --git a/configstore/1.0/default/service.cpp b/configstore/1.1/default/service.cpp
similarity index 80%
rename from configstore/1.0/default/service.cpp
rename to configstore/1.1/default/service.cpp
index c9c81a0..535e0cd 100644
--- a/configstore/1.0/default/service.cpp
+++ b/configstore/1.1/default/service.cpp
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.configstore@1.0-service"
+#define LOG_TAG "android.hardware.configstore@1.1-service"
 
-#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
 #include <hidl/HidlTransportSupport.h>
 #include <hwminijail/HardwareMinijail.h>
 
@@ -24,8 +24,8 @@
 
 using android::hardware::configureRpcThreadpool;
 using android::hardware::joinRpcThreadpool;
-using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
-using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
 using android::hardware::SetupMinijail;
 using android::sp;
 using android::status_t;
@@ -34,7 +34,7 @@
 int main() {
     configureRpcThreadpool(10, true);
 
-    SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.0.policy");
+    SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.1.policy");
 
     sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
     status_t status = surfaceFlingerConfigs->registerAsService();
diff --git a/configstore/1.0/default/surfaceflinger.mk b/configstore/1.1/default/surfaceflinger.mk
similarity index 100%
rename from configstore/1.0/default/surfaceflinger.mk
rename to configstore/1.1/default/surfaceflinger.mk
diff --git a/configstore/1.1/vts/functional/Android.bp b/configstore/1.1/vts/functional/Android.bp
new file mode 100644
index 0000000..59beb09
--- /dev/null
+++ b/configstore/1.1/vts/functional/Android.bp
@@ -0,0 +1,26 @@
+//
+// 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: "VtsHalConfigstoreV1_1TargetTest",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: ["VtsHalConfigstoreV1_1TargetTest.cpp"],
+    static_libs: [
+        "android.hardware.configstore@1.0",
+        "android.hardware.configstore@1.1",
+    ],
+}
+
diff --git a/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp b/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp
new file mode 100644
index 0000000..bd3da4c
--- /dev/null
+++ b/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp
@@ -0,0 +1,55 @@
+/*
+ * 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 "ConfigstoreHidlHalTest"
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <android-base/logging.h>
+#include <android/hardware/configstore/1.0/types.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
+#include <unistd.h>
+
+using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using ::android::sp;
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
+
+class ConfigstoreHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+   public:
+    sp<ISurfaceFlingerConfigs> sfConfigs;
+
+    virtual void SetUp() override {
+        sfConfigs = ::testing::VtsHalHidlTargetTestBase::getService<ISurfaceFlingerConfigs>();
+        ASSERT_NE(sfConfigs, nullptr);
+    }
+
+    virtual void TearDown() override {}
+};
+
+/**
+ * Placeholder testcase.
+ */
+TEST_F(ConfigstoreHidlTest, Test) {
+    ASSERT_TRUE(true);
+}
+
+int main(int argc, char** argv) {
+    ::testing::InitGoogleTest(&argc, argv);
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+    return status;
+}
diff --git a/configstore/Android.bp b/configstore/Android.bp
index ba3e62e..4a783c3 100644
--- a/configstore/Android.bp
+++ b/configstore/Android.bp
@@ -2,5 +2,7 @@
 subdirs = [
     "1.0",
     "1.0/vts/functional",
+    "1.1",
+    "1.1/vts/functional",
     "utils",
 ]
diff --git a/contexthub/1.0/default/OWNERS b/contexthub/1.0/default/OWNERS
new file mode 100644
index 0000000..49a3204
--- /dev/null
+++ b/contexthub/1.0/default/OWNERS
@@ -0,0 +1,2 @@
+ashutoshj@google.com
+bduddie@google.com
diff --git a/contexthub/1.0/vts/functional/OWNERS b/contexthub/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..ad036b4
--- /dev/null
+++ b/contexthub/1.0/vts/functional/OWNERS
@@ -0,0 +1,7 @@
+#Context Hub team
+ashutoshj@google.com
+bduddie@google.com
+
+#VTS team
+yim@google.com
+trong@google.com
diff --git a/current.txt b/current.txt
index f045fd8..b04468d 100644
--- a/current.txt
+++ b/current.txt
@@ -196,6 +196,7 @@
 e822cb7f4a1bdd45689c5e92ccd19a2201c20b771bd4b2ec1ae627e324591f9d android.hardware.radio@1.0::IRadioResponse
 6e69adb24d7c0b0ca3a54a38c49a5625b161b3f5d5f7d6fda0befdbbfc8e9e06 android.hardware.radio@1.0::IRadioResponse
 28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
+bfd81bcafa3c97519cd56ad29e9fa48e23d1d323b89dbcc85899282a8c628194 android.hardware.automotive.vehicle@2.0::types
 df1d7b27e644bfed0a4f606a8c44d35d45cafce82c7c648494c8a25c7cd4a949 android.hardware.wifi@1.0::types
 
 # HALs released in Android O MR1 (Initial Set)
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index cfcee24..f362749 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -508,7 +508,7 @@
         const AGpsRilInterface* agpsRilIface = static_cast<const AGpsRilInterface*>(
                 mGnssIface->get_extension(AGPS_RIL_INTERFACE));
         if (agpsRilIface == nullptr) {
-            ALOGE("%s GnssRil interface not implemented by GNSS HAL", __func__);
+            ALOGI("%s: GnssRil interface not implemented by HAL", __func__);
         } else {
             mGnssRil = new AGnssRil(agpsRilIface);
         }
@@ -528,7 +528,7 @@
                         mGnssIface->get_extension(GNSS_CONFIGURATION_INTERFACE));
 
         if (gnssConfigIface == nullptr) {
-            ALOGE("%s GnssConfiguration interface not implemented by GNSS HAL", __func__);
+            ALOGE("%s: GnssConfiguration interface not implemented by HAL", __func__);
         } else {
             mGnssConfig = new GnssConfiguration(gnssConfigIface);
         }
@@ -548,7 +548,7 @@
                         mGnssIface->get_extension(GPS_GEOFENCING_INTERFACE));
 
         if (gpsGeofencingIface == nullptr) {
-            ALOGE("%s GnssGeofencing interface not implemented by GNSS HAL", __func__);
+            ALOGE("%s: GnssGeofencing interface not implemented by HAL", __func__);
         } else {
             mGnssGeofencingIface = new GnssGeofencing(gpsGeofencingIface);
         }
@@ -567,7 +567,7 @@
         const AGpsInterface* agpsIface = static_cast<const AGpsInterface*>(
                 mGnssIface->get_extension(AGPS_INTERFACE));
         if (agpsIface == nullptr) {
-            ALOGE("%s AGnss interface not implemented by GNSS HAL", __func__);
+            ALOGE("%s: AGnss interface not implemented by HAL", __func__);
         } else {
             mAGnssIface = new AGnss(agpsIface);
         }
@@ -585,7 +585,7 @@
         const GpsNiInterface* gpsNiIface = static_cast<const GpsNiInterface*>(
                 mGnssIface->get_extension(GPS_NI_INTERFACE));
         if (gpsNiIface == nullptr) {
-            ALOGE("%s GnssNi interface not implemented by GNSS HAL", __func__);
+            ALOGI("%s: GnssNi interface not implemented by HAL", __func__);
         } else {
             mGnssNi = new GnssNi(gpsNiIface);
         }
@@ -605,7 +605,7 @@
                         mGnssIface->get_extension(GPS_MEASUREMENT_INTERFACE));
 
         if (gpsMeasurementIface == nullptr) {
-            ALOGE("%s GnssMeasurement interface not implemented by GNSS HAL", __func__);
+            ALOGE("%s: GnssMeasurement interface not implemented by HAL", __func__);
         } else {
             mGnssMeasurement = new GnssMeasurement(gpsMeasurementIface);
         }
@@ -625,8 +625,7 @@
                         mGnssIface->get_extension(GPS_NAVIGATION_MESSAGE_INTERFACE));
 
         if (gpsNavigationMessageIface == nullptr) {
-            ALOGE("%s GnssNavigationMessage interface not implemented by GNSS HAL",
-                  __func__);
+            ALOGI("%s: GnssNavigationMessage interface not implemented by HAL", __func__);
         } else {
             mGnssNavigationMessage = new GnssNavigationMessage(gpsNavigationMessageIface);
         }
@@ -646,7 +645,7 @@
                 mGnssIface->get_extension(GPS_XTRA_INTERFACE));
 
         if (gpsXtraIface == nullptr) {
-            ALOGE("%s GnssXtra interface not implemented by HAL", __func__);
+            ALOGI("%s: GnssXtra interface not implemented by HAL", __func__);
         } else {
             mGnssXtraIface = new GnssXtra(gpsXtraIface);
         }
@@ -666,7 +665,7 @@
                 mGnssIface->get_extension(GPS_DEBUG_INTERFACE));
 
         if (gpsDebugIface == nullptr) {
-            ALOGE("%s: GnssDebug interface is not implemented by HAL", __func__);
+            ALOGI("%s: GnssDebug interface not implemented by HAL", __func__);
         } else {
             mGnssDebug = new GnssDebug(gpsDebugIface);
         }
diff --git a/graphics/composer/2.1/vts/OWNERS b/graphics/composer/2.1/vts/OWNERS
new file mode 100644
index 0000000..ef69d7c
--- /dev/null
+++ b/graphics/composer/2.1/vts/OWNERS
@@ -0,0 +1,6 @@
+# Graphics team
+olv@google.com
+
+# VTS team
+yim@google.com
+zhuoyao@google.com
\ No newline at end of file
diff --git a/graphics/mapper/2.0/vts/OWNERS b/graphics/mapper/2.0/vts/OWNERS
new file mode 100644
index 0000000..ef69d7c
--- /dev/null
+++ b/graphics/mapper/2.0/vts/OWNERS
@@ -0,0 +1,6 @@
+# Graphics team
+olv@google.com
+
+# VTS team
+yim@google.com
+zhuoyao@google.com
\ No newline at end of file
diff --git a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
index 78353ea..ea98264 100644
--- a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -1774,7 +1774,7 @@
                                              .Authorization(TAG_NO_AUTH_REQUIRED)
                                              .EcdsaSigningKey(224)
                                              .Digest(Digest::NONE)));
-    string message(64 * 1024, 'a');
+    string message(2 * 1024, 'a');
     SignMessage(message, AuthorizationSetBuilder().Digest(Digest::NONE));
 }
 
@@ -2279,8 +2279,7 @@
  * Verifies that attempting to export RSA keys from corrupted key blobs fails.  This is essentially
  * a poor-man's key blob fuzzer.
  */
-// Disabled due to b/33385206
-TEST_F(ExportKeyTest, DISABLED_RsaCorruptedKeyBlob) {
+TEST_F(ExportKeyTest, RsaCorruptedKeyBlob) {
     ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
                                              .Authorization(TAG_NO_AUTH_REQUIRED)
                                              .RsaSigningKey(1024, 3)
@@ -2303,8 +2302,7 @@
  * Verifies that attempting to export ECDSA keys from corrupted key blobs fails.  This is
  * essentially a poor-man's key blob fuzzer.
  */
-// Disabled due to b/33385206
-TEST_F(ExportKeyTest, DISABLED_EcCorruptedKeyBlob) {
+TEST_F(ExportKeyTest, EcCorruptedKeyBlob) {
     ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
                                              .Authorization(TAG_NO_AUTH_REQUIRED)
                                              .EcdsaSigningKey(EcCurve::P_256)
@@ -2607,7 +2605,7 @@
 }
 
 /*
- * EncryptionOperationsTest.RsaNoPaddingTooLong
+ * EncryptionOperationsTest.RsaNoPaddingTooLarge
  *
  * Verifies that raw RSA encryption of too-large (numerically) messages fails in the expected way.
  */
@@ -3907,7 +3905,7 @@
  * Verifies that the addRngEntropy method doesn't blow up when given a largish amount of data.
  */
 TEST_F(AddEntropyTest, AddLargeEntropy) {
-    EXPECT_EQ(ErrorCode::OK, keymaster().addRngEntropy(HidlBuf(string(16 * 1024, 'a'))));
+    EXPECT_EQ(ErrorCode::OK, keymaster().addRngEntropy(HidlBuf(string(2 * 1024, 'a'))));
 }
 
 typedef KeymasterHidlTest AttestationTest;
diff --git a/light/2.0/default/Android.bp b/light/2.0/default/Android.bp
new file mode 100644
index 0000000..8d4eca1
--- /dev/null
+++ b/light/2.0/default/Android.bp
@@ -0,0 +1,53 @@
+// 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_library_shared {
+    name: "android.hardware.light@2.0-impl",
+    defaults: ["hidl_defaults"],
+    proprietary: true,
+    relative_install_path: "hw",
+    srcs: ["Light.cpp"],
+
+    shared_libs: [
+        "libbase",
+        "liblog",
+        "libhidlbase",
+        "libhidltransport",
+        "libhardware",
+        "libutils",
+        "android.hardware.light@2.0",
+    ],
+
+}
+
+cc_binary {
+    relative_install_path: "hw",
+    defaults: ["hidl_defaults"],
+    proprietary: true,
+    name: "android.hardware.light@2.0-service",
+    init_rc: ["android.hardware.light@2.0-service.rc"],
+    srcs: ["service.cpp"],
+
+    shared_libs: [
+        "liblog",
+        "libbase",
+        "libdl",
+        "libutils",
+        "libhardware",
+        "libhidlbase",
+        "libhidltransport",
+        "android.hardware.light@2.0",
+    ],
+
+}
\ No newline at end of file
diff --git a/light/2.0/default/Android.mk b/light/2.0/default/Android.mk
deleted file mode 100644
index 1f44e66..0000000
--- a/light/2.0/default/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.light@2.0-impl
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := \
-    Light.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
-    libhidlbase \
-    libhidltransport \
-    libutils \
-    liblog \
-    libcutils \
-    libhardware \
-    libbase \
-    libcutils \
-    android.hardware.light@2.0 \
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE := android.hardware.light@2.0-service
-LOCAL_INIT_RC := android.hardware.light@2.0-service.rc
-LOCAL_SRC_FILES := \
-    service.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
-    liblog \
-    libcutils \
-    libdl \
-    libbase \
-    libutils \
-    libhardware \
-
-LOCAL_SHARED_LIBRARIES += \
-    libhidlbase \
-    libhidltransport \
-    android.hardware.light@2.0 \
-
-include $(BUILD_EXECUTABLE)
diff --git a/light/Android.bp b/light/Android.bp
index 8d2c986..654bb80 100644
--- a/light/Android.bp
+++ b/light/Android.bp
@@ -1,5 +1,6 @@
 // This is an autogenerated file, do not edit.
 subdirs = [
     "2.0",
+    "2.0/default",
     "2.0/vts/functional",
 ]
diff --git a/media/omx/1.0/vts/OWNERS b/media/omx/1.0/vts/OWNERS
new file mode 100644
index 0000000..e0e0dd1
--- /dev/null
+++ b/media/omx/1.0/vts/OWNERS
@@ -0,0 +1,7 @@
+# Media team
+pawin@google.com
+lajos@google.com
+
+# VTS team
+yim@google.com
+zhuoyao@google.com
\ No newline at end of file
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
index 8520757..6ea5943 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
@@ -716,7 +716,7 @@
 }
 
 // port format enumeration
-TEST_F(AudioDecHidlTest, DISABLED_EnumeratePortFormat) {
+TEST_F(AudioDecHidlTest, EnumeratePortFormat) {
     description("Test Component on Mandatory Port Parameters (Port Format)");
     if (disableTest) return;
     android::hardware::media::omx::V1_0::Status status;
@@ -822,11 +822,7 @@
 }
 
 // end of sequence test
-// SPECIAL CASE; Sending Empty input EOS buffer is not supported across all
-// components. For instance soft vorbis and soft opus expects CSD buffers at
-// the start. Disabling this test for now. We shall revisit this at a later
-// stage
-TEST_F(AudioDecHidlTest, DISABLED_EOSTest_M) {
+TEST_F(AudioDecHidlTest, EOSTest_M) {
     description("Test end of stream monkeying");
     if (disableTest) return;
     android::hardware::media::omx::V1_0::Status status;
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
index 038830d..6267d41 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
@@ -454,7 +454,7 @@
 }
 
 // port format enumeration
-TEST_F(AudioEncHidlTest, DISABLED_EnumeratePortFormat) {
+TEST_F(AudioEncHidlTest, EnumeratePortFormat) {
     description("Test Component on Mandatory Port Parameters (Port Format)");
     if (disableTest) return;
     android::hardware::media::omx::V1_0::Status status;
diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
index 235cfef..d88d444 100644
--- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
+++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
@@ -290,7 +290,7 @@
 }
 
 // port format enumeration
-TEST_F(ComponentHidlTest, DISABLED_EnumeratePortFormat) {
+TEST_F(ComponentHidlTest, EnumeratePortFormat) {
     description("Test Component on Mandatory Port Parameters (Port Format)");
     if (disableTest) return;
     android::hardware::media::omx::V1_0::Status status;
@@ -350,7 +350,7 @@
 }
 
 // get/set default port settings of a component
-TEST_F(ComponentHidlTest, DISABLED_SetDefaultPortParams) {
+TEST_F(ComponentHidlTest, SetDefaultPortParams) {
     description(
         "Test Component on Mandatory Port Parameters (Port Definition)");
     if (disableTest) return;
@@ -583,6 +583,67 @@
                             kPortIndexInput, kPortIndexOutput);
 }
 
+// test port mode configuration when the component is in various states
+TEST_F(ComponentHidlTest, PortModeConfig) {
+    description("Test Port Mode Configuration");
+    if (disableTest) return;
+    android::hardware::media::omx::V1_0::Status status;
+    uint32_t kPortIndexInput = 0, kPortIndexOutput = 1;
+    Message msg;
+
+    status = setRole(omxNode, gEnv->getRole().c_str());
+    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    OMX_PORT_PARAM_TYPE params;
+    if (compClass == audio_decoder || compClass == audio_encoder) {
+        status = getParam(omxNode, OMX_IndexParamAudioInit, &params);
+    } else {
+        status = getParam(omxNode, OMX_IndexParamVideoInit, &params);
+    }
+    if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+        ASSERT_EQ(params.nPorts, 2U);
+        kPortIndexInput = params.nStartPortNumber;
+        kPortIndexOutput = kPortIndexInput + 1;
+    }
+
+    android::Vector<BufferInfo> iBuffer, oBuffer;
+
+    // set port mode
+    PortMode portMode[2];
+    initPortMode(portMode, isSecure, compClass);
+    status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+    // set state to idle
+    changeStateLoadedtoIdle(omxNode, observer, &iBuffer, &oBuffer,
+                            kPortIndexInput, kPortIndexOutput, portMode);
+    // Only Allow Port Mode configuration in loaded state
+    status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+    EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+    EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+    // set state to executing
+    changeStateIdletoExecute(omxNode, observer);
+    // Only Allow Port Mode configuration in loaded state
+    status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+    EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+    EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+    // set state to idle
+    changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
+    // set state to loaded
+    changeStateIdletoLoaded(omxNode, observer, &iBuffer, &oBuffer,
+                            kPortIndexInput, kPortIndexOutput);
+
+    status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+}
+
 // state transitions test
 TEST_F(ComponentHidlTest, StateTransitions) {
     description("Test State Transitions Loaded<->Idle<->Execute");
diff --git a/power/1.1/default/Android.bp b/power/1.1/default/Android.bp
deleted file mode 100644
index 0b3598b..0000000
--- a/power/1.1/default/Android.bp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-cc_binary {
-    proprietary: true,
-    defaults: ["hidl_defaults"],
-    relative_install_path: "hw",
-    name: "android.hardware.power@1.1-service",
-    init_rc: ["android.hardware.power@1.1-service.rc"],
-    srcs: ["service.cpp" , "Power.cpp"],
-
-    shared_libs: [
-        "liblog",
-        "libdl",
-        "libutils",
-        "libhardware",
-        "libhidlbase",
-        "libhidltransport",
-        "android.hardware.power@1.0",
-        "android.hardware.power@1.1",
-    ],
-}
diff --git a/power/1.1/default/Power.cpp b/power/1.1/default/Power.cpp
deleted file mode 100644
index b5d0c84..0000000
--- a/power/1.1/default/Power.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "android.hardware.power@1.1-impl"
-
-#include <log/log.h>
-
-#include <hardware/hardware.h>
-#include <hardware/power.h>
-
-#include "Power.h"
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_0::PowerHint;
-using ::android::hardware::power::V1_0::PowerStatePlatformSleepState;
-using ::android::hardware::power::V1_0::Status;
-using ::android::hardware::power::V1_1::PowerStateSubsystem;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-Power::Power(power_module_t *module) : mModule(module) {
-    if (mModule)
-        mModule->init(mModule);
-}
-
-Power::~Power() {
-    delete(mModule);
-}
-
-// Methods from ::android::hardware::power::V1_0::IPower follow.
-Return<void> Power::setInteractive(bool interactive)  {
-    if (mModule->setInteractive)
-        mModule->setInteractive(mModule, interactive ? 1 : 0);
-    return Void();
-}
-
-Return<void> Power::powerHint(PowerHint hint, int32_t data)  {
-    int32_t param = data;
-    if (mModule->powerHint) {
-        if (data)
-            mModule->powerHint(mModule, static_cast<power_hint_t>(hint), &param);
-        else
-            mModule->powerHint(mModule, static_cast<power_hint_t>(hint), NULL);
-    }
-    return Void();
-}
-
-Return<void> Power::setFeature(Feature feature, bool activate)  {
-    if (mModule->setFeature)
-        mModule->setFeature(mModule, static_cast<feature_t>(feature),
-                activate ? 1 : 0);
-    return Void();
-}
-
-Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb)  {
-    hidl_vec<PowerStatePlatformSleepState> states;
-    ssize_t number_platform_modes;
-    size_t *voters = nullptr;
-    power_state_platform_sleep_state_t *legacy_states = nullptr;
-    int ret;
-
-    if (mModule->get_number_of_platform_modes == nullptr ||
-            mModule->get_voter_list == nullptr ||
-            mModule->get_platform_low_power_stats == nullptr)
-    {
-        _hidl_cb(states, Status::SUCCESS);
-        return Void();
-    }
-
-    number_platform_modes = mModule->get_number_of_platform_modes(mModule);
-    if (number_platform_modes)
-    {
-       if ((ssize_t) (SIZE_MAX / sizeof(size_t)) <= number_platform_modes)  // overflow
-           goto done;
-       voters = new (std::nothrow) size_t [number_platform_modes];
-       if (voters == nullptr)
-           goto done;
-
-       ret = mModule->get_voter_list(mModule, voters);
-       if (ret != 0)
-           goto done;
-
-       if ((ssize_t) (SIZE_MAX / sizeof(power_state_platform_sleep_state_t))
-           <= number_platform_modes)  // overflow
-           goto done;
-       legacy_states = new (std::nothrow)
-           power_state_platform_sleep_state_t [number_platform_modes];
-       if (legacy_states == nullptr)
-           goto done;
-
-       for (int i = 0; i < number_platform_modes; i++)
-       {
-          legacy_states[i].voters = nullptr;
-          legacy_states[i].voters = new power_state_voter_t [voters[i]];
-          if (legacy_states[i].voters == nullptr)
-              goto done;
-       }
-
-       ret = mModule->get_platform_low_power_stats(mModule, legacy_states);
-       if (ret != 0)
-           goto done;
-
-       states.resize(number_platform_modes);
-       for (int i = 0; i < number_platform_modes; i++)
-       {
-          power_state_platform_sleep_state_t& legacy_state = legacy_states[i];
-          PowerStatePlatformSleepState& state = states[i];
-          state.name = legacy_state.name;
-          state.residencyInMsecSinceBoot = legacy_state.residency_in_msec_since_boot;
-          state.totalTransitions = legacy_state.total_transitions;
-          state.supportedOnlyInSuspend = legacy_state.supported_only_in_suspend;
-          state.voters.resize(voters[i]);
-          for(size_t j = 0; j < voters[i]; j++)
-          {
-              state.voters[j].name = legacy_state.voters[j].name;
-              state.voters[j].totalTimeInMsecVotedForSinceBoot = legacy_state.voters[j].total_time_in_msec_voted_for_since_boot;
-              state.voters[j].totalNumberOfTimesVotedSinceBoot = legacy_state.voters[j].total_number_of_times_voted_since_boot;
-          }
-       }
-    }
-done:
-    if (legacy_states)
-    {
-        for (int i = 0; i < number_platform_modes; i++)
-        {
-            if(legacy_states[i].voters)
-                delete(legacy_states[i].voters);
-        }
-    }
-    delete[] legacy_states;
-    delete[] voters;
-    _hidl_cb(states, Status::SUCCESS);
-    return Void();
-}
-
-// Methods from ::android::hardware::power::V1_1::IPower follow.
-Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
-    hidl_vec<PowerStateSubsystem> subsystems;
-    ssize_t number_subsystems = 0;
-
-    //This API will report zero subsystems to support older devices
-    //For devices that support this API, they will have their own implementation
-    subsystems.resize(number_subsystems);
-    _hidl_cb(subsystems, Status::SUCCESS);
-    return Void();
-}
-
-Return<void> Power::powerHintAsync(PowerHint hint, int32_t data) {
-    // just call the normal power hint in this oneway function
-    return powerHint(hint, data);
-}
-
-} // namespace implementation
-}  // namespace V1_1
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
diff --git a/power/1.1/default/Power.h b/power/1.1/default/Power.h
deleted file mode 100644
index e779d64..0000000
--- a/power/1.1/default/Power.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_POWER_V1_1_POWER_H
-#define ANDROID_HARDWARE_POWER_V1_1_POWER_H
-
-#include <android/hardware/power/1.1/IPower.h>
-#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
-#include <hardware/power.h>
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_0::PowerHint;
-using ::android::hardware::power::V1_1::IPower;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-struct Power : public IPower {
-    Power(power_module_t* module);
-    ~Power();
-
-    // Methods from ::android::hardware::power::V1_0::IPower follow
-    Return<void> setInteractive(bool interactive) override;
-    Return<void> powerHint(PowerHint hint, int32_t data) override;
-    Return<void> setFeature(Feature feature, bool activate) override;
-    Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
-
-    // Methods from ::android::hardware::power::V1_1::IPower follow.
-    Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
-    Return<void> powerHintAsync(PowerHint hint, int32_t data) override;
-
-    // Methods from ::android::hidl::base::V1_0::IBase follow.
-
-  private:
-    power_module_t* mModule;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-
-#endif  // ANDROID_HARDWARE_POWER_V1_1_POWER_H
diff --git a/power/1.1/default/android.hardware.power@1.1-service.rc b/power/1.1/default/android.hardware.power@1.1-service.rc
deleted file mode 100644
index f2512f1..0000000
--- a/power/1.1/default/android.hardware.power@1.1-service.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service power-hal-1-1 /vendor/bin/hw/android.hardware.power@1.1-service
-    class hal
-    user system
-    group system
diff --git a/power/1.1/default/service.cpp b/power/1.1/default/service.cpp
deleted file mode 100644
index 571db2f..0000000
--- a/power/1.1/default/service.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "android.hardware.power@1.1-service"
-
-#include <android/log.h>
-#include <hidl/HidlTransportSupport.h>
-#include <android/hardware/power/1.1/IPower.h>
-#include <hardware/power.h>
-#include "Power.h"
-
-using android::sp;
-using android::status_t;
-using android::OK;
-
-// libhwbinder:
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files
-using android::hardware::power::V1_1::IPower;
-using android::hardware::power::V1_1::implementation::Power;
-
-int main() {
-
-    status_t status;
-    android::sp<IPower> service = nullptr;
-    const hw_module_t* hw_module = nullptr;
-    power_module_t* power_module = nullptr;
-    int err;
-
-    ALOGI("Power HAL Service 1.1 (Default) is starting.");
-
-    err = hw_get_module(POWER_HARDWARE_MODULE_ID, &hw_module);
-    if (err) {
-        ALOGE("hw_get_module %s failed: %d", POWER_HARDWARE_MODULE_ID, err);
-        goto shutdown;
-    }
-
-    if (!hw_module->methods || !hw_module->methods->open) {
-        power_module = reinterpret_cast<power_module_t*>(
-            const_cast<hw_module_t*>(hw_module));
-    } else {
-        err = hw_module->methods->open(hw_module, POWER_HARDWARE_MODULE_ID,
-                                           reinterpret_cast<hw_device_t**>(&power_module));
-        if (err) {
-            ALOGE("Passthrough failed to load legacy HAL.");
-            goto shutdown;
-        }
-    }
-
-    service = new Power(power_module);
-    if (service == nullptr) {
-        ALOGE("Can not create an instance of Power HAL Iface, exiting.");
-
-        goto shutdown;
-    }
-
-    configureRpcThreadpool(1, true /*callerWillJoin*/);
-
-    status = service->registerAsService();
-    if (status != OK) {
-        ALOGE("Could not register service for Power HAL Iface (%d).", status);
-        goto shutdown;
-    }
-
-    ALOGI("Power Service is ready");
-    joinRpcThreadpool();
-    //Should not pass this line
-
-shutdown:
-    // In normal operation, we don't expect the thread pool to exit
-
-    ALOGE("Power Service is shutting down");
-    return 1;
-}
diff --git a/power/Android.bp b/power/Android.bp
index 7a315fa..a5415df 100644
--- a/power/Android.bp
+++ b/power/Android.bp
@@ -4,6 +4,5 @@
     "1.0/default",
     "1.0/vts/functional",
     "1.1",
-    "1.1/default",
     "1.1/vts/functional",
 ]
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index df31563..4684e0f 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -79,7 +79,7 @@
                     radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
                     radioRsp->rspInfo.error == RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW ||
                     radioRsp->rspInfo.error == RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL ||
-                    CheckOEMError());
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT || CheckOEMError());
     }
 }
 
@@ -119,7 +119,8 @@
 
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
-                    radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);
+                    radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index 130064a..eb5d337 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -24,300 +24,300 @@
     EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
     EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
     EXPECT_LT(cardStatus.imsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
-    }
+}
 
-    /*
-     * Test IRadio.supplyIccPinForApp() for the response returned
-     */
-    TEST_F(RadioHidlTest, supplyIccPinForApp) {
-        int serial = GetRandomSerialNumber();
+/*
+ * Test IRadio.supplyIccPinForApp() for the response returned
+ */
+TEST_F(RadioHidlTest, supplyIccPinForApp) {
+    int serial = GetRandomSerialNumber();
 
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->supplyIccPinForApp(serial, hidl_string("test1"),
-                                          cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.supplyIccPukForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, supplyIccPukForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->supplyIccPukForApp(serial, hidl_string("test1"), hidl_string("test2"),
-                                          cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.supplyIccPin2ForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->supplyIccPin2ForApp(serial, hidl_string("test1"),
-                                           cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.supplyIccPuk2ForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->supplyIccPuk2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
-                                           cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.changeIccPinForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, changeIccPinForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->changeIccPinForApp(serial, hidl_string("test1"), hidl_string("test2"),
-                                          cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.changeIccPin2ForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, changeIccPin2ForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
-        // 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->changeIccPin2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
-                                           cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.getImsiForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, getImsiForApp) {
-        int serial = GetRandomSerialNumber();
-
-        // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            if (cardStatus.applications[i].appType == AppType::SIM ||
-                cardStatus.applications[i].appType == AppType::USIM ||
-                cardStatus.applications[i].appType == AppType::RUIM ||
-                cardStatus.applications[i].appType == AppType::CSIM) {
-                radio->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
-                EXPECT_EQ(std::cv_status::no_timeout, wait());
-                EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-                EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-                EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
-
-                // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
-                if (radioRsp->rspInfo.error == RadioError::NONE) {
-                    EXPECT_NE(radioRsp->imsi, hidl_string());
-                    EXPECT_GE((int)(radioRsp->imsi).size(), 6);
-                    EXPECT_LE((int)(radioRsp->imsi).size(), 15);
-                }
-            }
-        }
-    }
-
-    /*
-     * Test IRadio.iccIOForApp() for the response returned.
-     */
-    TEST_F(RadioHidlTest, iccIOForApp) {
-        int serial = GetRandomSerialNumber();
-
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            IccIo iccIo;
-            iccIo.command = 0xc0;
-            iccIo.fileId = 0x6f11;
-            iccIo.path = hidl_string("3F007FFF");
-            iccIo.p1 = 0;
-            iccIo.p2 = 0;
-            iccIo.p3 = 0;
-            iccIo.data = hidl_string();
-            iccIo.pin2 = hidl_string();
-            iccIo.aid = cardStatus.applications[i].aidPtr;
-
-            radio->iccIOForApp(serial, iccIo);
-            EXPECT_EQ(std::cv_status::no_timeout, wait());
-            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-        }
-    }
-
-    /*
-     * Test IRadio.iccTransmitApduBasicChannel() for the response returned.
-     */
-    TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
-        int serial = GetRandomSerialNumber();
-        SimApdu msg;
-        memset(&msg, 0, sizeof(msg));
-        msg.data = hidl_string();
-
-        radio->iccTransmitApduBasicChannel(serial, msg);
-        EXPECT_EQ(std::cv_status::no_timeout, wait());
-        EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-        EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-
-        // TODO(sanketpadawe): Add test for error code
-    }
-
-    /*
-     * Test IRadio.iccOpenLogicalChannel() for the response returned.
-     */
-    TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
-        int serial = GetRandomSerialNumber();
-        int p2 = 0x04;
-        // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            radio->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->supplyIccPinForApp(serial, hidl_string("test1"),
+                                      cardStatus.applications[i].aidPtr);
             EXPECT_EQ(std::cv_status::no_timeout, wait());
             EXPECT_EQ(serial, radioRsp->rspInfo.serial);
             EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
         }
     }
+}
 
-    /*
-     * Test IRadio.iccCloseLogicalChannel() for the response returned.
-     */
-    TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
-        int serial = GetRandomSerialNumber();
-        // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
-        radio->iccCloseLogicalChannel(serial, 0);
+/*
+ * Test IRadio.supplyIccPukForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, supplyIccPukForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->supplyIccPukForApp(serial, hidl_string("test1"), hidl_string("test2"),
+                                      cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+        }
+    }
+}
+
+/*
+ * Test IRadio.supplyIccPin2ForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->supplyIccPin2ForApp(serial, hidl_string("test1"),
+                                       cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+        }
+    }
+}
+
+/*
+ * Test IRadio.supplyIccPuk2ForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->supplyIccPuk2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
+                                       cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+        }
+    }
+}
+
+/*
+ * Test IRadio.changeIccPinForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, changeIccPinForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->changeIccPinForApp(serial, hidl_string("test1"), hidl_string("test2"),
+                                      cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+        }
+    }
+}
+
+/*
+ * Test IRadio.changeIccPin2ForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, changeIccPin2ForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+    // 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->changeIccPin2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
+                                       cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+        }
+    }
+}
+
+/*
+ * Test IRadio.getImsiForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, getImsiForApp) {
+    int serial = GetRandomSerialNumber();
+
+    // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        if (cardStatus.applications[i].appType == AppType::SIM ||
+            cardStatus.applications[i].appType == AppType::USIM ||
+            cardStatus.applications[i].appType == AppType::RUIM ||
+            cardStatus.applications[i].appType == AppType::CSIM) {
+            radio->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
+            EXPECT_EQ(std::cv_status::no_timeout, wait());
+            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+            EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+
+            // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
+            if (radioRsp->rspInfo.error == RadioError::NONE) {
+                EXPECT_NE(radioRsp->imsi, hidl_string());
+                EXPECT_GE((int)(radioRsp->imsi).size(), 6);
+                EXPECT_LE((int)(radioRsp->imsi).size(), 15);
+            }
+        }
+    }
+}
+
+/*
+ * Test IRadio.iccIOForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, iccIOForApp) {
+    int serial = GetRandomSerialNumber();
+
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        IccIo iccIo;
+        iccIo.command = 0xc0;
+        iccIo.fileId = 0x6f11;
+        iccIo.path = hidl_string("3F007FFF");
+        iccIo.p1 = 0;
+        iccIo.p2 = 0;
+        iccIo.p3 = 0;
+        iccIo.data = hidl_string();
+        iccIo.pin2 = hidl_string();
+        iccIo.aid = cardStatus.applications[i].aidPtr;
+
+        radio->iccIOForApp(serial, iccIo);
         EXPECT_EQ(std::cv_status::no_timeout, wait());
         EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
         EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+    }
+}
 
+/*
+ * Test IRadio.iccTransmitApduBasicChannel() for the response returned.
+ */
+TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
+    int serial = GetRandomSerialNumber();
+    SimApdu msg;
+    memset(&msg, 0, sizeof(msg));
+    msg.data = hidl_string();
+
+    radio->iccTransmitApduBasicChannel(serial, msg);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+    // TODO(sanketpadawe): Add test for error code
+}
+
+/*
+ * Test IRadio.iccOpenLogicalChannel() for the response returned.
+ */
+TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
+    int serial = GetRandomSerialNumber();
+    int p2 = 0x04;
+    // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        radio->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
+        EXPECT_EQ(std::cv_status::no_timeout, wait());
+        EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+        EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+    }
+}
+
+/*
+ * Test IRadio.iccCloseLogicalChannel() for the response returned.
+ */
+TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
+    int serial = GetRandomSerialNumber();
+    // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
+    radio->iccCloseLogicalChannel(serial, 0);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+    EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+}
+
+/*
+ * Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
+ */
+TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
+    int serial = GetRandomSerialNumber();
+    SimApdu msg;
+    memset(&msg, 0, sizeof(msg));
+    msg.data = hidl_string();
+
+    radio->iccTransmitApduLogicalChannel(serial, msg);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+    // TODO(sanketpadawe): Add test for error code
+}
+
+/*
+ * Test IRadio.requestIccSimAuthentication() for the response returned.
+ */
+TEST_F(RadioHidlTest, requestIccSimAuthentication) {
+    int serial = GetRandomSerialNumber();
+
+    // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
+    // returned as error.
+    for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+        radio->requestIccSimAuthentication(serial, 0, hidl_string("test"),
+                                           cardStatus.applications[i].aidPtr);
+        EXPECT_EQ(std::cv_status::no_timeout, wait());
+        EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+        EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
         EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
     }
+}
 
-    /*
-     * Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
-     */
-    TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
-        int serial = GetRandomSerialNumber();
-        SimApdu msg;
-        memset(&msg, 0, sizeof(msg));
-        msg.data = hidl_string();
+/*
+ * Test IRadio.supplyNetworkDepersonalization() for the response returned.
+ */
+TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
+    int serial = GetRandomSerialNumber();
 
-        radio->iccTransmitApduLogicalChannel(serial, msg);
-        EXPECT_EQ(std::cv_status::no_timeout, wait());
-        EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-        EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+    radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
-        // TODO(sanketpadawe): Add test for error code
+    if (cardStatus.cardState == CardState::ABSENT) {
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
+                    radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
+                    radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+                    radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+                    radioRsp->rspInfo.error == RadioError::INVALID_SIM_STATE ||
+                    radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT ||
+                    radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
-
-    /*
-     * Test IRadio.requestIccSimAuthentication() for the response returned.
-     */
-    TEST_F(RadioHidlTest, requestIccSimAuthentication) {
-        int serial = GetRandomSerialNumber();
-
-        // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
-        // returned as error.
-        for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
-            radio->requestIccSimAuthentication(serial, 0, hidl_string("test"),
-                                               cardStatus.applications[i].aidPtr);
-            EXPECT_EQ(std::cv_status::no_timeout, wait());
-            EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-            EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-            EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
-        }
-    }
-
-    /*
-     * Test IRadio.supplyNetworkDepersonalization() for the response returned.
-     */
-    TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
-        int serial = GetRandomSerialNumber();
-
-        radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
-        EXPECT_EQ(std::cv_status::no_timeout, wait());
-        EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-        EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-
-        if (cardStatus.cardState == CardState::ABSENT) {
-            ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
-                        radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
-                        radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
-                        radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
-                        radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                        radioRsp->rspInfo.error == RadioError::INVALID_SIM_STATE ||
-                        radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT ||
-                        radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
-                        radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
-        }
 }
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index a75168c..a502c12 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -678,7 +678,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
                     radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
-                    radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+                    radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -696,7 +697,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
-                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -845,4 +847,4 @@
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
-}
\ No newline at end of file
+}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
index 271a23a..7d74703 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
@@ -36,7 +36,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
         EXPECT_EQ(0, radioRsp->sendSmsResult.errorCode);
     }
 }
@@ -62,7 +63,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -145,7 +147,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -237,7 +240,8 @@
 
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -257,7 +261,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_SMS_FORMAT);
+                    radioRsp->rspInfo.error == RadioError::INVALID_SMS_FORMAT ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -285,7 +290,8 @@
                     radioRsp->rspInfo.error == RadioError::ENCODING_ERR ||
                     radioRsp->rspInfo.error == RadioError::NO_RESOURCES ||
                     radioRsp->rspInfo.error == RadioError::NETWORK_NOT_READY ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS);
+                    radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -308,7 +314,8 @@
                     radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
                     radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -361,7 +368,8 @@
                     radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
                     radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS);
+                    radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -413,7 +421,8 @@
                     radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
                     radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
+                    radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -434,6 +443,7 @@
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
                     radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
-                    radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+                    radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
index f97f5fe..da46e88 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
@@ -121,6 +121,7 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+                    radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
index 7720505..fc8cb2a 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
@@ -34,19 +34,19 @@
     std::unique_lock<std::mutex> lock(mtx);
     count++;
     cv.notify_one();
-    }
+}
 
-    std::cv_status SapHidlTest::wait() {
-        std::unique_lock<std::mutex> lock(mtx);
+std::cv_status SapHidlTest::wait() {
+    std::unique_lock<std::mutex> lock(mtx);
 
-        std::cv_status status = std::cv_status::no_timeout;
-        auto now = std::chrono::system_clock::now();
-        while (count == 0) {
-            status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
-            if (status == std::cv_status::timeout) {
-                return status;
-            }
+    std::cv_status status = std::cv_status::no_timeout;
+    auto now = std::chrono::system_clock::now();
+    while (count == 0) {
+        status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+        if (status == std::cv_status::timeout) {
+            return status;
         }
-        count--;
-        return status;
-    }
\ No newline at end of file
+    }
+    count--;
+    return status;
+}
\ No newline at end of file
diff --git a/sensors/1.0/default/OWNERS b/sensors/1.0/default/OWNERS
new file mode 100644
index 0000000..6a38a1f
--- /dev/null
+++ b/sensors/1.0/default/OWNERS
@@ -0,0 +1,2 @@
+ashutoshj@google.com
+pengxu@google.com
diff --git a/sensors/1.0/vts/functional/Android.bp b/sensors/1.0/vts/functional/Android.bp
index a49307d..0ea400e 100644
--- a/sensors/1.0/vts/functional/Android.bp
+++ b/sensors/1.0/vts/functional/Android.bp
@@ -17,7 +17,14 @@
 cc_test {
     name: "VtsHalSensorsV1_0TargetTest",
     defaults: ["VtsHalTargetTestDefaults"],
-    srcs: ["VtsHalSensorsV1_0TargetTest.cpp"],
-    static_libs: ["android.hardware.sensors@1.0"],
+    srcs: [
+        "GrallocWrapper.cpp",
+        "VtsHalSensorsV1_0TargetTest.cpp"
+    ],
+    static_libs: [
+        "android.hardware.graphics.allocator@2.0",
+        "android.hardware.graphics.mapper@2.0",
+        "android.hardware.sensors@1.0",
+    ],
 }
 
diff --git a/sensors/1.0/vts/functional/GrallocWrapper.cpp b/sensors/1.0/vts/functional/GrallocWrapper.cpp
new file mode 100644
index 0000000..e422d62
--- /dev/null
+++ b/sensors/1.0/vts/functional/GrallocWrapper.cpp
@@ -0,0 +1,232 @@
+/*
+ * 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 "GrallocWrapper"
+
+#include "GrallocWrapper.h"
+
+#include <utils/Log.h>
+
+namespace android {
+
+GrallocWrapper::GrallocWrapper() { init(); }
+
+void GrallocWrapper::init() {
+  mAllocator = allocator2::IAllocator::getService();
+  if (mAllocator == nullptr) {
+    ALOGE("Failed to get allocator service");
+  }
+
+  mMapper = mapper2::IMapper::getService();
+  if (mMapper == nullptr) {
+    ALOGE("Failed to get mapper service");
+  }
+  if (mMapper->isRemote()) {
+    ALOGE("Mapper is not in passthrough mode");
+  }
+}
+
+GrallocWrapper::~GrallocWrapper() {
+  for (auto bufferHandle : mClonedBuffers) {
+    auto buffer = const_cast<native_handle_t*>(bufferHandle);
+    native_handle_close(buffer);
+    native_handle_delete(buffer);
+  }
+  mClonedBuffers.clear();
+
+  for (auto bufferHandle : mImportedBuffers) {
+    auto buffer = const_cast<native_handle_t*>(bufferHandle);
+    if (mMapper->freeBuffer(buffer) != mapper2::Error::NONE) {
+      ALOGE("Failed to free buffer %p", buffer);
+    }
+  }
+  mImportedBuffers.clear();
+}
+
+sp<allocator2::IAllocator> GrallocWrapper::getAllocator() const {
+  return mAllocator;
+}
+
+std::string GrallocWrapper::dumpDebugInfo() {
+  std::string debugInfo;
+  mAllocator->dumpDebugInfo(
+      [&](const auto& tmpDebugInfo) { debugInfo = tmpDebugInfo.c_str(); });
+
+  return debugInfo;
+}
+
+const native_handle_t* GrallocWrapper::cloneBuffer(
+    const hardware::hidl_handle& rawHandle) {
+  const native_handle_t* bufferHandle =
+      native_handle_clone(rawHandle.getNativeHandle());
+
+  if (bufferHandle) {
+    mClonedBuffers.insert(bufferHandle);
+  }
+  return bufferHandle;
+}
+
+std::vector<const native_handle_t*> GrallocWrapper::allocate(
+    const mapper2::BufferDescriptor& descriptor, uint32_t count, bool import,
+    uint32_t* outStride) {
+  std::vector<const native_handle_t*> bufferHandles;
+  bufferHandles.reserve(count);
+  mAllocator->allocate(
+      descriptor, count,
+      [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) {
+        if (mapper2::Error::NONE != tmpError) {
+          ALOGE("Failed to allocate buffers");
+        }
+        if (count != tmpBuffers.size()) {
+          ALOGE("Invalid buffer array");
+        }
+
+        for (uint32_t i = 0; i < count; i++) {
+          if (import) {
+            bufferHandles.push_back(importBuffer(tmpBuffers[i]));
+          } else {
+            bufferHandles.push_back(cloneBuffer(tmpBuffers[i]));
+          }
+        }
+
+        if (outStride) {
+          *outStride = tmpStride;
+        }
+      });
+
+  return bufferHandles;
+}
+
+const native_handle_t* GrallocWrapper::allocate(
+    const mapper2::IMapper::BufferDescriptorInfo& descriptorInfo, bool import,
+    uint32_t* outStride) {
+  mapper2::BufferDescriptor descriptor = createDescriptor(descriptorInfo);
+  ALOGE("QQ");
+  auto buffers = allocate(descriptor, 1, import, outStride);
+  return buffers[0];
+}
+
+sp<mapper2::IMapper> GrallocWrapper::getMapper() const { return mMapper; }
+
+mapper2::BufferDescriptor GrallocWrapper::createDescriptor(
+    const mapper2::IMapper::BufferDescriptorInfo& descriptorInfo) {
+  mapper2::BufferDescriptor descriptor;
+  mMapper->createDescriptor(
+      descriptorInfo, [&](const auto& tmpError, const auto& tmpDescriptor) {
+        if (tmpError != mapper2::Error::NONE) {
+          ALOGE("Failed to create descriptor");
+        }
+        descriptor = tmpDescriptor;
+      });
+
+  return descriptor;
+}
+
+const native_handle_t* GrallocWrapper::importBuffer(
+    const hardware::hidl_handle& rawHandle) {
+  const native_handle_t* bufferHandle = nullptr;
+  mMapper->importBuffer(
+      rawHandle, [&](const auto& tmpError, const auto& tmpBuffer) {
+        if (tmpError != mapper2::Error::NONE) {
+          ALOGE("Failed to import buffer %p", rawHandle.getNativeHandle());
+        }
+        bufferHandle = static_cast<const native_handle_t*>(tmpBuffer);
+      });
+
+  if (bufferHandle) {
+    mImportedBuffers.insert(bufferHandle);
+  }
+
+  return bufferHandle;
+}
+
+void GrallocWrapper::freeBuffer(const native_handle_t* bufferHandle) {
+  auto buffer = const_cast<native_handle_t*>(bufferHandle);
+
+  if (mImportedBuffers.erase(bufferHandle)) {
+    mapper2::Error error = mMapper->freeBuffer(buffer);
+    if (error != mapper2::Error::NONE) {
+      ALOGE("Failed to free %p", buffer);
+    }
+  } else {
+    mClonedBuffers.erase(bufferHandle);
+    native_handle_close(buffer);
+    native_handle_delete(buffer);
+  }
+}
+
+void* GrallocWrapper::lock(const native_handle_t* bufferHandle,
+                           uint64_t cpuUsage,
+                           const mapper2::IMapper::Rect& accessRegion,
+                           int acquireFence) {
+  auto buffer = const_cast<native_handle_t*>(bufferHandle);
+
+  NATIVE_HANDLE_DECLARE_STORAGE(acquireFenceStorage, 1, 0);
+  hardware::hidl_handle acquireFenceHandle;
+  if (acquireFence >= 0) {
+    auto h = native_handle_init(acquireFenceStorage, 1, 0);
+    h->data[0] = acquireFence;
+    acquireFenceHandle = h;
+  }
+
+  void* data = nullptr;
+  mMapper->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle,
+                [&](const auto& tmpError, const auto& tmpData) {
+                  if (tmpError != mapper2::Error::NONE) {
+                    ALOGE("Failed to lock buffer %p", buffer);
+                  }
+                  data = tmpData;
+                });
+
+  if (acquireFence >= 0) {
+    close(acquireFence);
+  }
+
+  return data;
+}
+
+int GrallocWrapper::unlock(const native_handle_t* bufferHandle) {
+  auto buffer = const_cast<native_handle_t*>(bufferHandle);
+
+  int releaseFence = -1;
+  mMapper->unlock(buffer, [&](const auto& tmpError,
+                              const auto& tmpReleaseFence) {
+    if (tmpError != mapper2::Error::NONE) {
+      ALOGE("Failed to unlock buffer %p", buffer);
+    }
+
+    auto fenceHandle = tmpReleaseFence.getNativeHandle();
+    if (fenceHandle) {
+      if (fenceHandle->numInts != 0) {
+        ALOGE("Invalid fence handle %p", fenceHandle);
+      }
+      if (fenceHandle->numFds == 1) {
+        releaseFence = dup(fenceHandle->data[0]);
+        if (releaseFence < 0){
+          ALOGE("Failed to dup fence fd");
+        }
+      } else {
+        if (fenceHandle->numFds != 0) {
+          ALOGE("Invalid fence handle %p", fenceHandle);
+        }
+      }
+    }
+  });
+
+  return releaseFence;
+}
+
+}  // namespace android
diff --git a/sensors/1.0/vts/functional/GrallocWrapper.h b/sensors/1.0/vts/functional/GrallocWrapper.h
new file mode 100644
index 0000000..e506fe1
--- /dev/null
+++ b/sensors/1.0/vts/functional/GrallocWrapper.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GRALLO_WRAPPER_H_
+#define GRALLO_WRAPPER_H_
+
+#include <unordered_set>
+
+#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/2.0/IMapper.h>
+
+namespace allocator2 = ::android::hardware::graphics::allocator::V2_0;
+namespace mapper2 = ::android::hardware::graphics::mapper::V2_0;
+
+namespace android {
+
+// Modified from hardware/interfaces/graphics/mapper/2.0/vts/functional/
+class GrallocWrapper {
+ public:
+  GrallocWrapper();
+  ~GrallocWrapper();
+
+  sp<allocator2::IAllocator> getAllocator() const;
+  sp<mapper2::IMapper> getMapper() const;
+
+  std::string dumpDebugInfo();
+
+  // When import is false, this simply calls IAllocator::allocate. When import
+  // is true, the returned buffers are also imported into the mapper.
+  //
+  // Either case, the returned buffers must be freed with freeBuffer.
+  std::vector<const native_handle_t*> allocate(
+      const mapper2::BufferDescriptor& descriptor, uint32_t count, bool import = true,
+      uint32_t* outStride = nullptr);
+  const native_handle_t* allocate(
+      const mapper2::IMapper::BufferDescriptorInfo& descriptorInfo, bool import = true,
+      uint32_t* outStride = nullptr);
+
+  mapper2::BufferDescriptor createDescriptor(
+      const mapper2::IMapper::BufferDescriptorInfo& descriptorInfo);
+
+  const native_handle_t* importBuffer(const hardware::hidl_handle& rawHandle);
+  void freeBuffer(const native_handle_t* bufferHandle);
+
+  // We use fd instead of hardware::hidl_handle in these functions to pass fences
+  // in and out of the mapper.  The ownership of the fd is always transferred
+  // with each of these functions.
+  void* lock(const native_handle_t* bufferHandle, uint64_t cpuUsage,
+             const mapper2::IMapper::Rect& accessRegion, int acquireFence);
+
+  int unlock(const native_handle_t* bufferHandle);
+
+ private:
+  void init();
+  const native_handle_t* cloneBuffer(const hardware::hidl_handle& rawHandle);
+
+  sp<allocator2::IAllocator> mAllocator;
+  sp<mapper2::IMapper> mMapper;
+
+  // Keep track of all cloned and imported handles.  When a test fails with
+  // ASSERT_*, the destructor will free the handles for the test.
+  std::unordered_set<const native_handle_t*> mClonedBuffers;
+  std::unordered_set<const native_handle_t*> mImportedBuffers;
+};
+
+}  // namespace android
+#endif  // GRALLO_WRAPPER_H_
diff --git a/sensors/1.0/vts/functional/OWNERS b/sensors/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..8715e5d
--- /dev/null
+++ b/sensors/1.0/vts/functional/OWNERS
@@ -0,0 +1,7 @@
+# Sensors team
+ashutoshj@google.com
+pengxu@google.com
+
+# VTS team
+trong@google.com
+yim@google.com
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index 98b4994..ca3d3e4 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -15,6 +15,7 @@
  */
 
 #define LOG_TAG "sensors_hidl_hal_test"
+#include "GrallocWrapper.h"
 #include <VtsHalHidlTargetTestBase.h>
 #include <android-base/logging.h>
 #include <android/hardware/sensors/1.0/ISensors.h>
@@ -36,6 +37,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
+using ::android::GrallocWrapper;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::hardware::hidl_string;
@@ -230,6 +232,7 @@
   native_handle_t* mNativeHandle;
   size_t mSize;
   char* mBuffer;
+  std::unique_ptr<GrallocWrapper> mGrallocWrapper;
 
   DISALLOW_COPY_AND_ASSIGN(SensorsTestSharedMemory);
 };
@@ -265,6 +268,7 @@
   while (offset + kEventSize <= mSize) {
     int64_t atomicCounter = *reinterpret_cast<uint32_t *>(mBuffer + offset + kOffsetAtomicCounter);
     if (atomicCounter <= lastCounter) {
+      ALOGV("atomicCounter = %" PRId64 ", lastCounter = %" PRId64, atomicCounter, lastCounter);
       break;
     }
 
@@ -324,7 +328,34 @@
       break;
     }
     case SharedMemType::GRALLOC: {
+      mGrallocWrapper = std::make_unique<GrallocWrapper>();
+      if (mGrallocWrapper->getAllocator() == nullptr || mGrallocWrapper->getMapper() == nullptr) {
+        break;
+      }
+      using android::hardware::graphics::common::V1_0::BufferUsage;
+      using android::hardware::graphics::common::V1_0::PixelFormat;
+      mapper2::IMapper::BufferDescriptorInfo buf_desc_info = {
+        .width = static_cast<uint32_t>(size),
+        .height = 1,
+        .layerCount = 1,
+        .usage = static_cast<uint64_t> (BufferUsage::SENSOR_DIRECT_DATA |
+            BufferUsage::CPU_READ_OFTEN),
+        .format = PixelFormat::BLOB
+      };
 
+      handle = const_cast<native_handle_t *>(mGrallocWrapper->allocate(buf_desc_info));
+      if (handle != nullptr) {
+        mapper2::IMapper::Rect region{0, 0,
+            static_cast<int32_t>(buf_desc_info.width),
+            static_cast<int32_t>(buf_desc_info.height)};
+        buffer = static_cast<char *>
+                (mGrallocWrapper->lock(handle, buf_desc_info.usage, region, /*fence=*/-1));
+        if (buffer != nullptr) {
+          break;
+        }
+        mGrallocWrapper->freeBuffer(handle);
+        handle = nullptr;
+      }
       break;
     }
     default:
@@ -353,6 +384,16 @@
       }
       break;
     }
+    case SharedMemType::GRALLOC: {
+      if (mSize != 0) {
+        mGrallocWrapper->unlock(mNativeHandle);
+        mGrallocWrapper->freeBuffer(mNativeHandle);
+
+        mNativeHandle = nullptr;
+        mSize = 0;
+      }
+      break;
+    }
     default: {
       if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) {
         ALOGE("SensorsTestSharedMemory %p not properly destructed: "
@@ -520,7 +561,7 @@
                               std::chrono::nanoseconds samplingPeriod,
                               std::chrono::seconds duration,
                               const SensorEventsChecker &checker);
-  void testSamplingRateHotSwitchOperation(SensorType type);
+  void testSamplingRateHotSwitchOperation(SensorType type, bool fastToSlow = true);
   void testBatchingOperation(SensorType type);
   void testDirectReportOperation(
       SensorType type, SharedMemType memType, RateLevel rate, const SensorEventsChecker &checker);
@@ -1040,10 +1081,11 @@
                          NullChecker());
 }
 
-void SensorsHidlTest::testSamplingRateHotSwitchOperation(SensorType type) {
+void SensorsHidlTest::testSamplingRateHotSwitchOperation(SensorType type, bool fastToSlow) {
   std::vector<Event> events1, events2;
 
   constexpr int64_t batchingPeriodInNs = 0; // no batching
+  constexpr int64_t collectionTimeoutUs = 60000000; // 60s
   constexpr size_t minNEvent = 50;
 
   SensorInfo sensor = defaultSensorByType(type);
@@ -1062,17 +1104,23 @@
     return;
   }
 
-  ASSERT_EQ(batch(handle, minSamplingPeriodInNs, batchingPeriodInNs), Result::OK);
+  int64_t firstCollectionPeriod = fastToSlow ? minSamplingPeriodInNs : maxSamplingPeriodInNs;
+  int64_t secondCollectionPeriod = !fastToSlow ? minSamplingPeriodInNs : maxSamplingPeriodInNs;
+
+  // first collection
+  ASSERT_EQ(batch(handle, firstCollectionPeriod, batchingPeriodInNs), Result::OK);
   ASSERT_EQ(activate(handle, 1), Result::OK);
 
   usleep(500000); // sleep 0.5 sec to wait for change rate to happen
-  events1 = collectEvents(sensor.minDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
+  events1 = collectEvents(collectionTimeoutUs, minNEvent);
 
-  ASSERT_EQ(batch(handle, maxSamplingPeriodInNs, batchingPeriodInNs), Result::OK);
+  // second collection, without stop sensor
+  ASSERT_EQ(batch(handle, secondCollectionPeriod, batchingPeriodInNs), Result::OK);
 
   usleep(500000); // sleep 0.5 sec to wait for change rate to happen
-  events2 = collectEvents(sensor.maxDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
+  events2 = collectEvents(collectionTimeoutUs, minNEvent);
 
+  // end of collection, stop sensor
   ASSERT_EQ(activate(handle, 0), Result::OK);
 
   ALOGI("Collected %zu fast samples and %zu slow samples", events1.size(), events2.size());
@@ -1081,11 +1129,13 @@
   ASSERT_GT(events2.size(), 0u);
 
   int64_t minDelayAverageInterval, maxDelayAverageInterval;
+  std::vector<Event> &minDelayEvents(fastToSlow ? events1 : events2);
+  std::vector<Event> &maxDelayEvents(fastToSlow ? events2 : events1);
 
   size_t nEvent = 0;
   int64_t prevTimestamp = -1;
   int64_t timestampInterval = 0;
-  for (auto & e : events1) {
+  for (auto & e : minDelayEvents) {
     if (e.sensorType == type) {
       ASSERT_EQ(e.sensorHandle, handle);
       if (prevTimestamp > 0) {
@@ -1101,7 +1151,7 @@
   nEvent = 0;
   prevTimestamp = -1;
   timestampInterval = 0;
-  for (auto & e : events2) {
+  for (auto & e : maxDelayEvents) {
     if (e.sensorType == type) {
       ASSERT_EQ(e.sensorHandle, handle);
       if (prevTimestamp > 0) {
@@ -1115,27 +1165,35 @@
   maxDelayAverageInterval = timestampInterval / (nEvent - 1);
 
   // change of rate is significant.
+  ALOGI("min/maxDelayAverageInterval = %" PRId64 " %" PRId64,
+      minDelayAverageInterval, maxDelayAverageInterval);
   EXPECT_GT((maxDelayAverageInterval - minDelayAverageInterval), minDelayAverageInterval / 10);
 
   // fastest rate sampling time is close to spec
-  ALOGI("minDelayAverageInterval = %" PRId64, minDelayAverageInterval);
   EXPECT_LT(std::abs(minDelayAverageInterval - minSamplingPeriodInNs),
       minSamplingPeriodInNs / 10);
+
+  // slowest rate sampling time is close to spec
+  EXPECT_LT(std::abs(maxDelayAverageInterval - maxSamplingPeriodInNs),
+      maxSamplingPeriodInNs / 10);
 }
 
 // Test if sensor hal can do accelerometer sampling rate switch properly when sensor is active
 TEST_F(SensorsHidlTest, AccelerometerSamplingPeriodHotSwitchOperation) {
   testSamplingRateHotSwitchOperation(SensorType::ACCELEROMETER);
+  testSamplingRateHotSwitchOperation(SensorType::ACCELEROMETER, false /*fastToSlow*/);
 }
 
 // Test if sensor hal can do gyroscope sampling rate switch properly when sensor is active
 TEST_F(SensorsHidlTest, GyroscopeSamplingPeriodHotSwitchOperation) {
   testSamplingRateHotSwitchOperation(SensorType::GYROSCOPE);
+  testSamplingRateHotSwitchOperation(SensorType::GYROSCOPE, false /*fastToSlow*/);
 }
 
 // Test if sensor hal can do magnetometer sampling rate switch properly when sensor is active
 TEST_F(SensorsHidlTest, MagnetometerSamplingPeriodHotSwitchOperation) {
   testSamplingRateHotSwitchOperation(SensorType::MAGNETIC_FIELD);
+  testSamplingRateHotSwitchOperation(SensorType::MAGNETIC_FIELD, false /*fastToSlow*/);
 }
 
 void SensorsHidlTest::testBatchingOperation(SensorType type) {
@@ -1224,7 +1282,7 @@
 void SensorsHidlTest::testDirectReportOperation(
     SensorType type, SharedMemType memType, RateLevel rate, const SensorEventsChecker &checker) {
   constexpr size_t kEventSize = static_cast<size_t>(SensorsEventFormatOffset::TOTAL_LENGTH);
-  constexpr size_t kNEvent = 500;
+  constexpr size_t kNEvent = 4096;
   constexpr size_t kMemSize = kEventSize * kNEvent;
 
   constexpr float kNormalNominal = 50;
@@ -1385,6 +1443,60 @@
       SensorType::MAGNETIC_FIELD, SharedMemType::ASHMEM, RateLevel::VERY_FAST, NullChecker());
 }
 
+// Test sensor event direct report with gralloc for accel sensor at normal rate
+TEST_F(SensorsHidlTest, AccelerometerGrallocDirectReportOperationNormal) {
+  testDirectReportOperation(SensorType::ACCELEROMETER, SharedMemType::GRALLOC, RateLevel::NORMAL,
+                            sAccelNormChecker);
+}
+
+// Test sensor event direct report with gralloc for accel sensor at fast rate
+TEST_F(SensorsHidlTest, AccelerometerGrallocDirectReportOperationFast) {
+  testDirectReportOperation(SensorType::ACCELEROMETER, SharedMemType::GRALLOC, RateLevel::FAST,
+                            sAccelNormChecker);
+}
+
+// Test sensor event direct report with gralloc for accel sensor at very fast rate
+TEST_F(SensorsHidlTest, AccelerometerGrallocDirectReportOperationVeryFast) {
+  testDirectReportOperation(SensorType::ACCELEROMETER, SharedMemType::GRALLOC, RateLevel::VERY_FAST,
+                            sAccelNormChecker);
+}
+
+// Test sensor event direct report with gralloc for gyro sensor at normal rate
+TEST_F(SensorsHidlTest, GyroscopeGrallocDirectReportOperationNormal) {
+  testDirectReportOperation(SensorType::GYROSCOPE, SharedMemType::GRALLOC, RateLevel::NORMAL,
+                            sGyroNormChecker);
+}
+
+// Test sensor event direct report with gralloc for gyro sensor at fast rate
+TEST_F(SensorsHidlTest, GyroscopeGrallocDirectReportOperationFast) {
+  testDirectReportOperation(SensorType::GYROSCOPE, SharedMemType::GRALLOC, RateLevel::FAST,
+                            sGyroNormChecker);
+}
+
+// Test sensor event direct report with gralloc for gyro sensor at very fast rate
+TEST_F(SensorsHidlTest, GyroscopeGrallocDirectReportOperationVeryFast) {
+  testDirectReportOperation(SensorType::GYROSCOPE, SharedMemType::GRALLOC, RateLevel::VERY_FAST,
+                            sGyroNormChecker);
+}
+
+// Test sensor event direct report with gralloc for mag sensor at normal rate
+TEST_F(SensorsHidlTest, MagnetometerGrallocDirectReportOperationNormal) {
+  testDirectReportOperation(SensorType::MAGNETIC_FIELD, SharedMemType::GRALLOC, RateLevel::NORMAL,
+                            NullChecker());
+}
+
+// Test sensor event direct report with gralloc for mag sensor at fast rate
+TEST_F(SensorsHidlTest, MagnetometerGrallocDirectReportOperationFast) {
+  testDirectReportOperation(SensorType::MAGNETIC_FIELD, SharedMemType::GRALLOC, RateLevel::FAST,
+                            NullChecker());
+}
+
+// Test sensor event direct report with gralloc for mag sensor at very fast rate
+TEST_F(SensorsHidlTest, MagnetometerGrallocDirectReportOperationVeryFast) {
+  testDirectReportOperation(
+      SensorType::MAGNETIC_FIELD, SharedMemType::GRALLOC, RateLevel::VERY_FAST, NullChecker());
+}
+
 int main(int argc, char **argv) {
   ::testing::AddGlobalTestEnvironment(SensorsHidlEnvironment::Instance());
   ::testing::InitGoogleTest(&argc, argv);
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
index 996519b..f963fb1 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
@@ -388,10 +388,12 @@
     halTriggerPhrase->id = triggerPhrase->id;
     halTriggerPhrase->recognition_mode = triggerPhrase->recognitionModes;
     unsigned int i;
-    for (i = 0; i < triggerPhrase->users.size(); i++) {
+
+    halTriggerPhrase->num_users =
+        std::min((int)triggerPhrase->users.size(), SOUND_TRIGGER_MAX_USERS);
+    for (i = 0; i < halTriggerPhrase->num_users; i++) {
         halTriggerPhrase->users[i] = triggerPhrase->users[i];
     }
-    halTriggerPhrase->num_users = i;
 
     strlcpy(halTriggerPhrase->locale,
             triggerPhrase->locale.c_str(), SOUND_TRIGGER_MAX_LOCALE_LEN);