Merge "Implementing per-property access control"
diff --git a/audio/common/2.0/default/HidlUtils.cpp b/audio/common/2.0/default/HidlUtils.cpp
index f25fc5c..b1bff00 100644
--- a/audio/common/2.0/default/HidlUtils.cpp
+++ b/audio/common/2.0/default/HidlUtils.cpp
@@ -114,6 +114,9 @@
halOffload->duration_us = offload.durationMicroseconds;
halOffload->has_video = offload.hasVideo;
halOffload->is_streaming = offload.isStreaming;
+ halOffload->bit_width = offload.bitWidth;
+ halOffload->offload_buffer_size = offload.bufferSize;
+ halOffload->usage = static_cast<audio_usage_t>(offload.usage);
}
void HidlUtils::audioPortConfigFromHal(
diff --git a/audio/common/2.0/types.hal b/audio/common/2.0/types.hal
index 4e969a7..d1674e4 100644
--- a/audio/common/2.0/types.hal
+++ b/audio/common/2.0/types.hal
@@ -107,7 +107,7 @@
ACCESSIBILITY = 10, // For accessibility talk back prompts
REROUTING = 11, // For dynamic policy output mixes
PATCH = 12, // For internal audio flinger tracks. Fixed volume
- PUBLIC_CNT = TTS + 1,
+ PUBLIC_CNT = ACCESSIBILITY + 1,
// Number of streams considered by audio policy for volume and routing
FOR_POLICY_CNT = PATCH,
CNT = PATCH + 1
@@ -215,6 +215,25 @@
// IEC61937 is encoded audio wrapped in 16-bit PCM.
IEC61937 = 0x0D000000UL,
DOLBY_TRUEHD = 0x0E000000UL,
+ EVRC = 0x10000000UL,
+ EVRCB = 0x11000000UL,
+ EVRCWB = 0x12000000UL,
+ EVRCNW = 0x13000000UL,
+ AAC_ADIF = 0x14000000UL,
+ WMA = 0x15000000UL,
+ WMA_PRO = 0x16000000UL,
+ AMR_WB_PLUS = 0x17000000UL,
+ MP2 = 0x18000000UL,
+ QCELP = 0x19000000UL,
+ DSD = 0x1A000000UL,
+ FLAC = 0x1B000000UL,
+ ALAC = 0x1C000000UL,
+ APE = 0x1D000000UL,
+ AAC_ADTS = 0x1E000000UL,
+ SBC = 0x1F000000UL,
+ APTX = 0x20000000UL,
+ APTX_HD = 0x21000000UL,
+ LDAC = 0x22000000UL,
MAIN_MASK = 0xFF000000UL, /* Deprecated */
SUB_MASK = 0x00FFFFFFUL,
@@ -261,7 +280,17 @@
AAC_ERLC = (AAC | AAC_SUB_ERLC),
AAC_LD = (AAC | AAC_SUB_LD),
AAC_HE_V2 = (AAC | AAC_SUB_HE_V2),
- AAC_ELD = (AAC | AAC_SUB_ELD)
+ AAC_ELD = (AAC | AAC_SUB_ELD),
+ AAC_ADTS_MAIN = (AAC_ADTS | AAC_SUB_MAIN),
+ AAC_ADTS_LC = (AAC_ADTS | AAC_SUB_LC),
+ AAC_ADTS_SSR = (AAC_ADTS | AAC_SUB_SSR),
+ AAC_ADTS_LTP = (AAC_ADTS | AAC_SUB_LTP),
+ AAC_ADTS_HE_V1 = (AAC_ADTS | AAC_SUB_HE_V1),
+ AAC_ADTS_SCALABLE = (AAC_ADTS | AAC_SUB_SCALABLE),
+ AAC_ADTS_ERLC = (AAC_ADTS | AAC_SUB_ERLC),
+ AAC_ADTS_LD = (AAC_ADTS | AAC_SUB_LD),
+ AAC_ADTS_HE_V2 = (AAC_ADTS | AAC_SUB_HE_V2),
+ AAC_ADTS_ELD = (AAC_ADTS | AAC_SUB_ELD)
};
/*
@@ -344,13 +373,17 @@
OUT_MONO = OUT_FRONT_LEFT,
OUT_STEREO = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT),
+ OUT_2POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_LOW_FREQUENCY),
OUT_QUAD = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
OUT_BACK_LEFT | OUT_BACK_RIGHT),
OUT_QUAD_BACK = OUT_QUAD,
/* like OUT_QUAD_BACK with *_SIDE_* instead of *_BACK_* */
OUT_QUAD_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
OUT_SIDE_LEFT | OUT_SIDE_RIGHT),
- OUT_5POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
+ OUT_SURROUND = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
+ OUT_FRONT_CENTER | OUT_BACK_CENTER),
+ OUT_PENTA = (OUT_QUAD | OUT_FRONT_CENTER),
+ OUT_5POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
OUT_FRONT_CENTER | OUT_LOW_FREQUENCY |
OUT_BACK_LEFT | OUT_BACK_RIGHT),
OUT_5POINT1_BACK = OUT_5POINT1,
@@ -358,6 +391,10 @@
OUT_5POINT1_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
OUT_FRONT_CENTER | OUT_LOW_FREQUENCY |
OUT_SIDE_LEFT | OUT_SIDE_RIGHT),
+ OUT_6POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
+ OUT_FRONT_CENTER | OUT_LOW_FREQUENCY |
+ OUT_BACK_LEFT | OUT_BACK_RIGHT |
+ OUT_BACK_CENTER),
/* matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND */
OUT_7POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
OUT_FRONT_CENTER | OUT_LOW_FREQUENCY |
@@ -394,6 +431,10 @@
IN_MONO = IN_FRONT,
IN_STEREO = (IN_LEFT | IN_RIGHT),
IN_FRONT_BACK = (IN_FRONT | IN_BACK),
+ IN_VOICE_UPLINK_MONO = (IN_VOICE_UPLINK | IN_MONO),
+ IN_VOICE_DNLINK_MONO = (IN_VOICE_DNLINK | IN_MONO),
+ IN_VOICE_CALL_MONO = (IN_VOICE_UPLINK_MONO |
+ IN_VOICE_DNLINK_MONO),
IN_ALL = (IN_LEFT | IN_RIGHT | IN_FRONT | IN_BACK|
IN_LEFT_PROCESSED | IN_RIGHT_PROCESSED |
IN_FRONT_PROCESSED | IN_BACK_PROCESSED|
@@ -491,6 +532,7 @@
OUT_IP = 0x800000,
/* audio bus implemented by the audio system (e.g an MOST stereo channel) */
OUT_BUS = 0x1000000,
+ OUT_PROXY = 0x2000000,
OUT_DEFAULT = BIT_DEFAULT,
OUT_ALL = (OUT_EARPIECE |
OUT_SPEAKER |
@@ -517,6 +559,7 @@
OUT_SPEAKER_SAFE |
OUT_IP |
OUT_BUS |
+ OUT_PROXY |
OUT_DEFAULT),
OUT_ALL_A2DP = (OUT_BLUETOOTH_A2DP |
OUT_BLUETOOTH_A2DP_HEADPHONES |
@@ -555,6 +598,7 @@
IN_IP = BIT_IN | 0x80000,
/* audio bus implemented by the audio system (e.g an MOST stereo channel) */
IN_BUS = BIT_IN | 0x100000,
+ IN_PROXY = BIT_IN | 0x1000000,
IN_DEFAULT = BIT_IN | BIT_DEFAULT,
IN_ALL = (IN_COMMUNICATION |
@@ -578,6 +622,7 @@
IN_LOOPBACK |
IN_IP |
IN_BUS |
+ IN_PROXY |
IN_DEFAULT),
IN_ALL_SCO = IN_BLUETOOTH_SCO_HEADSET,
IN_ALL_USB = (IN_USB_ACCESSORY | IN_USB_DEVICE),
@@ -618,6 +663,8 @@
SYNC = 0x200, // synchronize I/O streams
IEC958_NONAUDIO = 0x400, // Audio stream contains compressed audio in SPDIF
// data bursts, not PCM.
+ DIRECT_PCM = 0x2000, // Audio stream containing PCM data that needs
+ // to pass through compress path for DSP post proc.
};
/*
@@ -635,6 +682,32 @@
SYNC = 0x8, // synchronize I/O streams
};
+@export(name="audio_usage_t", value_prefix="AUDIO_USAGE_")
+enum AudioUsage : int32_t {
+ // These values must kept in sync with
+ // frameworks/base/media/java/android/media/AudioAttributes.java
+ // TODO: Synchronization should be done automatically by tools
+ UNKNOWN = 0,
+ MEDIA = 1,
+ VOICE_COMMUNICATION = 2,
+ VOICE_COMMUNICATION_SIGNALLING = 3,
+ ALARM = 4,
+ NOTIFICATION = 5,
+ NOTIFICATION_TELEPHONY_RINGTONE = 6,
+ NOTIFICATION_COMMUNICATION_REQUEST = 7,
+ NOTIFICATION_COMMUNICATION_INSTANT = 8,
+ NOTIFICATION_COMMUNICATION_DELAYED = 9,
+ NOTIFICATION_EVENT = 10,
+ ASSISTANCE_ACCESSIBILITY = 11,
+ ASSISTANCE_NAVIGATION_GUIDANCE = 12,
+ ASSISTANCE_SONIFICATION = 13,
+ GAME = 14,
+ VIRTUAL_SOURCE = 15,
+
+ CNT,
+ MAX = CNT - 1,
+};
+
/*
* Additional information about the stream passed to hardware decoders.
*/
@@ -647,6 +720,9 @@
int64_t durationMicroseconds; // -1 if unknown
bool hasVideo;
bool isStreaming;
+ uint32_t bitWidth;
+ uint32_t bufferSize;
+ AudioUsage usage;
};
/*
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index f29b916..62bc840 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -382,7 +382,7 @@
* override the one in the profile. empty string indicates no APN overrride.
* @param user is the username for APN, or empty string
* @param password is the password for APN, or empty string
- * @param authType is the PAP / CHAP auth type. Values:
+ * @param authType is the PAP / CHAP auth type.
* @param protocol is the connection type to request must be one of the
* PDP_type values in TS 27.007 section 10.1.1.
* For example, "IP", "IPV6", "IPV4V6", or "PPP".
@@ -1272,7 +1272,7 @@
* @param protocol is the connection type to request must be one of the
* PDP_type values in TS 27.007 section 10.1.1.
* For example, "IP", "IPV6", "IPV4V6", or "PPP".
- * @param authType is the PAP / CHAP auth type. Values:
+ * @param authType is the PAP / CHAP auth type.
* @param user is the username for APN, or empty string
* @param password is the password for APN, or empty string
*
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index c49286b..e25a30c 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -1934,4 +1934,13 @@
*/
oneway getAllowedCarriersResponse(RadioResponseInfo info, bool allAllowed,
CarrierRestrictions carriers);
+
+ /*
+ * Acknowldege the receipt of radio request sent to the vendor. This must be sent only for
+ * radio request which take long time to respond.
+ * For more details, refer https://source.android.com/devices/tech/connect/ril.html
+ *
+ * @param serial Serial no. of the request whose acknowledgement is sent.
+ */
+ oneway requestAcknowledgement(int32_t serial);
};
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index 194733a..9c4b453 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -1126,16 +1126,17 @@
};
struct GsmSignalStrength {
- uint32_t signalStrength; // Valid values are (0-31, 99) as defined in
- // TS 27.007 8.5
+ uint32_t signalStrength; // Valid values are (0-61, 99) as defined in
+ // TS 27.007 8.69
uint32_t bitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
int32_t timingAdvance; // Timing Advance in bit periods. 1 bit period = 48/13 us.
// INT_MAX denotes invalid value
};
struct WcdmaSignalStrength{
- int32_t signalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
- int32_t bitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
+ int32_t signalStrength; // Valid values are (0-96, 99) as defined in
+ // TS 27.007 8.69
+ int32_t bitErrorRate; // bit error rate (0-49, 99) as defined in TS 27.007 8.69
};
struct CdmaSignalStrength {
diff --git a/vehicle/2.0/vts/functional/Android.mk b/vehicle/2.0/vts/functional/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/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/vehicle/2.0/vts/functional/vts/Android.mk b/vehicle/2.0/vts/functional/vts/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/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/vehicle/2.0/vts/functional/vts/testcases/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/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/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/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/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/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/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/__init__.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/__init__.py
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/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/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/__init__.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/__init__.py
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/Android.mk b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/Android.mk
new file mode 100644
index 0000000..716a41c
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/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 := VehicleHidlTest
+VTS_CONFIG_SRC_DIR := testcases/hal/vehicle/hidl/host
+include test/vts/tools/build/Android.host_config.mk
\ No newline at end of file
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/AndroidTest.xml b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/AndroidTest.xml
new file mode 100644
index 0000000..16b7c29
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?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 HAL Vehicle test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="spec/hardware/interfaces/vehicle/2.0/vts/Vehicle.vts->/data/local/tmp/spec/Vehicle.vts" />
+ <option name="push" value="spec/hardware/interfaces/vehicle/2.0/vts/VehicleCallback.vts->/data/local/tmp/spec/VehicleCallBack.vts" />
+ <option name="push" value="spec/hardware/interfaces/vehicle/2.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="VehicleHidlTest" />
+ <option name="test-case-path" value="vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest" />
+ </test>
+</configuration>
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
new file mode 100644
index 0000000..bc37e59
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python3.4
+#
+# 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.
+#
+
+import logging
+import time
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test_with_webdb
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.profiling import profiling_utils
+
+
+class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
+ """A simple testcase for the VEHICLE HIDL HAL."""
+
+ def setUpClass(self):
+ """Creates a mirror and init vehicle hal."""
+ self.dut = self.registerController(android_device)[0]
+
+ self.dut.shell.InvokeTerminal("one")
+
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ self.dut.hal.InitHidlHal(
+ target_type="vehicle",
+ target_basepaths=["/system/lib64"],
+ target_version=2.0,
+ target_package="android.hardware.vehicle",
+ target_component_name="IVehicle",
+ bits=64)
+
+ def tearDownClass(self):
+ """ If profiling is enabled for the test, collect the profiling data
+ and disable profiling after the test is done.
+ """
+ if self.enable_profiling:
+ profiling_trace_path = getattr(
+ self, self.VTS_PROFILING_TRACING_PATH, "")
+ self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ profiling_utils.DisableVTSProfiling(self.dut.shell.one)
+
+ def testEcho1(self):
+ """A simple testcase which sends a command."""
+ self.dut.shell.InvokeTerminal("my_shell1") # creates a remote shell instance.
+ results = self.dut.shell.my_shell1.Execute("echo hello_world") # runs a shell command.
+ logging.info(str(results[const.STDOUT])) # prints the stdout
+ asserts.assertEqual(results[const.STDOUT][0].strip(), "hello_world") # checks the stdout
+ asserts.assertEqual(results[const.EXIT_CODE][0], 0) # checks the exit code
+
+ def testEcho2(self):
+ """A simple testcase which sends two commands."""
+ self.dut.shell.InvokeTerminal("my_shell2")
+ my_shell = getattr(self.dut.shell, "my_shell2")
+ results = my_shell.Execute(["echo hello", "echo world"])
+ logging.info(str(results[const.STDOUT]))
+ asserts.assertEqual(len(results[const.STDOUT]), 2) # check the number of processed commands
+ asserts.assertEqual(results[const.STDOUT][0].strip(), "hello")
+ asserts.assertEqual(results[const.STDOUT][1].strip(), "world")
+ asserts.assertEqual(results[const.EXIT_CODE][0], 0)
+ asserts.assertEqual(results[const.EXIT_CODE][1], 0)
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/__init__.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/__init__.py