Merge "light HAL uses "default" service name"
diff --git a/graphics/composer/2.1/default/HwcClient.cpp b/graphics/composer/2.1/default/HwcClient.cpp
index 621cb14..edd161a 100644
--- a/graphics/composer/2.1/default/HwcClient.cpp
+++ b/graphics/composer/2.1/default/HwcClient.cpp
@@ -651,7 +651,7 @@
 
 bool HwcClient::CommandReader::parseSelectDisplay(uint16_t length)
 {
-    if (length != CommandWriter::kSelectDisplayLength) {
+    if (length != CommandWriterBase::kSelectDisplayLength) {
         return false;
     }
 
@@ -663,7 +663,7 @@
 
 bool HwcClient::CommandReader::parseSelectLayer(uint16_t length)
 {
-    if (length != CommandWriter::kSelectLayerLength) {
+    if (length != CommandWriterBase::kSelectLayerLength) {
         return false;
     }
 
@@ -674,7 +674,7 @@
 
 bool HwcClient::CommandReader::parseSetColorTransform(uint16_t length)
 {
-    if (length != CommandWriter::kSetColorTransformLength) {
+    if (length != CommandWriterBase::kSetColorTransformLength) {
         return false;
     }
 
@@ -722,7 +722,7 @@
 
 bool HwcClient::CommandReader::parseSetOutputBuffer(uint16_t length)
 {
-    if (length != CommandWriter::kSetOutputBufferLength) {
+    if (length != CommandWriterBase::kSetOutputBufferLength) {
         return false;
     }
 
@@ -746,7 +746,7 @@
 
 bool HwcClient::CommandReader::parseValidateDisplay(uint16_t length)
 {
-    if (length != CommandWriter::kValidateDisplayLength) {
+    if (length != CommandWriterBase::kValidateDisplayLength) {
         return false;
     }
 
@@ -773,7 +773,7 @@
 
 bool HwcClient::CommandReader::parseAcceptDisplayChanges(uint16_t length)
 {
-    if (length != CommandWriter::kAcceptDisplayChangesLength) {
+    if (length != CommandWriterBase::kAcceptDisplayChangesLength) {
         return false;
     }
 
@@ -787,7 +787,7 @@
 
 bool HwcClient::CommandReader::parsePresentDisplay(uint16_t length)
 {
-    if (length != CommandWriter::kPresentDisplayLength) {
+    if (length != CommandWriterBase::kPresentDisplayLength) {
         return false;
     }
 
@@ -807,7 +807,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerCursorPosition(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerCursorPositionLength) {
+    if (length != CommandWriterBase::kSetLayerCursorPositionLength) {
         return false;
     }
 
@@ -822,7 +822,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerBuffer(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerBufferLength) {
+    if (length != CommandWriterBase::kSetLayerBufferLength) {
         return false;
     }
 
@@ -862,7 +862,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerBlendMode(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerBlendModeLength) {
+    if (length != CommandWriterBase::kSetLayerBlendModeLength) {
         return false;
     }
 
@@ -876,7 +876,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerColor(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerColorLength) {
+    if (length != CommandWriterBase::kSetLayerColorLength) {
         return false;
     }
 
@@ -890,7 +890,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerCompositionType(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerCompositionTypeLength) {
+    if (length != CommandWriterBase::kSetLayerCompositionTypeLength) {
         return false;
     }
 
@@ -904,7 +904,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerDataspace(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerDataspaceLength) {
+    if (length != CommandWriterBase::kSetLayerDataspaceLength) {
         return false;
     }
 
@@ -918,7 +918,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerDisplayFrame(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerDisplayFrameLength) {
+    if (length != CommandWriterBase::kSetLayerDisplayFrameLength) {
         return false;
     }
 
@@ -932,7 +932,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerPlaneAlpha(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerPlaneAlphaLength) {
+    if (length != CommandWriterBase::kSetLayerPlaneAlphaLength) {
         return false;
     }
 
@@ -946,7 +946,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerSidebandStream(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerSidebandStreamLength) {
+    if (length != CommandWriterBase::kSetLayerSidebandStreamLength) {
         return false;
     }
 
@@ -965,7 +965,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerSourceCrop(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerSourceCropLength) {
+    if (length != CommandWriterBase::kSetLayerSourceCropLength) {
         return false;
     }
 
@@ -979,7 +979,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerTransform(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerTransformLength) {
+    if (length != CommandWriterBase::kSetLayerTransformLength) {
         return false;
     }
 
@@ -1009,7 +1009,7 @@
 
 bool HwcClient::CommandReader::parseSetLayerZOrder(uint16_t length)
 {
-    if (length != CommandWriter::kSetLayerZOrderLength) {
+    if (length != CommandWriterBase::kSetLayerZOrderLength) {
         return false;
     }
 
diff --git a/graphics/composer/2.1/default/HwcClient.h b/graphics/composer/2.1/default/HwcClient.h
index c719774..35a0450 100644
--- a/graphics/composer/2.1/default/HwcClient.h
+++ b/graphics/composer/2.1/default/HwcClient.h
@@ -171,7 +171,7 @@
 
         HwcClient& mClient;
         HwcHal& mHal;
-        CommandWriter& mWriter;
+        CommandWriterBase& mWriter;
 
         Display mDisplay;
         Layer mLayer;
@@ -184,7 +184,7 @@
         64 * 1024 / sizeof(uint32_t) - 16;
     std::mutex mCommandMutex;
     CommandReader mReader;
-    CommandWriter mWriter;
+    CommandWriterBase mWriter;
 
     sp<IComposerCallback> mCallback;
 
diff --git a/graphics/composer/2.1/default/IComposerCommandBuffer.h b/graphics/composer/2.1/default/IComposerCommandBuffer.h
index 65e7799..fb78ef8 100644
--- a/graphics/composer/2.1/default/IComposerCommandBuffer.h
+++ b/graphics/composer/2.1/default/IComposerCommandBuffer.h
@@ -52,16 +52,16 @@
 
 // This class helps build a command queue.  Note that all sizes/lengths are in
 // units of uint32_t's.
-class CommandWriter {
+class CommandWriterBase {
 public:
-    CommandWriter(uint32_t initialMaxSize)
+    CommandWriterBase(uint32_t initialMaxSize)
         : mDataMaxSize(initialMaxSize)
     {
         mData = std::make_unique<uint32_t[]>(mDataMaxSize);
         reset();
     }
 
-    ~CommandWriter()
+    virtual ~CommandWriterBase()
     {
         reset();
     }
diff --git a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
index 194afc2..9a71745 100644
--- a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
+++ b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
@@ -80,7 +80,7 @@
 };
 
 void SensorsHidlEnvironment::SetUp() {
-  sensors = ISensors::getService(false);
+  sensors = ISensors::getService();
   ALOGI_IF(sensors, "sensors is not nullptr, %p", sensors.get());
   ASSERT_NE(sensors, nullptr);
 
diff --git a/wifi/1.0/vts/Android.mk b/wifi/1.0/vts/Android.mk
new file mode 100644
index 0000000..d347136
--- /dev/null
+++ b/wifi/1.0/vts/Android.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# include hidl test makefiles
+include $(LOCAL_PATH)/functional/vts/testcases/hal/wifi/hidl/Android.mk
diff --git a/wifi/1.0/vts/functional/vts/testcases/hal/wifi/__init__.py b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/__init__.py
diff --git a/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/Android.mk b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/__init__.py b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/__init__.py
diff --git a/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/Android.mk b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/Android.mk
new file mode 100644
index 0000000..40f154e
--- /dev/null
+++ b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/Android.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalWifiHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/wifi/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/AndroidTest.xml b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..1099a5a
--- /dev/null
+++ b/wifi/1.0/vts/functional/vts/testcases/hal/wifi/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for VTS WiFi HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalWifiHidlTargetTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/wifi_hidl_test/wifi_hidl_test,
+            _64bit::DATA/nativetest64/wifi_hidl_test/wifi_hidl_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="10m" />
+    </test>
+</configuration>