Merge "[sensors] Add parameter check to poll()"
diff --git a/biometrics/fingerprint/2.1/Android.mk b/biometrics/fingerprint/2.1/Android.mk
new file mode 100644
index 0000000..c1412a8
--- /dev/null
+++ b/biometrics/fingerprint/2.1/Android.mk
@@ -0,0 +1,464 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+ android.hidl.base@1.0-java \
+
+
+#
+# Build types.hal (FingerprintAcquired)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquired.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.biometrics.fingerprint@2.1::types.FingerprintAcquired
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintAcquiredInfo)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquiredInfo.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.biometrics.fingerprint@2.1::types.FingerprintAcquiredInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintAuthenticated)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAuthenticated.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.biometrics.fingerprint@2.1::types.FingerprintAuthenticated
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintEnroll)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintEnroll.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.biometrics.fingerprint@2.1::types.FingerprintEnroll
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintError)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintError.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.biometrics.fingerprint@2.1::types.FingerprintError
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintFingerId)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintFingerId.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.biometrics.fingerprint@2.1::types.FingerprintFingerId
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintIterator)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintIterator.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.biometrics.fingerprint@2.1::types.FingerprintIterator
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintMsgType)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintMsgType.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.biometrics.fingerprint@2.1::types.FingerprintMsgType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RequestStatus)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/RequestStatus.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.biometrics.fingerprint@2.1::types.RequestStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprint.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprint.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.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.biometrics.fingerprint@2.1::IBiometricsFingerprint
+
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprint.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprintClientCallback.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprintClientCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.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.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback
+
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ android.hidl.base@1.0-java-static \
+
+
+#
+# Build types.hal (FingerprintAcquired)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquired.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.biometrics.fingerprint@2.1::types.FingerprintAcquired
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintAcquiredInfo)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAcquiredInfo.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.biometrics.fingerprint@2.1::types.FingerprintAcquiredInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintAuthenticated)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintAuthenticated.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.biometrics.fingerprint@2.1::types.FingerprintAuthenticated
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintEnroll)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintEnroll.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.biometrics.fingerprint@2.1::types.FingerprintEnroll
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintError)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintError.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.biometrics.fingerprint@2.1::types.FingerprintError
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintFingerId)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintFingerId.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.biometrics.fingerprint@2.1::types.FingerprintFingerId
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintIterator)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintIterator.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.biometrics.fingerprint@2.1::types.FingerprintIterator
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (FingerprintMsgType)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/FingerprintMsgType.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.biometrics.fingerprint@2.1::types.FingerprintMsgType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RequestStatus)
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/RequestStatus.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.biometrics.fingerprint@2.1::types.RequestStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprint.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprint.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.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.biometrics.fingerprint@2.1::IBiometricsFingerprint
+
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprint.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBiometricsFingerprintClientCallback.hal
+#
+GEN := $(intermediates)/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprintClientCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.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.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback
+
+$(GEN): $(LOCAL_PATH)/IBiometricsFingerprintClientCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
index 3b24a2c..0b92848 100644
--- a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
+++ b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@
* This call must block if the HAL state machine is in busy state until HAL
* leaves the busy state.
*
- * @return debugErrno is a value the framework logs in case it is not 0.
+ * @return deviceId is a unique handle for this fingerprint device
*/
@callflow(next={"setActiveGroup"})
@entry
setNotify(IBiometricsFingerprintClientCallback clientCallback)
- generates (RequestStatus debugErrno);
+ generates (uint64_t deviceId);
/*
* Fingerprint pre-enroll enroll request:
diff --git a/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal b/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
index 839bcd6..63435d1 100644
--- a/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
+++ b/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,12 +16,60 @@
package android.hardware.biometrics.fingerprint@2.1;
+/* This HAL interface communicates asynchronous results from the
+ fingerprint driver in response to user actions on the fingerprint sensor
+*/
interface IBiometricsFingerprintClientCallback {
- /* This function is the response channel for all messages
- * coming from the fingerprint HAL to the framework
- *
- * @param msg a union of message structures identified by
- * FingerprintMsg.type
+ /**
+ * Sent when one enrollment step is complete.
+ * @param deviceId the instance of this fingerprint device
+ * @param fingerId the fingerprint templetate being enrolled
+ * @param groupId the groupid for the template being enrolled
+ * @param remaining the number of remaining steps before enrolllment is complete
*/
- oneway notify(FingerprintMsg msg);
+ oneway onEnrollResult(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
+
+ /**
+ * Sent when a fingerprint image is acquired by the sensor
+ * @param deviceId the instance of this fingerprint device
+ * @param acquiredInfo a message about the quality of the acquired image
+ * @param vendorCode a vendor-specific message about the quality of the image. Only
+ * valid when acquiredInfo == ACQUIRED_VENDOR
+ */
+ oneway onAcquired(uint64_t deviceId, FingerprintAcquiredInfo acquiredInfo, int32_t vendorCode);
+
+ /**
+ * Sent when a fingerprint is authenticated
+ * @param deviceId the instance of this fingerprint device
+ * @param fingerId the fingerprint templetate that was authenticated
+ * @param groupId the groupid for the template that was authenticated
+ */
+ oneway onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId);
+
+ /**
+ * Sent when a fingerprint error occurs
+ * @param deviceId the instance of this fingerprint device
+ * @param error a message about the error that occurred
+ * @param vendorCode a vendor-speicifc error message. Only valid
+ * when error == ERROR_VENDOR
+ */
+ oneway onError(uint64_t deviceId, FingerprintError error, int32_t vendorCode);
+
+ /**
+ * Sent when one template is removed
+ * @param deviceId the instance of this fingerprint device
+ * @param fingerId the fingerprint templetate being removed
+ * @param groupId the groupid for the template being removed
+ * @param remaining the number of remaining templates that will be removed.
+ */
+ oneway onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
+
+ /**
+ * Sent when one fingerprint template is enumerated
+ * @param deviceId the instance of this fingerprint device
+ * @param fingerId the fingerprint for this templetate
+ * @param groupId the groupid for this template
+ * @param remaining the number of remaining steps before enumeration is complete
+ */
+ oneway onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
};
diff --git a/biometrics/fingerprint/2.1/default/Android.mk b/biometrics/fingerprint/2.1/default/Android.mk
index c487c7a..cd29b30 100644
--- a/biometrics/fingerprint/2.1/default/Android.mk
+++ b/biometrics/fingerprint/2.1/default/Android.mk
@@ -1,10 +1,12 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-impl
+LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-service
+LOCAL_INIT_RC := android.hardware.biometrics.fingerprint@2.1-service.rc
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
BiometricsFingerprint.cpp \
+ service.cpp \
LOCAL_SHARED_LIBRARIES := \
liblog \
@@ -15,4 +17,4 @@
libutils \
android.hardware.biometrics.fingerprint@2.1 \
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_EXECUTABLE)
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 1316686..9167e70 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-impl"
+#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
@@ -26,14 +26,25 @@
namespace V2_1 {
namespace implementation {
+// Supported fingerprint HAL version
+static const uint16_t kVersion = HARDWARE_MODULE_API_VERSION(2, 1);
+
using RequestStatus =
android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
sp<IBiometricsFingerprintClientCallback>
BiometricsFingerprint::mClientCallback = nullptr;
+// TODO: This is here because HAL 2.1 doesn't have a way to propagate a
+// unique token for its driver. Subsequent versions should send a unique
+// token for each call to notify(). This is fine as long as there's only
+// one fingerprint device on the platform.
+fingerprint_device_t *BiometricsFingerprint::sDevice = nullptr;
+
BiometricsFingerprint::BiometricsFingerprint(fingerprint_device_t *device)
- : mDevice(device) {}
+ : mDevice(device) {
+ sDevice = mDevice; // keep track of the most recent instance
+}
BiometricsFingerprint::~BiometricsFingerprint() {
ALOG(LOG_VERBOSE, LOG_TAG, "nativeCloseHal()\n");
@@ -70,10 +81,68 @@
}
}
-Return<RequestStatus> BiometricsFingerprint::setNotify(
+// Translate from errors returned by traditional HAL (see fingerprint.h) to
+// HIDL-compliant FingerprintError.
+FingerprintError BiometricsFingerprint::VendorErrorFilter(int32_t error,
+ int32_t* vendorCode) {
+ *vendorCode = 0;
+ switch(error) {
+ case FINGERPRINT_ERROR_HW_UNAVAILABLE:
+ return FingerprintError::ERROR_HW_UNAVAILABLE;
+ case FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
+ return FingerprintError::ERROR_UNABLE_TO_PROCESS;
+ case FINGERPRINT_ERROR_TIMEOUT:
+ return FingerprintError::ERROR_TIMEOUT;
+ case FINGERPRINT_ERROR_NO_SPACE:
+ return FingerprintError::ERROR_NO_SPACE;
+ case FINGERPRINT_ERROR_CANCELED:
+ return FingerprintError::ERROR_CANCELED;
+ case FINGERPRINT_ERROR_UNABLE_TO_REMOVE:
+ return FingerprintError::ERROR_UNABLE_TO_REMOVE;
+ default:
+ if (error >= FINGERPRINT_ERROR_VENDOR_BASE) {
+ // vendor specific code.
+ *vendorCode = error - FINGERPRINT_ERROR_VENDOR_BASE;
+ return FingerprintError::ERROR_VENDOR;
+ }
+ }
+ ALOGE("Unknown error from fingerprint vendor library");
+ return FingerprintError::ERROR_UNABLE_TO_PROCESS;
+}
+
+// Translate acquired messages returned by traditional HAL (see fingerprint.h)
+// to HIDL-compliant FingerprintAcquiredInfo.
+FingerprintAcquiredInfo BiometricsFingerprint::VendorAcquiredFilter(
+ int32_t info, int32_t* vendorCode) {
+ *vendorCode = 0;
+ switch(info) {
+ case FINGERPRINT_ACQUIRED_GOOD:
+ return FingerprintAcquiredInfo::ACQUIRED_GOOD;
+ case FINGERPRINT_ACQUIRED_PARTIAL:
+ return FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
+ case FINGERPRINT_ACQUIRED_INSUFFICIENT:
+ return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
+ case FINGERPRINT_ACQUIRED_IMAGER_DIRTY:
+ return FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
+ case FINGERPRINT_ACQUIRED_TOO_SLOW:
+ return FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
+ case FINGERPRINT_ACQUIRED_TOO_FAST:
+ return FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
+ default:
+ if (info >= FINGERPRINT_ACQUIRED_VENDOR_BASE) {
+ // vendor specific code.
+ *vendorCode = info - FINGERPRINT_ACQUIRED_VENDOR_BASE;
+ return FingerprintAcquiredInfo::ACQUIRED_VENDOR;
+ }
+ }
+ ALOGE("Unknown acquiredmsg from fingerprint vendor library");
+ return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
+}
+
+Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
mClientCallback = clientCallback;
- return RequestStatus::SYS_OK;
+ return reinterpret_cast<uint64_t>(mDevice);
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
@@ -121,7 +190,7 @@
return ErrorFilter(mDevice->authenticate(mDevice, operationId, gid));
}
-IBiometricsFingerprint* HIDL_FETCH_IBiometricsFingerprint(const char*) {
+IBiometricsFingerprint* BiometricsFingerprint::getInstance() {
int err;
const hw_module_t *hw_mdl = NULL;
ALOGE("Opening fingerprint hal library...");
@@ -129,6 +198,7 @@
ALOGE("Can't open fingerprint HW Module, error: %d", err);
return nullptr;
}
+
if (hw_mdl == NULL) {
ALOGE("No valid fingerprint module");
return nullptr;
@@ -148,6 +218,11 @@
return nullptr;
}
+ if (kVersion != device->version) {
+ ALOGE("Wrong fp version. Expected %d, got %d", kVersion, device->version);
+ return 0; // enforce this on new devices because of HIDL translation layer
+ }
+
fingerprint_device_t* fp_device =
reinterpret_cast<fingerprint_device_t*>(device);
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 6e599d1..bc85c1c 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -18,10 +18,12 @@
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
-
+#include <android/log.h>
+#include <hardware/hardware.h>
+#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
-#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <hidl/Status.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
@@ -43,8 +45,12 @@
public:
BiometricsFingerprint(fingerprint_device_t *device);
~BiometricsFingerprint();
+
+ // Method to wrap legacy HAL with BiometricsFingerprint class
+ static IBiometricsFingerprint* getInstance();
+
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
- Return<RequestStatus> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
+ Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
@@ -54,23 +60,64 @@
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
- static void notify(const fingerprint_msg_t *notify_msg) {
+ static void notify(const fingerprint_msg_t *msg) {
if (mClientCallback == nullptr) {
ALOGE("Receiving callbacks before the client callback is registered.");
return;
}
- FingerprintMsg msg = {};
- memcpy(&msg, notify_msg, sizeof(msg));
- mClientCallback->notify(msg);
+ const uint64_t devId = reinterpret_cast<uint64_t>(sDevice);
+ switch (msg->type) {
+ case FINGERPRINT_ERROR: {
+ int32_t vendorCode = 0;
+ FingerprintError result =
+ VendorErrorFilter(msg->data.error, &vendorCode);
+ mClientCallback->onError(devId, result, vendorCode);
+ }
+ break;
+ case FINGERPRINT_ACQUIRED: {
+ int32_t vendorCode = 0;
+ FingerprintAcquiredInfo result =
+ VendorAcquiredFilter(msg->data.acquired.acquired_info,
+ &vendorCode);
+ mClientCallback->onAcquired(devId, result, vendorCode);
+ }
+ break;
+ case FINGERPRINT_TEMPLATE_ENROLLING:
+ mClientCallback->onEnrollResult(devId,
+ msg->data.enroll.finger.fid,
+ msg->data.enroll.finger.gid,
+ msg->data.enroll.samples_remaining);
+ break;
+ case FINGERPRINT_TEMPLATE_REMOVED:
+ mClientCallback->onRemoved(devId,
+ msg->data.removed.finger.fid,
+ msg->data.removed.finger.gid,
+ msg->data.removed.remaining_templates);
+ break;
+ case FINGERPRINT_AUTHENTICATED:
+ mClientCallback->onAuthenticated(devId,
+ msg->data.authenticated.finger.fid,
+ msg->data.authenticated.finger.gid);
+ break;
+ case FINGERPRINT_TEMPLATE_ENUMERATING:
+ mClientCallback->onEnumerate(devId,
+ msg->data.enumerated.finger.fid,
+ msg->data.enumerated.finger.gid,
+ msg->data.enumerated.remaining_templates);
+ break;
+ }
}
private:
Return<RequestStatus> ErrorFilter(int32_t error);
+ static FingerprintError VendorErrorFilter(int32_t error,
+ int32_t* vendorCode);
+ static FingerprintAcquiredInfo VendorAcquiredFilter(int32_t error,
+ int32_t* vendorCode);
static sp<IBiometricsFingerprintClientCallback> mClientCallback;
fingerprint_device_t *mDevice;
+ static fingerprint_device_t *sDevice; // TODO: allow multiple drivers
};
-extern "C" IBiometricsFingerprint* HIDL_FETCH_IBiometricsFingerprint(const char* name);
-
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
diff --git a/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc b/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
index 741024d..3de52ad 100644
--- a/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
+++ b/biometrics/fingerprint/2.1/default/android.hardware.biometrics.fingerprint@2.1-service.rc
@@ -1,4 +1,7 @@
-service fingerprint@2.1 /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
- class hal
+service fps_hal /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
+ # "class hal" causes a race condition on some devices due to files created
+ # in /data. As a workaround, postpone startup until later in boot once
+ # /data is mounted.
+ class late_start
user system
- group system
\ No newline at end of file
+ group system input
diff --git a/biometrics/fingerprint/2.1/default/service.cpp b/biometrics/fingerprint/2.1/default/service.cpp
index 9867039..0563acb 100644
--- a/biometrics/fingerprint/2.1/default/service.cpp
+++ b/biometrics/fingerprint/2.1/default/service.cpp
@@ -16,13 +16,31 @@
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service"
+#include <android/log.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
-
-#include <hidl/LegacySupport.h>
+#include <android/hardware/biometrics/fingerprint/2.1/types.h>
+#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
-using android::hardware::defaultPassthroughServiceImplementation;
+using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::sp;
int main() {
- return defaultPassthroughServiceImplementation<IBiometricsFingerprint>("fingerprint");
+ android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance();
+
+ configureRpcThreadpool(1, true /*callerWillJoin*/);
+
+ if (bio != nullptr) {
+ bio->registerAsService("fingerprint_hal");
+ } else {
+ ALOGE("Can't create instance of BiometricsFingerprint, nullptr");
+ }
+
+ joinRpcThreadpool();
+
+ return 0; // should never get here
}
diff --git a/biometrics/fingerprint/2.1/types.hal b/biometrics/fingerprint/2.1/types.hal
index 201ec7c..f462906 100644
--- a/biometrics/fingerprint/2.1/types.hal
+++ b/biometrics/fingerprint/2.1/types.hal
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,6 +61,10 @@
ERROR_CANCELED = 5,
/* Unable to remove a template */
ERROR_UNABLE_TO_REMOVE = 6,
+ /* The hardware is in lockout due to too many attempts */
+ ERROR_LOCKOUT = 7,
+ /* Vendor-specific error message */
+ ERROR_VENDOR = 8
};
/*
@@ -84,7 +88,8 @@
ACQUIRED_TOO_SLOW = 4,
/* vendor-specific acquisition messages start here */
ACQUIRED_TOO_FAST = 5,
- ACQUIRED_VENDOR_BASE = 1000,
+ /* vendor-specific acquisition messages */
+ ACQUIRED_VENDOR = 6
};
struct FingerprintFingerId {
@@ -136,15 +141,3 @@
TEMPLATE_ENUMERATING = 6,
};
-struct FingerprintMsg {
- /* Selects the payload below */
- FingerprintMsgType type;
- union Data {
- FingerprintError error;
- FingerprintEnroll enroll;
- FingerprintEnumerated enumerated;
- FingerprintRemoved removed;
- FingerprintAcquired acquired;
- FingerprintAuthenticated authenticated;
- } data;
-};
diff --git a/bluetooth/1.0/IBluetoothHci.hal b/bluetooth/1.0/IBluetoothHci.hal
index 10cf914..8722616 100644
--- a/bluetooth/1.0/IBluetoothHci.hal
+++ b/bluetooth/1.0/IBluetoothHci.hal
@@ -35,12 +35,18 @@
* required to communicate with the Bluetooth hardware in the
* device.
*
+ * The |oninitializationComplete| callback must be invoked in response
+ * to this function to indicate success before any other function
+ * (sendHciCommand, sendAclData, * sendScoData) is invoked on this
+ * interface.
+ *
* @param callback implements IBluetoothHciCallbacks which will
* receive callbacks when incoming HCI packets are received
* from the controller to be sent to the host.
- * @return status result of the initialization
*/
- initialize(IBluetoothHciCallbacks callback) generates (Status status);
+ @entry
+ @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
+ initialize(IBluetoothHciCallbacks callback);
/**
* Send an HCI command (as specified in the Bluetooth Specification
@@ -49,6 +55,7 @@
*
* @param command is the HCI command to be sent
*/
+ @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
sendHciCommand(HciPacket command);
/**
@@ -57,6 +64,7 @@
* Packets must be processed in order.
* @param data HCI data packet to be sent
*/
+ @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
sendAclData(HciPacket data);
/**
@@ -65,10 +73,12 @@
* Packets must be processed in order.
* @param data HCI data packet to be sent
*/
+ @callflow(next={"sendHciCommand", "sendAclData", "sendScoData", "close"})
sendScoData(HciPacket data);
/**
* Close the HCI interface
*/
+ @exit
close();
};
diff --git a/bluetooth/1.0/IBluetoothHciCallbacks.hal b/bluetooth/1.0/IBluetoothHciCallbacks.hal
index afaab6c..15db1ce 100644
--- a/bluetooth/1.0/IBluetoothHciCallbacks.hal
+++ b/bluetooth/1.0/IBluetoothHciCallbacks.hal
@@ -19,21 +19,27 @@
/* The interface from the Bluetooth Controller to the stack. */
interface IBluetoothHciCallbacks {
/**
+ * Invoked when the Bluetooth controller initialization has been
+ * completed.
+ */
+ initializationComplete(Status status);
+
+ /**
* This function is invoked when an HCI event is received from the
* Bluetooth controller to be forwarded to the Bluetooth stack.
* @param event is the HCI event to be sent to the Bluetooth stack.
*/
- oneway hciEventReceived(HciPacket event);
+ hciEventReceived(HciPacket event);
/**
* Send an ACL data packet form the controller to the host.
* @param data the ACL HCI packet to be passed to the host stack
*/
- oneway aclDataReceived(HciPacket data);
+ aclDataReceived(HciPacket data);
/**
* Send a SCO data packet form the controller to the host.
* @param data the SCO HCI packet to be passed to the host stack
*/
- oneway scoDataReceived(HciPacket data);
+ scoDataReceived(HciPacket data);
};
diff --git a/bluetooth/1.0/default/bluetooth_hci.cc b/bluetooth/1.0/default/bluetooth_hci.cc
index d12bfb9..1559119 100644
--- a/bluetooth/1.0/default/bluetooth_hci.cc
+++ b/bluetooth/1.0/default/bluetooth_hci.cc
@@ -30,12 +30,16 @@
static const uint8_t HCI_DATA_TYPE_ACL = 2;
static const uint8_t HCI_DATA_TYPE_SCO = 3;
-Return<Status> BluetoothHci::initialize(
+Return<void> BluetoothHci::initialize(
const ::android::sp<IBluetoothHciCallbacks>& cb) {
ALOGW("BluetoothHci::initialize()");
event_cb_ = cb;
bool rc = VendorInterface::Initialize(
+ [this](bool status) {
+ event_cb_->initializationComplete(
+ status ? Status::SUCCESS : Status::INITIALIZATION_ERROR);
+ },
[this](HciPacketType type, const hidl_vec<uint8_t>& packet) {
switch (type) {
case HCI_PACKET_TYPE_EVENT:
@@ -52,9 +56,8 @@
break;
}
});
- if (!rc) return Status::INITIALIZATION_ERROR;
-
- return Status::SUCCESS;
+ if (!rc) event_cb_->initializationComplete(Status::INITIALIZATION_ERROR);
+ return Void();
}
Return<void> BluetoothHci::close() {
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index d297570..da1b411 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -32,7 +32,7 @@
class BluetoothHci : public IBluetoothHci {
public:
- Return<Status> initialize(
+ Return<void> initialize(
const ::android::sp<IBluetoothHciCallbacks>& cb) override;
Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override;
Return<void> sendAclData(const hidl_vec<uint8_t>& data) override;
diff --git a/bluetooth/1.0/default/service.cpp b/bluetooth/1.0/default/service.cpp
index a3c3cad..fa5106f 100644
--- a/bluetooth/1.0/default/service.cpp
+++ b/bluetooth/1.0/default/service.cpp
@@ -25,5 +25,5 @@
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
- return defaultPassthroughServiceImplementation<IBluetoothHci>("bluetooth");
+ return defaultPassthroughServiceImplementation<IBluetoothHci>();
}
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index 905e1a6..20b30ae 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -35,6 +35,7 @@
namespace {
using android::hardware::bluetooth::V1_0::implementation::VendorInterface;
+using android::hardware::hidl_vec;
tINT_CMD_CBACK internal_command_cb;
VendorInterface* g_vendor_interface = nullptr;
@@ -46,17 +47,14 @@
0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO,
HCI_LENGTH_OFFSET_EVT};
-size_t HciGetPacketLengthForType(
- HciPacketType type, const android::hardware::hidl_vec<uint8_t>& packet) {
+size_t HciGetPacketLengthForType(HciPacketType type,
+ const hidl_vec<uint8_t>& packet) {
size_t offset = packet_length_offset_for_type[type];
- if (type == HCI_PACKET_TYPE_ACL_DATA) {
- return (((packet[offset + 1]) << 8) | packet[offset]);
- }
- return packet[offset];
+ if (type != HCI_PACKET_TYPE_ACL_DATA) return packet[offset];
+ return (((packet[offset + 1]) << 8) | packet[offset]);
}
-HC_BT_HDR* WrapPacketAndCopy(uint16_t event,
- const android::hardware::hidl_vec<uint8_t>& data) {
+HC_BT_HDR* WrapPacketAndCopy(uint16_t event, const hidl_vec<uint8_t>& data) {
size_t packet_size = data.size() + sizeof(HC_BT_HDR);
HC_BT_HDR* packet = reinterpret_cast<HC_BT_HDR*>(new uint8_t[packet_size]);
packet->offset = 0;
@@ -71,17 +69,16 @@
uint8_t transmit_cb(uint16_t opcode, void* buffer, tINT_CMD_CBACK callback) {
ALOGV("%s opcode: 0x%04x, ptr: %p", __func__, opcode, buffer);
- HC_BT_HDR* bt_hdr = reinterpret_cast<HC_BT_HDR*>(buffer);
-
internal_command_cb = callback;
uint8_t type = HCI_PACKET_TYPE_COMMAND;
- VendorInterface::get()->SendPrivate(&type, 1);
- VendorInterface::get()->SendPrivate(bt_hdr->data, bt_hdr->len);
+ VendorInterface::get()->Send(&type, 1);
+ HC_BT_HDR* bt_hdr = reinterpret_cast<HC_BT_HDR*>(buffer);
+ VendorInterface::get()->Send(bt_hdr->data, bt_hdr->len);
return true;
}
void firmware_config_cb(bt_vendor_op_result_t result) {
- ALOGD("%s result: %d", __func__, result);
+ ALOGV("%s result: %d", __func__, result);
VendorInterface::get()->OnFirmwareConfigured(result);
}
@@ -131,10 +128,28 @@
namespace V1_0 {
namespace implementation {
-bool VendorInterface::Initialize(PacketReadCallback packet_read_cb) {
+class FirmwareStartupTimer {
+ public:
+ FirmwareStartupTimer() : start_time_(std::chrono::steady_clock::now()) {}
+
+ ~FirmwareStartupTimer() {
+ std::chrono::duration<double> duration =
+ std::chrono::steady_clock::now() - start_time_;
+ double s = duration.count();
+ if (s == 0) return;
+ ALOGD("Firmware configured in %.3fs", s);
+ }
+
+ private:
+ std::chrono::steady_clock::time_point start_time_;
+};
+
+bool VendorInterface::Initialize(
+ InitializeCompleteCallback initialize_complete_cb,
+ PacketReadCallback packet_read_cb) {
assert(!g_vendor_interface);
g_vendor_interface = new VendorInterface();
- return g_vendor_interface->Open(packet_read_cb);
+ return g_vendor_interface->Open(initialize_complete_cb, packet_read_cb);
}
void VendorInterface::Shutdown() {
@@ -146,8 +161,9 @@
VendorInterface* VendorInterface::get() { return g_vendor_interface; }
-bool VendorInterface::Open(PacketReadCallback packet_read_cb) {
- firmware_configured_ = false;
+bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
+ PacketReadCallback packet_read_cb) {
+ initialize_complete_cb_ = initialize_complete_cb;
packet_read_cb_ = packet_read_cb;
// Initialize vendor interface
@@ -209,6 +225,7 @@
[this](int fd) { OnDataReady(fd); });
// Start configuring the firmware
+ firmware_startup_timer_ = new FirmwareStartupTimer();
lib_interface_->op(BT_VND_OP_FW_CFG, nullptr);
return true;
@@ -229,31 +246,13 @@
lib_handle_ = nullptr;
}
- firmware_configured_ = false;
+ if (firmware_startup_timer_ != nullptr) {
+ delete firmware_startup_timer_;
+ firmware_startup_timer_ = nullptr;
+ }
}
size_t VendorInterface::Send(const uint8_t* data, size_t length) {
- if (firmware_configured_ && queued_data_.size() == 0)
- return SendPrivate(data, length);
-
- if (!firmware_configured_) {
- ALOGI("%s queueing command", __func__);
- queued_data_.resize(queued_data_.size() + length);
- uint8_t* append_ptr = &queued_data_[queued_data_.size() - length];
- memcpy(append_ptr, data, length);
- return length;
- }
-
- ALOGI("%s sending queued command", __func__);
- SendPrivate(queued_data_.data(), queued_data_.size());
- queued_data_.resize(0);
-
- ALOGI("%s done sending queued command", __func__);
-
- return SendPrivate(data, length);
-}
-
-size_t VendorInterface::SendPrivate(const uint8_t* data, size_t length) {
if (uart_fd_ == INVALID_FD) return 0;
size_t transmitted_length = 0;
@@ -280,9 +279,18 @@
}
void VendorInterface::OnFirmwareConfigured(uint8_t result) {
- ALOGI("%s: result = %d", __func__, result);
- firmware_configured_ = true;
- VendorInterface::get()->Send(NULL, 0);
+ ALOGD("%s result: %d", __func__, result);
+ internal_command_cb = nullptr;
+
+ if (firmware_startup_timer_ != nullptr) {
+ delete firmware_startup_timer_;
+ firmware_startup_timer_ = nullptr;
+ }
+
+ if (initialize_complete_cb_ != nullptr) {
+ initialize_complete_cb_(result == 0);
+ initialize_complete_cb_ = nullptr;
+ }
}
void VendorInterface::OnDataReady(int fd) {
@@ -331,16 +339,17 @@
hci_packet_bytes_remaining_ -= bytes_read;
hci_packet_bytes_read_ += bytes_read;
if (hci_packet_bytes_remaining_ == 0) {
- if (firmware_configured_) {
- if (packet_read_cb_ != nullptr) {
- packet_read_cb_(hci_packet_type_, hci_packet_);
- }
+ if (internal_command_cb != nullptr) {
+ HC_BT_HDR* bt_hdr =
+ WrapPacketAndCopy(HCI_PACKET_TYPE_EVENT, hci_packet_);
+ internal_command_cb(bt_hdr);
+ } else if (packet_read_cb_ != nullptr &&
+ initialize_complete_cb_ == nullptr) {
+ packet_read_cb_(hci_packet_type_, hci_packet_);
} else {
- if (internal_command_cb != nullptr) {
- HC_BT_HDR* bt_hdr =
- WrapPacketAndCopy(HCI_PACKET_TYPE_EVENT, hci_packet_);
- internal_command_cb(bt_hdr);
- }
+ ALOGE(
+ "%s HCI_PAYLOAD received without packet_read_cb or pending init.",
+ __func__);
}
hci_parser_state_ = HCI_IDLE;
}
diff --git a/bluetooth/1.0/default/vendor_interface.h b/bluetooth/1.0/default/vendor_interface.h
index 73ff2eb..450b99c 100644
--- a/bluetooth/1.0/default/vendor_interface.h
+++ b/bluetooth/1.0/default/vendor_interface.h
@@ -29,55 +29,50 @@
namespace implementation {
using ::android::hardware::hidl_vec;
+using InitializeCompleteCallback = std::function<void(bool success)>;
using PacketReadCallback =
std::function<void(HciPacketType, const hidl_vec<uint8_t> &)>;
+class FirmwareStartupTimer;
+
class VendorInterface {
public:
- static bool Initialize(PacketReadCallback packet_read_cb);
+ static bool Initialize(InitializeCompleteCallback initialize_complete_cb,
+ PacketReadCallback packet_read_cb);
static void Shutdown();
- static VendorInterface* get();
+ static VendorInterface *get();
size_t Send(const uint8_t *data, size_t length);
void OnFirmwareConfigured(uint8_t result);
- // Actually send the data.
- size_t SendPrivate(const uint8_t *data, size_t length);
-
private:
- VendorInterface() { queued_data_.resize(0); }
virtual ~VendorInterface() = default;
- bool Open(PacketReadCallback packet_read_cb);
+ bool Open(InitializeCompleteCallback initialize_complete_cb, PacketReadCallback packet_read_cb);
void Close();
void OnDataReady(int fd);
- // Queue data from Send() until the interface is ready.
- hidl_vec<uint8_t> queued_data_;
-
void *lib_handle_;
bt_vendor_interface_t *lib_interface_;
AsyncFdWatcher fd_watcher_;
int uart_fd_;
PacketReadCallback packet_read_cb_;
- bool firmware_configured_;
+ InitializeCompleteCallback initialize_complete_cb_;
- enum HciParserState {
- HCI_IDLE,
- HCI_TYPE_READY,
- HCI_PAYLOAD
- };
+ enum HciParserState { HCI_IDLE, HCI_TYPE_READY, HCI_PAYLOAD };
HciParserState hci_parser_state_{HCI_IDLE};
HciPacketType hci_packet_type_{HCI_PACKET_TYPE_UNKNOWN};
hidl_vec<uint8_t> hci_packet_;
size_t hci_packet_bytes_remaining_;
size_t hci_packet_bytes_read_;
+
+ FirmwareStartupTimer *firmware_startup_timer_;
};
-} // namespace implementation
-} // namespace V1_0
-} // namespace bluetooth
-} // namespace hardware
-} // namespace android
+} // namespace implementation
+} // namespace V1_0
+} // namespace bluetooth
+} // namespace hardware
+} // namespace android
diff --git a/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp b/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
index 2a4bbdd..683029e 100644
--- a/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
+++ b/bluetooth/1.0/vts/functional/bluetooth_hidl_hal_test.cpp
@@ -36,13 +36,12 @@
using ::android::hardware::Void;
using ::android::sp;
-#define Bluetooth_HCI_SERVICE_NAME "bluetooth"
-
#define HCI_MINIMUM_HCI_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define HCI_MINIMUM_LMP_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define NUM_HCI_COMMANDS_BANDWIDTH 1000
#define NUM_SCO_PACKETS_BANDWIDTH 1000
#define NUM_ACL_PACKETS_BANDWIDTH 1000
+#define WAIT_FOR_INIT_TIMEOUT std::chrono::milliseconds(2000)
#define WAIT_FOR_HCI_EVENT_TIMEOUT std::chrono::milliseconds(2000)
#define WAIT_FOR_SCO_DATA_TIMEOUT std::chrono::milliseconds(1000)
#define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
@@ -122,8 +121,8 @@
public:
virtual void SetUp() override {
// currently test passthrough mode only
- bluetooth = IBluetoothHci::getService(Bluetooth_HCI_SERVICE_NAME);
- ALOGW("%s: getService(%s) is %s", __func__, Bluetooth_HCI_SERVICE_NAME,
+ bluetooth = IBluetoothHci::getService();
+ ALOGW("%s: getService() for bluetooth is %s", __func__,
bluetooth->isRemote() ? "remote" : "local");
ASSERT_NE(bluetooth, nullptr);
@@ -135,6 +134,8 @@
max_acl_data_packets = 0;
max_sco_data_packets = 0;
+ initialized = false;
+ initialized_count = 0;
event_count = 0;
acl_count = 0;
sco_count = 0;
@@ -142,9 +143,12 @@
acl_cb_count = 0;
sco_cb_count = 0;
- // Collision with android::hardware::Status
- EXPECT_EQ(android::hardware::bluetooth::V1_0::Status::SUCCESS,
- bluetooth->initialize(bluetooth_cb));
+ ASSERT_EQ(initialized, false);
+ bluetooth->initialize(bluetooth_cb);
+
+ wait_for_init_callback();
+
+ ASSERT_EQ(initialized, true);
}
virtual void TearDown() override {
@@ -167,6 +171,26 @@
void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
int wait_for_completed_packets_event(uint16_t handle);
+ // Inform the test about the initialization callback
+ inline void notify_initialized() {
+ std::unique_lock<std::mutex> lock(initialized_mutex);
+ initialized_count++;
+ initialized_condition.notify_one();
+ }
+
+ // Test code calls this function to wait for the init callback
+ inline void wait_for_init_callback() {
+ std::unique_lock<std::mutex> lock(initialized_mutex);
+
+ auto start_time = std::chrono::steady_clock::now();
+ while (initialized_count == 0)
+ if (initialized_condition.wait_until(lock,
+ start_time + WAIT_FOR_INIT_TIMEOUT) ==
+ std::cv_status::timeout)
+ return;
+ initialized_count--;
+ }
+
// Inform the test about an event callback
inline void notify_event_received() {
std::unique_lock<std::mutex> lock(event_mutex);
@@ -230,6 +254,13 @@
virtual ~BluetoothHciCallbacks() = default;
+ Return<void> initializationComplete(Status status) override {
+ parent_.initialized = true;
+ parent_.notify_initialized();
+ ALOGV("%s (status = %d)", __func__, static_cast<int>(status));
+ return Void();
+ };
+
Return<void> hciEventReceived(
const ::android::hardware::hidl_vec<uint8_t>& event) override {
parent_.event_cb_count++;
@@ -262,6 +293,8 @@
std::queue<hidl_vec<uint8_t>> acl_queue;
std::queue<hidl_vec<uint8_t>> sco_queue;
+ bool initialized;
+
int event_cb_count;
int sco_cb_count;
int acl_cb_count;
@@ -272,12 +305,15 @@
int max_sco_data_packets;
private:
+ std::mutex initialized_mutex;
std::mutex event_mutex;
std::mutex sco_mutex;
std::mutex acl_mutex;
+ std::condition_variable initialized_condition;
std::condition_variable event_condition;
std::condition_variable sco_condition;
std::condition_variable acl_condition;
+ int initialized_count;
int event_count;
int sco_count;
int acl_count;
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
index 201a3b4..26b7b73 100644
--- a/camera/device/3.2/default/CameraDeviceSession.cpp
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -94,15 +94,7 @@
if (handle == nullptr || handle->numFds == 0) {
fd = -1;
} else if (handle->numFds == 1) {
-//TODO(b/34110242): make this hidl transport agnostic
-#ifdef BINDERIZED
fd = dup(handle->data[0]);
- // TODO(b/34169301)
- // Camera service expect FD be closed by HAL process (in passthrough mode)
- // close(handle->data[0]);
-#else
- fd = handle->data[0];
-#endif
if (fd < 0) {
ALOGE("failed to dup fence fd %d", handle->data[0]);
return false;
@@ -118,13 +110,9 @@
void closeFence(int fd)
{
-#ifdef BINDERIZED
if (fd >= 0) {
close(fd);
}
-#else
- (void) fd;
-#endif
}
private:
@@ -307,31 +295,40 @@
hidl_vec<buffer_handle_t*>& allBufPtrs,
hidl_vec<int>& allFences) {
bool hasInputBuf = (request.inputBuffer.streamId != -1 &&
- request.inputBuffer.buffer.getNativeHandle() != nullptr);
+ request.inputBuffer.bufferId != 0);
size_t numOutputBufs = request.outputBuffers.size();
size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
// Validate all I/O buffers
hidl_vec<buffer_handle_t> allBufs;
+ hidl_vec<uint64_t> allBufIds;
allBufs.resize(numBufs);
+ allBufIds.resize(numBufs);
allBufPtrs.resize(numBufs);
allFences.resize(numBufs);
std::vector<int32_t> streamIds(numBufs);
for (size_t i = 0; i < numOutputBufs; i++) {
allBufs[i] = request.outputBuffers[i].buffer.getNativeHandle();
+ allBufIds[i] = request.outputBuffers[i].bufferId;
allBufPtrs[i] = &allBufs[i];
streamIds[i] = request.outputBuffers[i].streamId;
}
if (hasInputBuf) {
allBufs[numOutputBufs] = request.inputBuffer.buffer.getNativeHandle();
+ allBufIds[numOutputBufs] = request.inputBuffer.bufferId;
allBufPtrs[numOutputBufs] = &allBufs[numOutputBufs];
streamIds[numOutputBufs] = request.inputBuffer.streamId;
}
for (size_t i = 0; i < numBufs; i++) {
buffer_handle_t buf = allBufs[i];
+ uint64_t bufId = allBufIds[i];
CirculatingBuffers& cbs = mCirculatingBuffers[streamIds[i]];
- if (cbs.count(buf) == 0) {
+ if (cbs.count(bufId) == 0) {
+ if (buf == nullptr) {
+ ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId);
+ return Status::ILLEGAL_ARGUMENT;
+ }
// Register a newly seen buffer
buffer_handle_t importedBuf = buf;
sHandleImporter.importBuffer(importedBuf);
@@ -339,10 +336,10 @@
ALOGE("%s: output buffer %zu is invalid!", __FUNCTION__, i);
return Status::INTERNAL_ERROR;
} else {
- cbs[buf] = importedBuf;
+ cbs[bufId] = importedBuf;
}
}
- allBufPtrs[i] = &cbs[buf];
+ allBufPtrs[i] = &cbs[bufId];
}
// All buffers are imported. Now validate output buffer acquire fences
@@ -509,7 +506,7 @@
hidl_vec<buffer_handle_t*> allBufPtrs;
hidl_vec<int> allFences;
bool hasInputBuf = (request.inputBuffer.streamId != -1 &&
- request.inputBuffer.buffer.getNativeHandle() != nullptr);
+ request.inputBuffer.bufferId != 0);
size_t numOutputBufs = request.outputBuffers.size();
size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
status = importRequest(request, allBufPtrs, allFences);
diff --git a/camera/device/3.2/default/CameraDeviceSession.h b/camera/device/3.2/default/CameraDeviceSession.h
index 498617e..ca9d24d 100644
--- a/camera/device/3.2/default/CameraDeviceSession.h
+++ b/camera/device/3.2/default/CameraDeviceSession.h
@@ -100,44 +100,12 @@
// (streamID, frameNumber) -> inflight buffer cache
std::map<std::pair<int, uint32_t>, camera3_stream_buffer_t> mInflightBuffers;
- struct BufferHasher {
- size_t operator()(const buffer_handle_t& buf) const {
- if (buf == nullptr)
- return 0;
-
- size_t result = 1;
- result = 31 * result + buf->numFds;
- result = 31 * result + buf->numInts;
- int length = buf->numFds + buf->numInts;
- for (int i = 0; i < length; i++) {
- result = 31 * result + buf->data[i];
- }
- return result;
- }
- };
-
- struct BufferComparator {
- bool operator()(const buffer_handle_t& buf1, const buffer_handle_t& buf2) const {
- if (buf1->numFds == buf2->numFds && buf1->numInts == buf2->numInts) {
- int length = buf1->numFds + buf1->numInts;
- for (int i = 0; i < length; i++) {
- if (buf1->data[i] != buf2->data[i]) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
- };
-
// buffers currently ciculating between HAL and camera service
- // key: buffer_handle_t sent via HIDL interface
+ // key: bufferId sent via HIDL interface
// value: imported buffer_handle_t
// Buffer will be imported during process_capture_request and will be freed
// when the its stream is deleted or camera device session is closed
- typedef std::unordered_map<buffer_handle_t, buffer_handle_t,
- BufferHasher, BufferComparator> CirculatingBuffers;
+ typedef std::unordered_map<uint64_t, buffer_handle_t> CirculatingBuffers;
// Stream ID -> circulating buffers map
std::map<int, CirculatingBuffers> mCirculatingBuffers;
diff --git a/camera/device/3.2/types.hal b/camera/device/3.2/types.hal
index 1e0924c..c07a670 100644
--- a/camera/device/3.2/types.hal
+++ b/camera/device/3.2/types.hal
@@ -405,16 +405,33 @@
/**
* The ID of the stream this buffer is associated with. -1 indicates an
* invalid (empty) StreamBuffer, in which case buffer must also point to
- * null.
+ * null and bufferId must be 0.
*/
int32_t streamId;
/**
+ * The unique ID of the buffer within this StreamBuffer. 0 indicates this
+ * StreamBuffer contains no buffer.
+ * For StreamBuffers sent to the HAL in a CaptureRequest, this ID uniquely
+ * identifies a buffer. When a buffer is sent to HAL for the first time,
+ * both bufferId and buffer handle must be filled. HAL must keep track of
+ * the mapping between bufferId and corresponding buffer until the
+ * corresponding stream is removed from stream configuration or until camera
+ * device session is closed. After the first time a buffer is introduced to
+ * HAL, in the future camera service must refer to the same buffer using
+ * only bufferId, and keep the buffer handle null.
+ */
+ uint64_t bufferId;
+
+ /**
* The graphics buffer handle to the buffer.
*
- * For StreamBuffers sent to the HAL in a CaptureRequest, this must be a
+ * For StreamBuffers sent to the HAL in a CaptureRequest, if the bufferId
+ * is not seen by the HAL before, this buffer handle is guaranteed to be a
* valid handle to a graphics buffer, with dimensions and format matching
- * that of the stream.
+ * that of the stream. If the bufferId has been sent to the HAL before, this
+ * buffer handle must be null and HAL must look up the actual buffer handle
+ * to use from its own bufferId to buffer handle map.
*
* For StreamBuffers returned in a CaptureResult, this must be null, since
* the handle to the buffer is already known to the client (since the client
diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal
index 42f2e2d..c0928d5 100644
--- a/contexthub/1.0/IContexthub.hal
+++ b/contexthub/1.0/IContexthub.hal
@@ -77,7 +77,8 @@
* device.
*
* @param hubId identifer of the contextHub
- * appBinary serialized NanoApppBinary for the nanoApp
+ * appBinary contains the binary representation of the nanoApp, plus
+ * metadata
* transactionId transactionId for this call
*
* @return result OK if transation started
@@ -88,7 +89,7 @@
*
*/
loadNanoApp(uint32_t hubId,
- vec<uint8_t> appBinary,
+ NanoAppBinary appBinary,
uint32_t transactionId)
generates (Result result);
diff --git a/contexthub/1.0/default/Contexthub.cpp b/contexthub/1.0/default/Contexthub.cpp
index 5f78004..4a6b3f2 100644
--- a/contexthub/1.0/default/Contexthub.cpp
+++ b/contexthub/1.0/default/Contexthub.cpp
@@ -22,6 +22,7 @@
#include <android/hardware/contexthub/1.0/IContexthub.h>
#include <hardware/context_hub.h>
+#include <sys/endian.h>
#undef LOG_TAG
#define LOG_TAG "ContextHubHalAdapter"
@@ -385,7 +386,7 @@
}
Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
- const ::android::hardware::hidl_vec<uint8_t>& appBinary,
+ const NanoAppBinary& appBinary,
uint32_t transactionId) {
if (!isInitialized()) {
return Result::NOT_INIT;
@@ -401,11 +402,34 @@
return Result::BAD_PARAMS;
}
- hubMsg.message_type = CONTEXT_HUB_LOAD_APP;
- hubMsg.message_len = appBinary.size();
- hubMsg.message = appBinary.data();
+ // Data from the nanoapp header is passed through HIDL as explicit fields,
+ // but the legacy HAL expects it prepended to the binary, therefore we must
+ // reconstruct it here prior to passing to the legacy HAL.
+ uint32_t targetChreApiVersion =
+ (appBinary.targetChreApiMajorVersion << 24) |
+ (appBinary.targetChreApiMinorVersion << 16);
+ const struct nano_app_binary_t header = {
+ .header_version = htole32(1),
+ .magic = htole32(NANOAPP_MAGIC),
+ .app_id.id = htole64(appBinary.appId),
+ .app_version = htole32(appBinary.appVersion),
+ .flags = htole32(appBinary.flags),
+ .hw_hub_type = htole64(0),
+ .reserved[0] = htole32(targetChreApiVersion),
+ .reserved[1] = 0,
+ };
+ const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);
- if(mContextHubModule->send_message(hubId, &hubMsg) != 0) {
+ std::vector<uint8_t> binaryWithHeader(appBinary.customBinary);
+ binaryWithHeader.insert(binaryWithHeader.begin(),
+ headerBytes,
+ headerBytes + sizeof(header));
+
+ hubMsg.message_type = CONTEXT_HUB_LOAD_APP;
+ hubMsg.message_len = binaryWithHeader.size();
+ hubMsg.message = binaryWithHeader.data();
+
+ if (mContextHubModule->send_message(hubId, &hubMsg) != 0) {
return Result::TRANSACTION_FAILED;
} else {
mTransactionId = transactionId;
diff --git a/contexthub/1.0/default/Contexthub.h b/contexthub/1.0/default/Contexthub.h
index 0883ce8..236e079 100644
--- a/contexthub/1.0/default/Contexthub.h
+++ b/contexthub/1.0/default/Contexthub.h
@@ -40,7 +40,7 @@
const ContextHubMsg &msg) override;
Return<Result> loadNanoApp(uint32_t hubId,
- const ::android::hardware::hidl_vec<uint8_t>& appBinary,
+ const NanoAppBinary& appBinary,
uint32_t transactionId) override;
Return<Result> unloadNanoApp(uint32_t hubId,
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index 2326b58..4950627 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -26,35 +26,26 @@
};
enum NanoAppFlags : uint32_t {
- SIGNED = (1<<0), // Signed nanoapp
- ENCRYPTED = (1<<1),// Encrypted nanoapp
-};
-
-enum HostEndPoint : uint16_t {
- BROADCAST = 0xFFFF, // The message endpoint is a broadcast end point.
- // This value must never be used for a message from
- // the host to the hub.
- // If BROADCAST is specified as a destination for a
- // message from the context hub to the ContextHub
- // service, the message must be broadcast to all
- // registered clients by the Context Hub service.
- UNSPECIFIED = 0xFFFE, // The message endpoint is unspecified. This value
- // must not be used for messages from the hub to host.
- // This value may be used for messages from the host
- // to the hub.
+ SIGNED = 1 << 0,
+ ENCRYPTED = 1 << 1,
};
struct NanoAppBinary {
- uint32_t headerVersion; // 0x1 for this version
- uint32_t magic; // "NANO"
- uint64_t appId; // App ID (contains vendor ID in most significant
- // 5 bytes)
- uint32_t appVersion; // Version of the app
- uint32_t flags; // Mask of NanoAppFlags
- uint64_t hwHubType; // Which hub type is this app is compiled for. A
- // unique ID for each h/w + toolchain
- // combination.
- vec<uint8_t> customBinary; // start of custom binary data
+ uint64_t appId; // Nanoapp identifier
+ uint32_t appVersion; // Version of the app (semantics defined by app)
+ bitfield<NanoAppFlags> flags;
+
+ // The version of the CHRE API that this nanoApp was compiled against. See
+ // the CHRE API header file chre/version.h for more information. The hub
+ // implementation must use this to confirm compatibility before loading
+ // this nanoApp.
+ uint8_t targetChreApiMajorVersion;
+ uint8_t targetChreApiMinorVersion;
+
+ // Implementation-specific binary nanoapp data. This does not include the
+ // common nanoapp header that contains the app ID, etc., as this data is
+ // explicitly passed through the other fields in this struct.
+ vec<uint8_t> customBinary;
};
enum SensorType : uint32_t {
@@ -130,20 +121,34 @@
// be sent to the hub in one chunk (in bytes)
// Machine-readable CHRE platform ID, returned to nanoapps in the CHRE API
- // function call chreGetPlatformId(). The most significant 5 bytes of this
- // value identify the vendor, while the remaining bytes are set by the
- // vendor to uniquely identify each different CHRE implementation/hardware
- // that the vendor supplies. This field pairs with the patch version part of
- // chreVersion to fully specify the CHRE implementation version. See also
- // the CHRE API header file chre/version.h.
+ // function call chreGetPlatformId(). This field pairs with
+ // chreApiMajorVersion, chreApiMinorVersion, and chrePatchVersion to fully
+ // specify the CHRE implementation version. See also the CHRE API header
+ // file chre/version.h.
uint64_t chrePlatformId;
- // CHRE implementation version, returned to nanoApps in the CHRE API
- // function call chreGetVersion(). This value consists of the implemented
- // CHRE API version (major version in most significant byte, followed by
- // minor version), and the platform-specific implementation patch version
- // in the lower two bytes. See also the CHRE API header file chre/version.h.
- uint32_t chreVersion;
+ // The version of the CHRE implementation returned to nanoApps in the CHRE
+ // API function call chreGetVersion(). The major and minor version specify
+ // the implemented version of the CHRE API, while the patch version
+ // describes the implementation version within the scope of the platform
+ // ID. See also the CHRE API header file chre/version.h.
+ uint8_t chreApiMajorVersion;
+ uint8_t chreApiMinorVersion;
+ uint16_t chrePatchVersion;
+};
+
+enum HostEndPoint : uint16_t {
+ BROADCAST = 0xFFFF, // The message endpoint is a broadcast end point.
+ // This value must never be used for a message from
+ // the host to the hub.
+ // If BROADCAST is specified as a destination for a
+ // message from the context hub to the ContextHub
+ // service, the message must be broadcast to all
+ // registered clients by the Context Hub service.
+ UNSPECIFIED = 0xFFFE, // The message endpoint is unspecified. This value
+ // must not be used for messages from the hub to host.
+ // This value may be used for messages from the host
+ // to the hub.
};
struct ContextHubMsg {
@@ -160,16 +165,16 @@
};
enum HubMemoryFlag : uint32_t {
- READ = (1<<0), // Readable
- WRITE = (1<<1), // Writable
- EXEC = (1<<2), // Executable
+ READ = 1 << 0, // Readable
+ WRITE = 1 << 1, // Writable
+ EXEC = 1 << 2, // Executable
};
struct MemRange {
uint32_t totalBytes; // Total capacity in bytes
uint32_t freeBytes; // Free capacity in bytes
HubMemoryType type; // Type of memory, see HubMemoryType
- uint32_t flags; // Mask of HubMemoryFlag
+ bitfield<HubMemoryFlag> flags;
};
enum AsyncEventType : uint32_t {
diff --git a/gnss/1.0/default/GnssUtils.cpp b/gnss/1.0/default/GnssUtils.cpp
index 4b3ca44..82a516b 100644
--- a/gnss/1.0/default/GnssUtils.cpp
+++ b/gnss/1.0/default/GnssUtils.cpp
@@ -28,7 +28,10 @@
GnssLocation gnssLocation = {};
if (location != nullptr) {
gnssLocation = {
- .gnssLocationFlags = location->flags,
+ // Bit operation AND with 1f below is needed to clear vertical accuracy,
+ // speed accuracy and bearing accuracy flags as some vendors are found
+ // to be setting these bits in pre-Android-O devices
+ .gnssLocationFlags = static_cast<uint16_t>(location->flags & 0x1f),
.latitudeDegrees = location->latitude,
.longitudeDegrees = location->longitude,
.altitudeMeters = location->altitude,
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 8ea4b97..c145bc2 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -64,3 +64,160 @@
"android.hidl.base@1.0",
],
}
+
+genrule {
+ name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "types.hal",
+ "IAllocator.hal",
+ "IAllocatorClient.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+ "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
+ "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "types.hal",
+ "IAllocator.hal",
+ "IAllocatorClient.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/types.vts.h",
+ "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
+ "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.allocator.vts.driver@2.0",
+ generated_sources: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++"],
+ generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libvts_common",
+ "libvts_datatype",
+ "libvts_measurement",
+ "libvts_multidevice_proto",
+ "libcamera_metadata",
+ "libprotobuf-cpp-full",
+ "android.hardware.graphics.common@1.0",
+ "android.hidl.base@1.0",
+ "android.hardware.graphics.allocator@2.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.graphics.common@1.0",
+ "android.hidl.base@1.0",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "IAllocator.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
+ "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "IAllocator.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
+ "android/hardware/graphics/allocator/2.0/types.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler",
+ generated_sources: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++"],
+ generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers"],
+ export_generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocator-vts.profiler_genc++_headers"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "libhidltransport",
+ "libvts_profiling",
+ "libvts_multidevice_proto",
+ "libprotobuf-cpp-full",
+ "android.hardware.graphics.common@1.0",
+ "android.hidl.base@1.0",
+ "android.hardware.graphics.allocator@2.0",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "IAllocatorClient.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
+ "android/hardware/graphics/allocator/2.0/types.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
+ srcs: [
+ "IAllocatorClient.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
+ "android/hardware/graphics/allocator/2.0/types.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler",
+ generated_sources: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++"],
+ generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers"],
+ export_generated_headers: ["android.hardware.graphics.allocator@2.0-IAllocatorClient-vts.profiler_genc++_headers"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "libhidltransport",
+ "libvts_profiling",
+ "libvts_multidevice_proto",
+ "libprotobuf-cpp-full",
+ "android.hardware.graphics.common@1.0",
+ "android.hidl.base@1.0",
+ "android.hardware.graphics.allocator@2.0",
+ ],
+}
+
diff --git a/graphics/allocator/2.0/vts/Allocator.vts b/graphics/allocator/2.0/vts/Allocator.vts
index 04d4314..e767cbd 100644
--- a/graphics/allocator/2.0/vts/Allocator.vts
+++ b/graphics/allocator/2.0/vts/Allocator.vts
@@ -4,6 +4,7 @@
package: "android.hardware.graphics.allocator"
+import: "android.hardware.graphics.allocator@2.0::IAllocatorClient"
import: "android.hardware.graphics.allocator@2.0::types"
interface: {
@@ -21,36 +22,10 @@
scalar_value: {
int32_t: 1
}
- }
- }
-
- attribute: {
- name: "::android::hardware::graphics::allocator::V2_0::IAllocator::BufferDescriptorInfo"
- type: TYPE_STRUCT
- struct_value: {
- name: "width"
- type: TYPE_SCALAR
- scalar_type: "uint32_t"
- }
- struct_value: {
- name: "height"
- type: TYPE_SCALAR
- scalar_type: "uint32_t"
- }
- struct_value: {
- name: "format"
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::PixelFormat"
- }
- struct_value: {
- name: "producerUsageMask"
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- struct_value: {
- name: "consumerUsageMask"
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
+ enumerator: "LAYERED_BUFFERS"
+ scalar_value: {
+ int32_t: 2
+ }
}
}
@@ -91,18 +66,15 @@
}
api: {
- name: "createDescriptor"
+ name: "createClient"
return_type_hidl: {
type: TYPE_ENUM
predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
}
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- arg: {
- type: TYPE_STRUCT
- predefined_type: "::android::hardware::graphics::allocator::V2_0::IAllocator::BufferDescriptorInfo"
+ type: TYPE_HIDL_INTERFACE
+ predefined_type: "IAllocatorClient"
+ is_callback: false
}
callflow: {
entry: true
@@ -112,104 +84,4 @@
}
}
- api: {
- name: "destroyDescriptor"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- callflow: {
- exit: true
- }
- callflow: {
- next: "*"
- }
- }
-
- api: {
- name: "testAllocate"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
- }
- arg: {
- type: TYPE_VECTOR
- vector_value: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- }
- callflow: {
- next: "allocate"
- }
- }
-
- api: {
- name: "allocate"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
- }
- return_type_hidl: {
- type: TYPE_VECTOR
- vector_value: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- }
- arg: {
- type: TYPE_VECTOR
- vector_value: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- }
- callflow: {
- next: "exportHandle"
- }
- }
-
- api: {
- name: "free"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- callflow: {
- exit: true
- }
- callflow: {
- next: "*"
- }
- }
-
- api: {
- name: "exportHandle"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
- }
- return_type_hidl: {
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
- }
- callflow: {
- next: "free"
- }
- }
-
}
diff --git a/graphics/allocator/2.0/vts/AllocatorClient.vts b/graphics/allocator/2.0/vts/AllocatorClient.vts
index face060..2ab19f7 100644
--- a/graphics/allocator/2.0/vts/AllocatorClient.vts
+++ b/graphics/allocator/2.0/vts/AllocatorClient.vts
@@ -9,6 +9,472 @@
interface: {
attribute: {
+ name: "::android::hardware::graphics::common::V1_0::PixelFormat"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "RGBA_8888"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "RGBX_8888"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "RGB_888"
+ scalar_value: {
+ int32_t: 3
+ }
+ enumerator: "RGB_565"
+ scalar_value: {
+ int32_t: 4
+ }
+ enumerator: "BGRA_8888"
+ scalar_value: {
+ int32_t: 5
+ }
+ enumerator: "RGBA_FP16"
+ scalar_value: {
+ int32_t: 22
+ }
+ enumerator: "YV12"
+ scalar_value: {
+ int32_t: 842094169
+ }
+ enumerator: "Y8"
+ scalar_value: {
+ int32_t: 538982489
+ }
+ enumerator: "Y16"
+ scalar_value: {
+ int32_t: 540422489
+ }
+ enumerator: "RAW16"
+ scalar_value: {
+ int32_t: 32
+ }
+ enumerator: "RAW10"
+ scalar_value: {
+ int32_t: 37
+ }
+ enumerator: "RAW12"
+ scalar_value: {
+ int32_t: 38
+ }
+ enumerator: "RAW_OPAQUE"
+ scalar_value: {
+ int32_t: 36
+ }
+ enumerator: "BLOB"
+ scalar_value: {
+ int32_t: 33
+ }
+ enumerator: "IMPLEMENTATION_DEFINED"
+ scalar_value: {
+ int32_t: 34
+ }
+ enumerator: "YCBCR_420_888"
+ scalar_value: {
+ int32_t: 35
+ }
+ enumerator: "YCBCR_422_888"
+ scalar_value: {
+ int32_t: 39
+ }
+ enumerator: "YCBCR_444_888"
+ scalar_value: {
+ int32_t: 40
+ }
+ enumerator: "FLEX_RGB_888"
+ scalar_value: {
+ int32_t: 41
+ }
+ enumerator: "FLEX_RGBA_8888"
+ scalar_value: {
+ int32_t: 42
+ }
+ enumerator: "YCBCR_422_SP"
+ scalar_value: {
+ int32_t: 16
+ }
+ enumerator: "YCRCB_420_SP"
+ scalar_value: {
+ int32_t: 17
+ }
+ enumerator: "YCBCR_422_I"
+ scalar_value: {
+ int32_t: 20
+ }
+ enumerator: "JPEG"
+ scalar_value: {
+ int32_t: 256
+ }
+ }
+ }
+
+ attribute: {
+ name: "::android::hardware::graphics::common::V1_0::Transform"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "FLIP_H"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "FLIP_V"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "ROT_90"
+ scalar_value: {
+ int32_t: 4
+ }
+ enumerator: "ROT_180"
+ scalar_value: {
+ int32_t: 3
+ }
+ enumerator: "ROT_270"
+ scalar_value: {
+ int32_t: 7
+ }
+ }
+ }
+
+ attribute: {
+ name: "::android::hardware::graphics::common::V1_0::Dataspace"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "UNKNOWN"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "ARBITRARY"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "STANDARD_SHIFT"
+ scalar_value: {
+ int32_t: 16
+ }
+ enumerator: "STANDARD_MASK"
+ scalar_value: {
+ int32_t: 4128768
+ }
+ enumerator: "STANDARD_UNSPECIFIED"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "STANDARD_BT709"
+ scalar_value: {
+ int32_t: 65536
+ }
+ enumerator: "STANDARD_BT601_625"
+ scalar_value: {
+ int32_t: 131072
+ }
+ enumerator: "STANDARD_BT601_625_UNADJUSTED"
+ scalar_value: {
+ int32_t: 196608
+ }
+ enumerator: "STANDARD_BT601_525"
+ scalar_value: {
+ int32_t: 262144
+ }
+ enumerator: "STANDARD_BT601_525_UNADJUSTED"
+ scalar_value: {
+ int32_t: 327680
+ }
+ enumerator: "STANDARD_BT2020"
+ scalar_value: {
+ int32_t: 393216
+ }
+ enumerator: "STANDARD_BT2020_CONSTANT_LUMINANCE"
+ scalar_value: {
+ int32_t: 458752
+ }
+ enumerator: "STANDARD_BT470M"
+ scalar_value: {
+ int32_t: 524288
+ }
+ enumerator: "STANDARD_FILM"
+ scalar_value: {
+ int32_t: 589824
+ }
+ enumerator: "STANDARD_DCI_P3"
+ scalar_value: {
+ int32_t: 655360
+ }
+ enumerator: "STANDARD_ADOBE_RGB"
+ scalar_value: {
+ int32_t: 720896
+ }
+ enumerator: "TRANSFER_SHIFT"
+ scalar_value: {
+ int32_t: 22
+ }
+ enumerator: "TRANSFER_MASK"
+ scalar_value: {
+ int32_t: 130023424
+ }
+ enumerator: "TRANSFER_UNSPECIFIED"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "TRANSFER_LINEAR"
+ scalar_value: {
+ int32_t: 4194304
+ }
+ enumerator: "TRANSFER_SRGB"
+ scalar_value: {
+ int32_t: 8388608
+ }
+ enumerator: "TRANSFER_SMPTE_170M"
+ scalar_value: {
+ int32_t: 12582912
+ }
+ enumerator: "TRANSFER_GAMMA2_2"
+ scalar_value: {
+ int32_t: 16777216
+ }
+ enumerator: "TRANSFER_GAMMA2_6"
+ scalar_value: {
+ int32_t: 20971520
+ }
+ enumerator: "TRANSFER_GAMMA2_8"
+ scalar_value: {
+ int32_t: 25165824
+ }
+ enumerator: "TRANSFER_ST2084"
+ scalar_value: {
+ int32_t: 29360128
+ }
+ enumerator: "TRANSFER_HLG"
+ scalar_value: {
+ int32_t: 33554432
+ }
+ enumerator: "RANGE_SHIFT"
+ scalar_value: {
+ int32_t: 27
+ }
+ enumerator: "RANGE_MASK"
+ scalar_value: {
+ int32_t: 939524096
+ }
+ enumerator: "RANGE_UNSPECIFIED"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "RANGE_FULL"
+ scalar_value: {
+ int32_t: 134217728
+ }
+ enumerator: "RANGE_LIMITED"
+ scalar_value: {
+ int32_t: 268435456
+ }
+ enumerator: "RANGE_EXTENDED"
+ scalar_value: {
+ int32_t: 402653184
+ }
+ enumerator: "SRGB_LINEAR"
+ scalar_value: {
+ int32_t: 512
+ }
+ enumerator: "V0_SRGB_LINEAR"
+ scalar_value: {
+ int32_t: 138477568
+ }
+ enumerator: "V0_SCRGB_LINEAR"
+ scalar_value: {
+ int32_t: 406913024
+ }
+ enumerator: "SRGB"
+ scalar_value: {
+ int32_t: 513
+ }
+ enumerator: "V0_SRGB"
+ scalar_value: {
+ int32_t: 142671872
+ }
+ enumerator: "V0_SCRGB"
+ scalar_value: {
+ int32_t: 411107328
+ }
+ enumerator: "JFIF"
+ scalar_value: {
+ int32_t: 257
+ }
+ enumerator: "V0_JFIF"
+ scalar_value: {
+ int32_t: 146931712
+ }
+ enumerator: "BT601_625"
+ scalar_value: {
+ int32_t: 258
+ }
+ enumerator: "V0_BT601_625"
+ scalar_value: {
+ int32_t: 281149440
+ }
+ enumerator: "BT601_525"
+ scalar_value: {
+ int32_t: 259
+ }
+ enumerator: "V0_BT601_525"
+ scalar_value: {
+ int32_t: 281280512
+ }
+ enumerator: "BT709"
+ scalar_value: {
+ int32_t: 260
+ }
+ enumerator: "V0_BT709"
+ scalar_value: {
+ int32_t: 281083904
+ }
+ enumerator: "DCI_P3_LINEAR"
+ scalar_value: {
+ int32_t: 139067392
+ }
+ enumerator: "DCI_P3"
+ scalar_value: {
+ int32_t: 155844608
+ }
+ enumerator: "DISPLAY_P3_LINEAR"
+ scalar_value: {
+ int32_t: 139067392
+ }
+ enumerator: "DISPLAY_P3"
+ scalar_value: {
+ int32_t: 143261696
+ }
+ enumerator: "ADOBE_RGB"
+ scalar_value: {
+ int32_t: 151715840
+ }
+ enumerator: "BT2020_LINEAR"
+ scalar_value: {
+ int32_t: 138805248
+ }
+ enumerator: "BT2020"
+ scalar_value: {
+ int32_t: 147193856
+ }
+ enumerator: "DEPTH"
+ scalar_value: {
+ int32_t: 4096
+ }
+ }
+ }
+
+ attribute: {
+ name: "::android::hardware::graphics::common::V1_0::ColorMode"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "NATIVE"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "STANDARD_BT601_625"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "STANDARD_BT601_625_UNADJUSTED"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "STANDARD_BT601_525"
+ scalar_value: {
+ int32_t: 3
+ }
+ enumerator: "STANDARD_BT601_525_UNADJUSTED"
+ scalar_value: {
+ int32_t: 4
+ }
+ enumerator: "STANDARD_BT709"
+ scalar_value: {
+ int32_t: 5
+ }
+ enumerator: "DCI_P3"
+ scalar_value: {
+ int32_t: 6
+ }
+ enumerator: "SRGB"
+ scalar_value: {
+ int32_t: 7
+ }
+ enumerator: "ADOBE_RGB"
+ scalar_value: {
+ int32_t: 8
+ }
+ }
+ }
+
+ attribute: {
+ name: "::android::hardware::graphics::common::V1_0::ColorTransform"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "IDENTITY"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "ARBITRARY_MATRIX"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "VALUE_INVERSE"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "GRAYSCALE"
+ scalar_value: {
+ int32_t: 3
+ }
+ enumerator: "CORRECT_PROTANOPIA"
+ scalar_value: {
+ int32_t: 4
+ }
+ enumerator: "CORRECT_DEUTERANOPIA"
+ scalar_value: {
+ int32_t: 5
+ }
+ enumerator: "CORRECT_TRITANOPIA"
+ scalar_value: {
+ int32_t: 6
+ }
+ }
+ }
+
+ attribute: {
+ name: "::android::hardware::graphics::common::V1_0::Hdr"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "DOLBY_VISION"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "HDR10"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "HLG"
+ scalar_value: {
+ int32_t: 3
+ }
+ }
+ }
+
+ attribute: {
name: "::android::hardware::graphics::allocator::V2_0::IAllocatorClient::BufferDescriptorInfo"
type: TYPE_STRUCT
struct_value: {
diff --git a/graphics/allocator/2.0/vts/types.vts b/graphics/allocator/2.0/vts/types.vts
index ac1bf3f..2b7e47a 100644
--- a/graphics/allocator/2.0/vts/types.vts
+++ b/graphics/allocator/2.0/vts/types.vts
@@ -132,100 +132,3 @@
}
}
-attribute: {
- name: "::android::hardware::graphics::allocator::V2_0::PixelFormat"
- type: TYPE_ENUM
- enum_value: {
- scalar_type: "int32_t"
-
- enumerator: "RGBA_8888"
- scalar_value: {
- int32_t: 1
- }
- enumerator: "RGBX_8888"
- scalar_value: {
- int32_t: 2
- }
- enumerator: "RGB_888"
- scalar_value: {
- int32_t: 3
- }
- enumerator: "RGB_565"
- scalar_value: {
- int32_t: 4
- }
- enumerator: "BGRA_8888"
- scalar_value: {
- int32_t: 5
- }
- enumerator: "YV12"
- scalar_value: {
- int32_t: 842094169
- }
- enumerator: "Y8"
- scalar_value: {
- int32_t: 538982489
- }
- enumerator: "Y16"
- scalar_value: {
- int32_t: 540422489
- }
- enumerator: "RAW16"
- scalar_value: {
- int32_t: 32
- }
- enumerator: "RAW10"
- scalar_value: {
- int32_t: 37
- }
- enumerator: "RAW12"
- scalar_value: {
- int32_t: 38
- }
- enumerator: "RAW_OPAQUE"
- scalar_value: {
- int32_t: 36
- }
- enumerator: "BLOB"
- scalar_value: {
- int32_t: 33
- }
- enumerator: "IMPLEMENTATION_DEFINED"
- scalar_value: {
- int32_t: 34
- }
- enumerator: "YCbCr_420_888"
- scalar_value: {
- int32_t: 35
- }
- enumerator: "YCbCr_422_888"
- scalar_value: {
- int32_t: 39
- }
- enumerator: "YCbCr_444_888"
- scalar_value: {
- int32_t: 40
- }
- enumerator: "FLEX_RGB_888"
- scalar_value: {
- int32_t: 41
- }
- enumerator: "FLEX_RGBA_8888"
- scalar_value: {
- int32_t: 42
- }
- enumerator: "YCbCr_422_SP"
- scalar_value: {
- int32_t: 16
- }
- enumerator: "YCrCb_420_SP"
- scalar_value: {
- int32_t: 17
- }
- enumerator: "YCbCr_422_I"
- scalar_value: {
- int32_t: 20
- }
- }
-}
-
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index b67afd1..721c632 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -44,3 +44,55 @@
"libutils",
],
}
+
+genrule {
+ name: "android.hardware.graphics.common.vts.driver@1.0_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.common@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/common/1.0/types.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.graphics.common.vts.driver@1.0_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.common@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/graphics/common/1.0/types.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.common.vts.driver@1.0",
+ generated_sources: ["android.hardware.graphics.common.vts.driver@1.0_genc++"],
+ generated_headers: ["android.hardware.graphics.common.vts.driver@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.graphics.common.vts.driver@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libvts_common",
+ "libvts_datatype",
+ "libvts_measurement",
+ "libvts_multidevice_proto",
+ "libcamera_metadata",
+ "libprotobuf-cpp-full",
+ "android.hardware.graphics.common@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ ],
+}
\ No newline at end of file
diff --git a/graphics/composer/2.1/default/IComposerCommandBuffer.h b/graphics/composer/2.1/default/IComposerCommandBuffer.h
index 7e14f19..65e7799 100644
--- a/graphics/composer/2.1/default/IComposerCommandBuffer.h
+++ b/graphics/composer/2.1/default/IComposerCommandBuffer.h
@@ -686,8 +686,7 @@
uint16_t* outLength)
{
if (mCommandEnd) {
- LOG_FATAL("endCommand was not called before command 0x%x",
- command);
+ LOG_FATAL("endCommand was not called for last command");
}
constexpr uint32_t opcode_mask =
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
index b800fba..455802d 100644
--- a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/light_hidl_hal_test/light_hidl_hal_test,
_64bit::DATA/nativetest64/light_hidl_hal_test/light_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
<option name="enable-profiling" value="true" />
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
index e8ef928..263086c 100644
--- a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/power_hidl_hal_test/power_hidl_hal_test,
_64bit::DATA/nativetest64/power_hidl_hal_test/power_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
<option name="enable-profiling" value="true" />
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
index 70eca84..db210d9 100644
--- a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
@@ -43,9 +43,6 @@
self.dut.shell.one.Execute(
"setprop vts.hal.vts.hidl.get_stub true")
- if self.enable_profiling:
- profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
self.dut.hal.InitHidlHal(
target_type="sensors",
target_basepaths=self.dut.libPaths,
@@ -60,9 +57,17 @@
and disable profiling after the test is done.
"""
if self.enable_profiling:
+ self.ProcessAndUploadTraceData()
+
+ def setUpTest(self):
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ def tearDownTest(self):
+ if self.enable_profiling:
profiling_trace_path = getattr(
self, self.VTS_PROFILING_TRACING_PATH, "")
- self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
profiling_utils.DisableVTSProfiling(self.dut.shell.one)
def testSensorsBasic(self):
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index 91e7ad1..5b50f39 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -64,3 +64,159 @@
"android.hidl.base@1.0",
],
}
+
+genrule {
+ name: "android.hardware.soundtrigger.vts.driver@2.0_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "types.hal",
+ "ISoundTriggerHw.hal",
+ "ISoundTriggerHwCallback.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/types.vts.cpp",
+ "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
+ "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.soundtrigger.vts.driver@2.0_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "types.hal",
+ "ISoundTriggerHw.hal",
+ "ISoundTriggerHwCallback.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/types.vts.h",
+ "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
+ "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.soundtrigger.vts.driver@2.0",
+ generated_sources: ["android.hardware.soundtrigger.vts.driver@2.0_genc++"],
+ generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libvts_common",
+ "libvts_datatype",
+ "libvts_measurement",
+ "libvts_multidevice_proto",
+ "libcamera_metadata",
+ "libprotobuf-cpp-full",
+ "android.hardware.audio.common@2.0",
+ "android.hidl.base@1.0",
+ "android.hardware.soundtrigger@2.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.audio.common@2.0",
+ "android.hidl.base@1.0",
+ ],
+}
+
+genrule {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "ISoundTriggerHw.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
+ "android/hardware/soundtrigger/2.0/types.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "ISoundTriggerHw.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
+ "android/hardware/soundtrigger/2.0/types.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler",
+ generated_sources: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++"],
+ generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers"],
+ export_generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHw-vts.profiler_genc++_headers"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "libhidltransport",
+ "libvts_profiling",
+ "libvts_multidevice_proto",
+ "libprotobuf-cpp-full",
+ "android.hardware.audio.common@2.0",
+ "android.hidl.base@1.0",
+ "android.hardware.soundtrigger@2.0",
+ ],
+}
+
+genrule {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "ISoundTriggerHwCallback.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
+ "android/hardware/soundtrigger/2.0/types.vts.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers",
+ tools: ["hidl-gen", "vtsc"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
+ srcs: [
+ "ISoundTriggerHwCallback.hal",
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
+ "android/hardware/soundtrigger/2.0/types.vts.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler",
+ generated_sources: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++"],
+ generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers"],
+ export_generated_headers: ["android.hardware.soundtrigger@2.0-ISoundTriggerHwCallback-vts.profiler_genc++_headers"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "libhidltransport",
+ "libvts_profiling",
+ "libvts_multidevice_proto",
+ "libprotobuf-cpp-full",
+ "android.hardware.audio.common@2.0",
+ "android.hidl.base@1.0",
+ "android.hardware.soundtrigger@2.0",
+ ],
+}
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index cad655c..fbec8d1 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -5,13 +5,19 @@
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
srcs: [
+ "types.hal",
"IBar.hal",
"IComplicated.hal",
+ "IFooCallback.hal",
+ "IImportRules.hal",
"IImportTypes.hal",
],
out: [
+ "android/hardware/tests/bar/1.0/types.cpp",
"android/hardware/tests/bar/1.0/BarAll.cpp",
"android/hardware/tests/bar/1.0/ComplicatedAll.cpp",
+ "android/hardware/tests/bar/1.0/FooCallbackAll.cpp",
+ "android/hardware/tests/bar/1.0/ImportRulesAll.cpp",
"android/hardware/tests/bar/1.0/ImportTypesAll.cpp",
],
}
@@ -21,11 +27,15 @@
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
srcs: [
+ "types.hal",
"IBar.hal",
"IComplicated.hal",
+ "IFooCallback.hal",
+ "IImportRules.hal",
"IImportTypes.hal",
],
out: [
+ "android/hardware/tests/bar/1.0/types.h",
"android/hardware/tests/bar/1.0/IBar.h",
"android/hardware/tests/bar/1.0/IHwBar.h",
"android/hardware/tests/bar/1.0/BnHwBar.h",
@@ -36,6 +46,16 @@
"android/hardware/tests/bar/1.0/BnHwComplicated.h",
"android/hardware/tests/bar/1.0/BpHwComplicated.h",
"android/hardware/tests/bar/1.0/BsComplicated.h",
+ "android/hardware/tests/bar/1.0/IFooCallback.h",
+ "android/hardware/tests/bar/1.0/IHwFooCallback.h",
+ "android/hardware/tests/bar/1.0/BnHwFooCallback.h",
+ "android/hardware/tests/bar/1.0/BpHwFooCallback.h",
+ "android/hardware/tests/bar/1.0/BsFooCallback.h",
+ "android/hardware/tests/bar/1.0/IImportRules.h",
+ "android/hardware/tests/bar/1.0/IHwImportRules.h",
+ "android/hardware/tests/bar/1.0/BnHwImportRules.h",
+ "android/hardware/tests/bar/1.0/BpHwImportRules.h",
+ "android/hardware/tests/bar/1.0/BsImportRules.h",
"android/hardware/tests/bar/1.0/IImportTypes.h",
"android/hardware/tests/bar/1.0/IHwImportTypes.h",
"android/hardware/tests/bar/1.0/BnHwImportTypes.h",
diff --git a/tests/bar/1.0/IFooCallback.hal b/tests/bar/1.0/IFooCallback.hal
new file mode 100644
index 0000000..f42ce85
--- /dev/null
+++ b/tests/bar/1.0/IFooCallback.hal
@@ -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.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+interface IFooCallback {
+};
diff --git a/tests/bar/1.0/IImportRules.hal b/tests/bar/1.0/IImportRules.hal
new file mode 100644
index 0000000..db454b0
--- /dev/null
+++ b/tests/bar/1.0/IImportRules.hal
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+import android.hardware.tests.foo@1.0;
+
+interface IImportRules {
+ // Note that there is a android.hardware.tests.foo@1.0::Outer in types.hal
+ struct Outer {
+ struct Inner {
+ int32_t data;
+ };
+ string data;
+ };
+
+ rule0a(Outer o); // should be resolved to Outer above
+ rule0a1(IImportRules.Outer o); // should be resolved to Outer above
+ rule0b(@1.0::IImportRules.Outer o);
+ rule0c(android.hardware.tests.foo@1.0::Outer o);
+ rule0d(@1.0::Outer o); // android.hardware.tests.foo@1.0::Outer
+ rule0e(Outer.Inner o); // should be resolved to Outer above
+ rule0f(@1.0::IImportRules.Outer.Inner o);
+ rule0g(android.hardware.tests.foo@1.0::Outer.Inner o);
+ rule0h(@1.0::Outer.Inner o); // android.hardware.tests.foo@1.0::Outer.Inner
+
+ rule1a(Def abc); // should be resolved to Def in types.hal in this package
+ rule1b(android.hardware.tests.foo@1.0::Def abc);
+
+ rule2a(Unrelated related);
+
+ // android.hardware.tests.foo@1.0::IFooCallback, since bar@1.0::IFooCallback is not imported.
+ rule2b(IFooCallback fooCallback);
+};
diff --git a/tests/bar/1.0/types.hal b/tests/bar/1.0/types.hal
new file mode 100644
index 0000000..30022ad
--- /dev/null
+++ b/tests/bar/1.0/types.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.bar@1.0;
+
+struct Def {
+ vec<string> vs;
+};
diff --git a/tests/baz/1.0/IBaz.hal b/tests/baz/1.0/IBaz.hal
index a2d961a..40e4024 100644
--- a/tests/baz/1.0/IBaz.hal
+++ b/tests/baz/1.0/IBaz.hal
@@ -40,6 +40,11 @@
int32_t[3][5] matrix3x5;
};
+ struct NestedStruct {
+ int32_t a;
+ vec<T> matrices;
+ };
+
@Fragile @NoReally(very="yes", array={"a","b","c"})
oneway doThis(float param);
@@ -64,4 +69,6 @@
returnABitField() generates (bitfield<BitField> good);
size(uint32_t size) generates (uint32_t size);
+
+ getNestedStructs() generates(vec<NestedStruct> data);
};
diff --git a/tests/foo/1.0/types.hal b/tests/foo/1.0/types.hal
index a01fc2d..6b4b697 100644
--- a/tests/foo/1.0/types.hal
+++ b/tests/foo/1.0/types.hal
@@ -22,6 +22,10 @@
handle z;
};
+struct Def {
+ string g;
+};
+
struct Outer {
struct Inner {
struct Deep {
diff --git a/thermal/1.0/IThermal.hal b/thermal/1.0/IThermal.hal
index e5f70cb..076b697 100644
--- a/thermal/1.0/IThermal.hal
+++ b/thermal/1.0/IThermal.hal
@@ -75,4 +75,19 @@
getCoolingDevices()
generates (ThermalStatus status, vec<CoolingDevice> devices);
+ /* Retrieves an undefined temperature value.
+ *
+ * @return status Status of the operation. If status code is FAILURE,
+ * the status.debugMessage must be populated with the human-readable
+ * error message.
+ * @return undefinedTemperature returns an undefined temperature value if
+ * status code is SUCCESS. Undefined temperature value is an
+ * unreachable constant device temperature value for HAL.
+ *
+ */
+ @callflow(next={"*"})
+ @entry
+ @exit
+ getUndefinedTemperature()
+ generates (ThermalStatus status, float undefinedTemperature);
};
diff --git a/thermal/1.0/default/Thermal.cpp b/thermal/1.0/default/Thermal.cpp
index 8a8ad0a..5bc313d 100644
--- a/thermal/1.0/default/Thermal.cpp
+++ b/thermal/1.0/default/Thermal.cpp
@@ -169,6 +169,13 @@
return Void();
}
+Return<void> Thermal::getUndefinedTemperature(getUndefinedTemperature_cb _hidl_cb) {
+ ThermalStatus status;
+ status.code = ThermalStatusCode::SUCCESS;
+ _hidl_cb(status, UNKNOWN_TEMPERATURE);
+ return Void();
+}
+
IThermal* HIDL_FETCH_IThermal(const char* /* name */) {
thermal_module_t* module;
status_t err = hw_get_module(THERMAL_HARDWARE_MODULE_ID,
diff --git a/thermal/1.0/default/Thermal.h b/thermal/1.0/default/Thermal.h
index 2e06289..eec0ff5 100644
--- a/thermal/1.0/default/Thermal.h
+++ b/thermal/1.0/default/Thermal.h
@@ -45,6 +45,7 @@
Return<void> getTemperatures(getTemperatures_cb _hidl_cb) override;
Return<void> getCpuUsages(getCpuUsages_cb _hidl_cb) override;
Return<void> getCoolingDevices(getCoolingDevices_cb _hidl_cb) override;
+ Return<void> getUndefinedTemperature(getUndefinedTemperature_cb _hidl_cb) override;
private:
thermal_module_t* mModule;
};
diff --git a/thermal/1.0/types.hal b/thermal/1.0/types.hal
index 8864f43..30cfdd9 100644
--- a/thermal/1.0/types.hal
+++ b/thermal/1.0/types.hal
@@ -46,27 +46,27 @@
/**
* Current temperature in Celsius. If not available set by HAL to
- * UNKNOWN_TEMPERATURE.
+ * undefined temperature value.
* Current temperature can be in any units if type=UNKNOWN.
*/
float currentValue;
/**
* Throttling temperature constant for this temperature.
- * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+ * If not available, set by HAL to undefined temperature value.
*/
float throttlingThreshold;
/**
* Shutdown temperature constant for this temperature.
- * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+ * If not available, set by HAL to undefined temperature value.
*/
float shutdownThreshold;
/**
* Threshold temperature above which the VR mode clockrate minimums cannot
* be maintained for this device.
- * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+ * If not available, set by HAL to undefined temperature value.
*/
float vrThrottlingThreshold;
@@ -135,7 +135,3 @@
*/
string debugMessage;
};
-
-/**
- * TODO(pbond): add float constant UNDEFINED_TEMPERATURE.
- */
diff --git a/thermal/1.0/vts/Thermal.vts b/thermal/1.0/vts/Thermal.vts
index e76d943..d8cc670 100644
--- a/thermal/1.0/vts/Thermal.vts
+++ b/thermal/1.0/vts/Thermal.vts
@@ -79,4 +79,25 @@
}
}
+ api: {
+ name: "getUndefinedTemperature"
+ return_type_hidl: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::ThermalStatus"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+ callflow: {
+ next: "*"
+ }
+ callflow: {
+ entry: true
+ }
+ callflow: {
+ exit: true
+ }
+ }
+
}
diff --git a/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
index 8a5ea2c..6eb6269 100644
--- a/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
+++ b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
@@ -43,8 +43,6 @@
#define THERMAL_SERVICE_NAME "thermal"
#define MONITORING_OPERATION_NUMBER 10
-#define UNDEFINED_TEMPERATURE (-FLT_MAX)
-
#define MAX_DEVICE_TEMPERATURE 200
#define MAX_FAN_SPEED 20000
@@ -56,6 +54,17 @@
ASSERT_NE(thermal_, nullptr);
baseSize_ = 0;
names_.clear();
+
+ {
+ float undefined_temperature;
+ thermal_->getUndefinedTemperature(
+ [&undefined_temperature](ThermalStatus status, float temperature) {
+ EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code);
+ EXPECT_LT(MAX_DEVICE_TEMPERATURE, std::abs(undefined_temperature));
+ undefined_temperature = temperature;
+ });
+ undefined_temperature_ = undefined_temperature;
+ }
}
virtual void TearDown() override {}
@@ -127,21 +136,20 @@
// .currentValue of known type is in Celsius and must be reasonable.
EXPECT_TRUE(temperature.type == TemperatureType::UNKNOWN ||
std::abs(temperature.currentValue) < MAX_DEVICE_TEMPERATURE ||
- temperature.currentValue == UNDEFINED_TEMPERATURE);
+ temperature.currentValue == undefined_temperature_);
// .name must not be empty.
EXPECT_LT(0u, temperature.name.size());
// .currentValue must not exceed .shutdwonThreshold if defined.
EXPECT_TRUE(temperature.currentValue < temperature.shutdownThreshold ||
- temperature.currentValue == UNDEFINED_TEMPERATURE ||
- temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+ temperature.currentValue == undefined_temperature_ ||
+ temperature.shutdownThreshold == undefined_temperature_);
// .throttlingThreshold must not exceed .shutdownThreshold if defined.
- EXPECT_TRUE(temperature.throttlingThreshold <
- temperature.shutdownThreshold ||
- temperature.throttlingThreshold == UNDEFINED_TEMPERATURE ||
- temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+ EXPECT_TRUE(temperature.throttlingThreshold < temperature.shutdownThreshold ||
+ temperature.throttlingThreshold == undefined_temperature_ ||
+ temperature.shutdownThreshold == undefined_temperature_);
}
// Check validity of CPU usage returned by Thermal HAL.
@@ -164,6 +172,7 @@
size_t baseSize_;
std::vector<hidl_string> names_;
+ float undefined_temperature_;
};
// Sanity test for Thermal::getTemperatures().
diff --git a/tv/cec/1.0/vts/Android.mk b/tv/cec/1.0/vts/Android.mk
index 60cc723..fc636f7 100644
--- a/tv/cec/1.0/vts/Android.mk
+++ b/tv/cec/1.0/vts/Android.mk
@@ -16,4 +16,4 @@
LOCAL_PATH := $(call my-dir)
-include $(call all-subdir-makefiles)
+include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_cec/hidl/Android.mk
diff --git a/tv/cec/1.0/vts/functional/Android.mk b/tv/cec/1.0/vts/functional/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/Android.mk b/tv/cec/1.0/vts/functional/vts/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/hal/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk b/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tv/input/1.0/vts/Android.mk b/tv/input/1.0/vts/Android.mk
index 040cfce..e0ad01e 100644
--- a/tv/input/1.0/vts/Android.mk
+++ b/tv/input/1.0/vts/Android.mk
@@ -16,4 +16,4 @@
LOCAL_PATH := $(call my-dir)
-include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_input/hidl/host/Android.mk
+include $(LOCAL_PATH)/functional/vts/testcases/hal/tv_input/hidl/Android.mk
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
index 77ee9d4..12c1c1b 100644
--- a/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -159,6 +159,18 @@
.prop = VehicleProperty::IGNITION_STATE,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ },
+
+ {
+ .prop = VehicleProperty::OBD2_LIVE_FRAME,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ },
+
+ {
+ .prop = VehicleProperty::OBD2_FREEZE_FRAME,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
}
};
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index 6cbcfe3..4541168 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -90,6 +90,14 @@
case VehicleProperty::IGNITION_STATE:
v = pool.obtainInt32(toInt(VehicleIgnitionState::ACC));
break;
+ case VehicleProperty::OBD2_LIVE_FRAME:
+ v = pool.obtainComplex();
+ *outStatus = fillObd2LiveFrame(&v);
+ break;
+ case VehicleProperty::OBD2_FREEZE_FRAME:
+ v = pool.obtainComplex();
+ *outStatus = fillObd2FreezeFrame(&v);
+ break;
default:
*outStatus = StatusCode::INVALID_ARG;
}
@@ -197,6 +205,78 @@
return StatusCode::OK;
}
+static std::vector<int32_t> fillObd2IntValues() {
+ std::vector<int32_t> intValues(toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX));
+#define SENSOR(name) toInt(Obd2IntegerSensorIndex:: name)
+ intValues[SENSOR(FUEL_SYSTEM_STATUS)] = toInt(FuelSystemStatus::CLOSED_LOOP);
+ intValues[SENSOR(MALFUNCTION_INDICATOR_LIGHT_ON)] = 0;
+ intValues[SENSOR(IGNITION_MONITORS_SUPPORTED)] = toInt(IgnitionMonitorKind::SPARK);
+ intValues[SENSOR(IGNITION_SPECIFIC_MONITORS)] =
+ CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
+ CommonIgnitionMonitors::MISFIRE_AVAILABLE |
+ SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
+ SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE;
+ intValues[SENSOR(INTAKE_AIR_TEMPERATURE)] = 35;
+ intValues[SENSOR(COMMANDED_SECONDARY_AIR_STATUS)] =
+ toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF);
+ intValues[SENSOR(NUM_OXYGEN_SENSORS_PRESENT)] = 1;
+ intValues[SENSOR(RUNTIME_SINCE_ENGINE_START)] = 500;
+ intValues[SENSOR(DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON)] = 0;
+ intValues[SENSOR(WARMUPS_SINCE_CODES_CLEARED)] = 51;
+ intValues[SENSOR(DISTANCE_TRAVELED_SINCE_CODES_CLEARED)] = 365;
+ intValues[SENSOR(ABSOLUTE_BAROMETRIC_PRESSURE)] = 30;
+ intValues[SENSOR(CONTROL_MODULE_VOLTAGE)] = 12;
+ intValues[SENSOR(AMBIENT_AIR_TEMPERATURE)] = 18;
+ intValues[SENSOR(MAX_FUEL_AIR_EQUIVALENCE_RATIO)] = 1;
+ intValues[SENSOR(FUEL_TYPE)] = toInt(FuelType::GASOLINE);
+#undef SENSOR
+ return intValues;
+}
+
+static std::vector<float> fillObd2FloatValues() {
+ std::vector<float> floatValues(toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX));
+#define SENSOR(name) toInt(Obd2FloatSensorIndex:: name)
+ floatValues[SENSOR(CALCULATED_ENGINE_LOAD)] = 0.153;
+ floatValues[SENSOR(SHORT_TERM_FUEL_TRIM_BANK1)] = -0.16;
+ floatValues[SENSOR(LONG_TERM_FUEL_TRIM_BANK1)] = -0.16;
+ floatValues[SENSOR(SHORT_TERM_FUEL_TRIM_BANK2)] = -0.16;
+ floatValues[SENSOR(LONG_TERM_FUEL_TRIM_BANK2)] = -0.16;
+ floatValues[SENSOR(INTAKE_MANIFOLD_ABSOLUTE_PRESSURE)] = 7.5;
+ floatValues[SENSOR(ENGINE_RPM)] = 1250.;
+ floatValues[SENSOR(VEHICLE_SPEED)] = 40.;
+ floatValues[SENSOR(TIMING_ADVANCE)] = 2.5;
+ floatValues[SENSOR(THROTTLE_POSITION)] = 19.75;
+ floatValues[SENSOR(OXYGEN_SENSOR1_VOLTAGE)] = 0.265;
+ floatValues[SENSOR(FUEL_TANK_LEVEL_INPUT)] = 0.824;
+ floatValues[SENSOR(EVAPORATION_SYSTEM_VAPOR_PRESSURE)] = -0.373;
+ floatValues[SENSOR(CATALYST_TEMPERATURE_BANK1_SENSOR1)] = 190.;
+ floatValues[SENSOR(RELATIVE_THROTTLE_POSITION)] = 3.;
+ floatValues[SENSOR(ABSOLUTE_THROTTLE_POSITION_B)] = 0.306;
+ floatValues[SENSOR(ACCELERATOR_PEDAL_POSITION_D)] = 0.188;
+ floatValues[SENSOR(ACCELERATOR_PEDAL_POSITION_E)] = 0.094;
+ floatValues[SENSOR(COMMANDED_THROTTLE_ACTUATOR)] = 0.024;
+#undef SENSOR
+ return floatValues;
+}
+
+StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValuePtr* v) {
+ static std::vector<int32_t> intValues(fillObd2IntValues());
+ static std::vector<float> floatValues(fillObd2FloatValues());
+ (*v)->value.int32Values = intValues;
+ (*v)->value.floatValues = floatValues;
+ return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::fillObd2FreezeFrame(VehiclePropValuePtr* v) {
+ static std::vector<int32_t> intValues(fillObd2IntValues());
+ static std::vector<float> floatValues(fillObd2FloatValues());
+ (*v)->value.int32Values = intValues;
+ (*v)->value.floatValues = floatValues;
+ (*v)->value.stringValue = "P0010";
+ return StatusCode::OK;
+}
+
+
} // impl
} // namespace V2_0
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.h b/vehicle/2.0/default/impl/DefaultVehicleHal.h
index 231f2b2..15a4789 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -57,6 +57,8 @@
StatusCode setHvacTemperature(int32_t areaId, float value);
StatusCode getHvacDefroster(int32_t areaId, bool* outValue);
StatusCode setHvacDefroster(int32_t areaId, bool value);
+ StatusCode fillObd2LiveFrame (VehiclePropValuePtr* v);
+ StatusCode fillObd2FreezeFrame (VehiclePropValuePtr* v);
private:
int32_t mFanSpeed = 3;
int32_t mBrightness = 7;
diff --git a/vehicle/2.0/vts/Android.mk b/vehicle/2.0/vts/Android.mk
index df5dac8..31fa999 100644
--- a/vehicle/2.0/vts/Android.mk
+++ b/vehicle/2.0/vts/Android.mk
@@ -16,4 +16,4 @@
LOCAL_PATH := $(call my-dir)
-include $(call all-subdir-makefiles)
\ No newline at end of file
+include $(LOCAL_PATH)/functional/vts/testcases/hal/vehicle/hidl/Android.mk
\ No newline at end of file
diff --git a/vehicle/2.0/vts/functional/Android.mk b/vehicle/2.0/vts/functional/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-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
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-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
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-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
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-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
deleted file mode 100644
index f9e3276..0000000
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/Android.mk
+++ /dev/null
@@ -1,19 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
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
index 715cba8..5faf78a 100644
--- 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
@@ -35,9 +35,6 @@
self.dut.shell.InvokeTerminal("one")
self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode
- if self.enable_profiling:
- profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
self.dut.hal.InitHidlHal(
target_type="vehicle",
target_basepaths=self.dut.libPaths,
@@ -58,9 +55,17 @@
and disable profiling after the test is done.
"""
if self.enable_profiling:
+ self.ProcessAndUploadTraceData()
+
+ def setUpTest(self):
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ def tearDownTest(self):
+ if self.enable_profiling:
profiling_trace_path = getattr(
self, self.VTS_PROFILING_TRACING_PATH, "")
- self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
profiling_utils.DisableVTSProfiling(self.dut.shell.one)
def testListProperties(self):
@@ -84,6 +89,40 @@
asserts.assertEqual(0, len(mandatoryProps))
+ def getSupportInfo(self):
+ """Check whether OBD2_{LIVE|FREEZE}_FRAME is supported."""
+ isLiveSupported, isFreezeSupported = False, False
+ allConfigs = self.vehicle.getAllPropConfigs()
+ for config in allConfigs:
+ if config['prop'] == self.vtypes.OBD2_LIVE_FRAME:
+ isLiveSupported = True
+ elif config['prop'] == self.vtypes.OBD2_FREEZE_FRAME:
+ isFreezeSupported = True
+ if isLiveSupported and isFreezeSupported:
+ break
+ return isLiveSupported, isFreezeSupported
+
+ def testObd2SensorProperties(self):
+ """Test reading the live and freeze OBD2 frame properties.
+
+ OBD2 (On-Board Diagnostics 2) is the industry standard protocol
+ for retrieving diagnostic sensor information from vehicles.
+ """
+ def checkLiveFrameRead():
+ """Validates reading the OBD2_LIVE_FRAME (if available)."""
+ logging.info("checkLiveFrameRead no-op pass")
+
+ def checkFreezeFrameRead():
+ """Validates reading the OBD2_FREEZE_FRAME (if available)."""
+ logging.info("checkLiveFrameRead no-op pass")
+
+ isLiveSupported, isFreezeSupported = self.getSupportInfo()
+ logging.info("isLiveSupported = %s, isFreezeSupported = %s",
+ isLiveSupported, isFreezeSupported)
+ if isLiveSupported:
+ checkLiveFrameRead()
+ if isFreezeSupported:
+ checkFreezeFrameRead()
if __name__ == "__main__":
test_runner.main()
diff --git a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
index da70474..498ea06 100644
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
+++ b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
@@ -39,9 +39,6 @@
self.dut.shell.one.Execute(
"setprop vts.hal.vts.hidl.get_stub true")
- if self.enable_profiling:
- profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
self.dut.hal.InitHidlHal(
target_type="vibrator",
target_basepaths=self.dut.libPaths,
@@ -56,9 +53,17 @@
and disable profiling after the test is done.
"""
if self.enable_profiling:
+ self.ProcessAndUploadTraceData()
+
+ def setUpTest(self):
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ def tearDownTest(self):
+ if self.enable_profiling:
profiling_trace_path = getattr(
self, self.VTS_PROFILING_TRACING_PATH, "")
- self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
profiling_utils.DisableVTSProfiling(self.dut.shell.one)
def testVibratorBasic(self):
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
index 933fcde..d20e9ce 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
@@ -39,9 +39,6 @@
self.dut.shell.one.Execute(
"setprop vts.hal.vts.hidl.get_stub true")
- if self.enable_profiling:
- profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
self.dut.hal.InitHidlHal(
target_type="vr",
target_basepaths=["/system/lib64"],
@@ -56,9 +53,17 @@
and disable profiling after the test is done.
"""
if self.enable_profiling:
+ self.ProcessAndUploadTraceData()
+
+ def setUpTest(self):
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ def tearDownTest(self):
+ if self.enable_profiling:
profiling_trace_path = getattr(
self, self.VTS_PROFILING_TRACING_PATH, "")
- self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ self.ProcessTraceDataForTestCase(self.dut, profiling_trace_path)
profiling_utils.DisableVTSProfiling(self.dut.shell.one)
def testVrBasic(self):
diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal
index 0d6b560..7dad8af 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -81,13 +81,17 @@
*/
TDLS_OFFCHANNEL = 1 << 11,
/**
+ * Support for neighbour discovery offload.
+ */
+ ND_OFFLOAD = 1 << 12,
+ /**
* Support for keep alive packet offload.
*/
- KEEP_ALIVE = 1 << 12,
+ KEEP_ALIVE = 1 << 13,
/**
* Support for tracking connection packets' fate.
*/
- DEBUG_PACKET_FATE = 1 << 13
+ DEBUG_PACKET_FATE = 1 << 14
};
/**
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 80cc56e..bbb9346 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -82,6 +82,8 @@
return HidlStaIfaceCaps::TDLS;
case WIFI_FEATURE_TDLS_OFFCHANNEL:
return HidlStaIfaceCaps::TDLS_OFFCHANNEL;
+ case WIFI_FEATURE_CONFIG_NDO:
+ return HidlStaIfaceCaps::ND_OFFLOAD;
case WIFI_FEATURE_MKEEP_ALIVE:
return HidlStaIfaceCaps::KEEP_ALIVE;
};
@@ -242,6 +244,7 @@
WIFI_FEATURE_PNO,
WIFI_FEATURE_TDLS,
WIFI_FEATURE_TDLS_OFFCHANNEL,
+ WIFI_FEATURE_CONFIG_NDO,
WIFI_FEATURE_MKEEP_ALIVE}) {
if (feature & legacy_feature_set) {
*hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature);
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
index 35985fc..ddf05cc 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -537,4 +537,57 @@
*/
setMiracastMode(MiracastMode mode)
generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Push Button setup.
+ * The PBC operation requires that a button is also pressed at the
+ * AP/Registrar at about the same time (2 minute window).
+ *
+ * @param groupIfName Group interface name to use.
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ startWpsPbc(string groupIfName, Bssid bssid)
+ generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Pin Keypad setup.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param pin 8 digit pin to be used.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ startWpsPinKeypad(string groupIfName, string pin)
+ generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Pin Display setup.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * @return generatedPin 8 digit pin generated.
+ */
+ startWpsPinDisplay(string groupIfName, Bssid bssid)
+ generates (SupplicantStatus status, string generatedPin);
+
+ /**
+ * Cancel any ongoing WPS operations.
+ *
+ * @param groupIfName Group interface name to use.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ cancelWps(string groupIfName) generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.0/ISupplicantStaIface.hal b/wifi/supplicant/1.0/ISupplicantStaIface.hal
index 2fc4d0f..0f0d41b 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIface.hal
@@ -319,4 +319,64 @@
*/
setCountryCode(int8_t[2] code)
generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS setup in registrar role to learn the current AP configuration.
+ *
+ * @param bssid BSSID of the AP.
+ * @param pin Pin of the AP.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ startWpsRegistrar(Bssid bssid, string pin)
+ generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Push Button setup.
+ * The PBC operation requires that a button is also pressed at the
+ * AP/Registrar at about the same time (2 minute window).
+ *
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ startWpsPbc(Bssid bssid) generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Pin Keypad setup.
+ *
+ * @param pin 8 digit pin to be used.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ startWpsPinKeypad(string pin) generates (SupplicantStatus status);
+
+ /**
+ * Initiate WPS Pin Display setup.
+ *
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * @return generatedPin 8 digit pin generated.
+ */
+ startWpsPinDisplay(Bssid bssid)
+ generates (SupplicantStatus status, string generatedPin);
+
+ /**
+ * Cancel any ongoing WPS operations.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ cancelWps() generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
index 8a894a0..55ff9a8 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
@@ -139,6 +139,43 @@
};
/**
+ * WPS Configuration Error.
+ */
+ enum WpsConfigError : uint16_t {
+ NO_ERROR = 0,
+ OOB_IFACE_READ_ERROR = 1,
+ DECRYPTION_CRC_FAILURE = 2,
+ CHAN_24_NOT_SUPPORTED = 3,
+ CHAN_50_NOT_SUPPORTED = 4,
+ SIGNAL_TOO_WEAK = 5,
+ NETWORK_AUTH_FAILURE = 6,
+ NETWORK_ASSOC_FAILURE = 7,
+ NO_DHCP_RESPONSE = 8,
+ FAILED_DHCP_CONFIG = 9,
+ IP_ADDR_CONFLICT = 10,
+ NO_CONN_TO_REGISTRAR = 11,
+ MULTIPLE_PBC_DETECTED = 12,
+ ROGUE_SUSPECTED = 13,
+ DEVICE_BUSY = 14,
+ SETUP_LOCKED = 15,
+ MSG_TIMEOUT = 16,
+ REG_SESS_TIMEOUT = 17,
+ DEV_PASSWORD_AUTH_FAILURE = 18,
+ CHAN_60G_NOT_SUPPORTED = 19,
+ PUBLIC_KEY_HASH_MISMATCH = 20
+ };
+
+ /**
+ * Vendor specific Error Indication for WPS event messages.
+ */
+ enum WpsErrorIndication : uint16_t {
+ NO_ERROR = 0,
+ SECURITY_TKIP_ONLY_PROHIBITED = 1,
+ SECURITY_WEP_PROHIBITED = 2,
+ AUTH_FAILURE = 3
+ };
+
+ /**
* Used to indicate that a new network has been added.
*
* @param id Network ID allocated to the corresponding network.
@@ -242,4 +279,25 @@
* Refer to section 8.4.1.9 of IEEE 802.11 spec.
*/
oneway onAssociationRejected(Bssid bssid, uint32_t statusCode);
+
+ /**
+ * Used to indicate the success of a WPS connection attempt.
+ */
+ oneway onWpsEventSuccess();
+
+ /**
+ * Used to indicate the failure of a WPS connection attempt.
+ *
+ * @param bssid BSSID of the AP to which we initiated WPS
+ * connection.
+ * @param configError Configuration error code.
+ * @param errorInd Error indication code.
+ */
+ oneway onWpsEventFail(
+ Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd);
+
+ /**
+ * Used to indicate the overlap of a WPS PBC connection attempt.
+ */
+ oneway onWpsEventPbcOverlap();
};
diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk
new file mode 100644
index 0000000..8fa649f
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/Android.mk
@@ -0,0 +1,43 @@
+#
+# 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 := supplicant_hidl_test
+LOCAL_CPPFLAGS := -Wall -Werror -Wextra
+LOCAL_SRC_FILES := \
+ main.cpp \
+ supplicant_hidl_test.cpp \
+ supplicant_hidl_test_utils.cpp \
+ supplicant_p2p_iface_hidl_test.cpp \
+ supplicant_sta_iface_hidl_test.cpp \
+ supplicant_sta_network_hidl_test.cpp
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.wifi.supplicant@1.0 \
+ libbase \
+ libcutils \
+ libhidlbase \
+ libhidltransport \
+ libhwbinder \
+ liblog \
+ libutils \
+ libwifi-hal \
+ libwifi-system
+LOCAL_STATIC_LIBRARIES := \
+ libgmock \
+ libgtest
+include $(BUILD_NATIVE_TEST)
+
diff --git a/wifi/supplicant/1.0/vts/functional/main.cpp b/wifi/supplicant/1.0/vts/functional/main.cpp
new file mode 100644
index 0000000..81a2947
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/main.cpp
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+class SupplicantHidlEnvironment : public ::testing::Environment {
+ public:
+ virtual void SetUp() override {
+ stopWifiFramework();
+ stopSupplicant();
+ }
+ virtual void TearDown() override {
+ startWifiFramework();
+ // Framework will start wpa_supplicant.
+ }
+};
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(new SupplicantHidlEnvironment);
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
new file mode 100644
index 0000000..9922447
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicant proxy object is
+ * successfully created.
+ */
+TEST(SupplicantHidlTestNoFixture, Create) {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_NE(nullptr, getSupplicant().get());
+ stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
new file mode 100644
index 0000000..3877b97
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -0,0 +1,267 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+#include <gtest/gtest.h>
+
+#include <hidl/HidlTransportSupport.h>
+#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <android/hidl/manager/1.0/IServiceNotification.h>
+
+#include <wifi_hal/driver_tool.h>
+#include <wifi_system/interface_tool.h>
+#include <wifi_system/supplicant_manager.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+using ::android::sp;
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::joinRpcThreadpool;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicant;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hidl::manager::V1_0::IServiceNotification;
+using ::android::wifi_hal::DriverTool;
+using ::android::wifi_system::InterfaceTool;
+using ::android::wifi_system::SupplicantManager;
+
+namespace {
+const char kSupplicantServiceName[] = "wpa_supplicant";
+
+// Helper function to initialize the driver and firmware to STA mode.
+void initilializeDriverAndFirmware() {
+ DriverTool driver_tool;
+ InterfaceTool iface_tool;
+ EXPECT_TRUE(driver_tool.LoadDriver());
+ EXPECT_TRUE(driver_tool.ChangeFirmwareMode(DriverTool::kFirmwareModeSta));
+ EXPECT_TRUE(iface_tool.SetWifiUpState(true));
+}
+
+// Helper function to find any iface of the desired type exposed.
+bool findIfaceOfType(sp<ISupplicant> supplicant, IfaceType desired_type,
+ ISupplicant::IfaceInfo* out_info) {
+ bool operation_failed = false;
+ std::vector<ISupplicant::IfaceInfo> iface_infos;
+ supplicant->listInterfaces([&](const SupplicantStatus& status,
+ hidl_vec<ISupplicant::IfaceInfo> infos) {
+ if (status.code != SupplicantStatusCode::SUCCESS) {
+ operation_failed = true;
+ return;
+ }
+ iface_infos = infos;
+ });
+ if (operation_failed) {
+ return false;
+ }
+ for (const auto& info : iface_infos) {
+ if (info.type == desired_type) {
+ *out_info = info;
+ return true;
+ }
+ }
+ return false;
+}
+} // namespace
+
+// Utility class to wait for wpa_supplicant's HIDL service registration.
+class ServiceNotificationListener : public IServiceNotification {
+ public:
+ Return<void> onRegistration(const hidl_string& fully_qualified_name,
+ const hidl_string& instance_name,
+ bool pre_existing) override {
+ if (pre_existing) {
+ return Void();
+ }
+ std::unique_lock<std::mutex> lock(mutex_);
+ registered_.push_back(std::string(fully_qualified_name.c_str()) + "/" +
+ instance_name.c_str());
+ lock.unlock();
+ condition_.notify_one();
+ return Void();
+ }
+
+ bool registerForHidlServiceNotifications(const std::string& instance_name) {
+ if (!ISupplicant::registerForNotifications(instance_name, this)) {
+ return false;
+ }
+ configureRpcThreadpool(2, false);
+ return true;
+ }
+
+ bool waitForHidlService(uint32_t timeout_in_millis,
+ const std::string& instance_name) {
+ std::unique_lock<std::mutex> lock(mutex_);
+ condition_.wait_for(lock, std::chrono::milliseconds(timeout_in_millis),
+ [&]() { return registered_.size() >= 1; });
+ if (registered_.size() != 1) {
+ return false;
+ }
+ std::string exptected_registered =
+ std::string(ISupplicant::descriptor) + "/" + instance_name;
+ if (registered_[0] != exptected_registered) {
+ LOG(ERROR) << "Expected: " << exptected_registered
+ << ", Got: " << registered_[0];
+ return false;
+ }
+ return true;
+ }
+
+ private:
+ std::vector<std::string> registered_{};
+ std::mutex mutex_;
+ std::condition_variable condition_;
+};
+
+void stopWifiFramework() {
+ ASSERT_EQ(std::system("svc wifi disable"), 0);
+ // TODO: Use some other mechanism to wait for the framework to
+ // finish disabling.
+ sleep(5);
+}
+
+void startWifiFramework() {
+ ASSERT_EQ(std::system("svc wifi enable"), 0);
+ // These tests don't care whether the framework
+ // finished enabling or not.
+}
+
+void stopSupplicant() {
+ DriverTool driver_tool;
+ SupplicantManager supplicant_manager;
+
+ ASSERT_TRUE(supplicant_manager.StopSupplicant());
+ ASSERT_TRUE(driver_tool.UnloadDriver());
+ ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
+}
+
+void startSupplicantAndWaitForHidlService() {
+ initilializeDriverAndFirmware();
+
+ android::sp<ServiceNotificationListener> notification_listener =
+ new ServiceNotificationListener();
+ ASSERT_TRUE(notification_listener->registerForHidlServiceNotifications(
+ kSupplicantServiceName));
+
+ SupplicantManager supplicant_manager;
+ ASSERT_TRUE(supplicant_manager.StartSupplicant());
+ ASSERT_TRUE(supplicant_manager.IsSupplicantRunning());
+
+ ASSERT_TRUE(
+ notification_listener->waitForHidlService(200, kSupplicantServiceName));
+}
+
+sp<ISupplicant> getSupplicant() {
+ return ISupplicant::getService(kSupplicantServiceName);
+}
+
+sp<ISupplicantStaIface> getSupplicantStaIface() {
+ sp<ISupplicant> supplicant = getSupplicant();
+ if (!supplicant.get()) {
+ return nullptr;
+ }
+ ISupplicant::IfaceInfo info;
+ if (!findIfaceOfType(supplicant, IfaceType::STA, &info)) {
+ return nullptr;
+ }
+ bool operation_failed = false;
+ sp<ISupplicantStaIface> sta_iface;
+ supplicant->getInterface(info, [&](const SupplicantStatus& status,
+ const sp<ISupplicantIface>& iface) {
+ if (status.code != SupplicantStatusCode::SUCCESS) {
+ operation_failed = true;
+ return;
+ }
+ sta_iface = ISupplicantStaIface::castFrom(iface);
+ });
+ if (operation_failed) {
+ return nullptr;
+ }
+ return sta_iface;
+}
+
+sp<ISupplicantStaNetwork> createSupplicantStaNetwork() {
+ sp<ISupplicantStaIface> sta_iface = getSupplicantStaIface();
+ if (!sta_iface.get()) {
+ return nullptr;
+ }
+ bool operation_failed = false;
+ sp<ISupplicantStaNetwork> sta_network;
+ sta_iface->addNetwork([&](const SupplicantStatus& status,
+ const sp<ISupplicantNetwork>& network) {
+ if (status.code != SupplicantStatusCode::SUCCESS) {
+ operation_failed = true;
+ return;
+ }
+ sta_network = ISupplicantStaNetwork::castFrom(network);
+ });
+ if (operation_failed) {
+ return nullptr;
+ }
+ return sta_network;
+}
+
+sp<ISupplicantP2pIface> getSupplicantP2pIface() {
+ sp<ISupplicant> supplicant = getSupplicant();
+ if (!supplicant.get()) {
+ return nullptr;
+ }
+ ISupplicant::IfaceInfo info;
+ if (!findIfaceOfType(supplicant, IfaceType::P2P, &info)) {
+ return nullptr;
+ }
+ bool operation_failed = false;
+ sp<ISupplicantP2pIface> p2p_iface;
+ supplicant->getInterface(info, [&](const SupplicantStatus& status,
+ const sp<ISupplicantIface>& iface) {
+ if (status.code != SupplicantStatusCode::SUCCESS) {
+ operation_failed = true;
+ return;
+ }
+ p2p_iface = ISupplicantP2pIface::castFrom(iface);
+ });
+ if (operation_failed) {
+ return nullptr;
+ }
+ return p2p_iface;
+}
+
+bool turnOnExcessiveLogging() {
+ sp<ISupplicant> supplicant = getSupplicant();
+ if (!supplicant.get()) {
+ return false;
+ }
+ bool operation_failed = false;
+ supplicant->setDebugParams(
+ ISupplicant::DebugLevel::EXCESSIVE,
+ true, // show timestamps
+ true, // show keys
+ [&](const SupplicantStatus& status) {
+ if (status.code != SupplicantStatusCode::SUCCESS) {
+ operation_failed = true;
+ }
+ });
+ return !operation_failed;
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
new file mode 100644
index 0000000..38143e4
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
@@ -0,0 +1,48 @@
+/*
+ * 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 SUPPLICANT_HIDL_TEST_UTILS_H
+#define SUPPLICANT_HIDL_TEST_UTILS_H
+
+#include <android/hardware/wifi/supplicant/1.0/ISupplicant.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
+
+// Used to stop the android wifi framework before every test.
+void stopWifiFramework();
+void startWifiFramework();
+void stopSupplicant();
+// Used to configure the chip, driver and start wpa_supplicant before every
+// test.
+void startSupplicantAndWaitForHidlService();
+
+// Helper functions to obtain references to the various HIDL interface objects.
+// Note: We only have a single instance of each of these objects currently.
+// These helper functions should be modified to return vectors if we support
+// multiple instances.
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicant>
+getSupplicant();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface>
+getSupplicantStaIface();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork>
+createSupplicantStaNetwork();
+android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface>
+getSupplicantP2pIface();
+
+bool turnOnExcessiveLogging();
+
+#endif /* SUPPLICANT_HIDL_TEST_UTILS_H */
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
new file mode 100644
index 0000000..968d4c9
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantP2pIface proxy object is
+ * successfully created.
+ */
+TEST(SupplicantP2pIfaceHidlTestNoFixture, Create) {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_NE(nullptr, getSupplicantP2pIface().get());
+ stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
new file mode 100644
index 0000000..45cc6bc
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantStaIface proxy object is
+ * successfully created.
+ */
+TEST(SupplicantStaIfaceHidlTestNoFixture, Create) {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_NE(nullptr, getSupplicantStaIface().get());
+ stopSupplicant();
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
new file mode 100644
index 0000000..8c42a22
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <gtest/gtest.h>
+
+#include "supplicant_hidl_test_utils.h"
+
+/*
+ * Create:
+ * Ensures that an instance of the ISupplicantStaNetwork proxy object is
+ * successfully created.
+ */
+TEST(SupplicantStaNetworkHidlTestNoFixture, Create) {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_NE(nullptr, createSupplicantStaNetwork().get());
+ stopSupplicant();
+}