Merge "Fix log message using undeclared variable"
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/boot/1.0/vts/functional/boot_hidl_hal_test.cpp b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
index cdca7e2..3413a93 100644
--- a/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
+++ b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
@@ -35,18 +35,8 @@
class BootHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- // TODO(b/33385836) Delete copied code
- bool getStub = false;
- char getsubProperty[PROPERTY_VALUE_MAX];
- if (property_get("vts.hidl.get_stub", getsubProperty, "") > 0) {
- if (!strcmp(getsubProperty, "true") || !strcmp(getsubProperty, "True") ||
- !strcmp(getsubProperty, "1")) {
- getStub = true;
- }
- }
- boot = IBootControl::getService("bootctrl", getStub);
+ boot = IBootControl::getService("bootctrl");
ASSERT_NE(boot, nullptr);
- ASSERT_EQ(!getStub, boot->isRemote());
}
virtual void TearDown() override {}
@@ -91,6 +81,13 @@
EXPECT_TRUE(result.isOk());
}
{
+ // Restore original flags to avoid problems on reboot
+ CommandResult cr;
+ Return <void> result = boot->markBootSuccessful(generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ }
+ {
CommandResult cr;
uint32_t slots = boot->getNumberSlots();
Return<void> result =
@@ -111,7 +108,16 @@
EXPECT_TRUE(result.isOk());
if (cr.success) {
EXPECT_EQ(BoolResult::FALSE, boot->isSlotBootable(otherSlot));
- boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+
+ // Restore original flags to avoid problems on reboot
+ result = boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ result = boot->setActiveBootSlot(curSlot, generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ result = boot->markBootSuccessful(generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
EXPECT_TRUE(cr.success);
}
}
diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal
index 1d136d3..42f2e2d 100644
--- a/contexthub/1.0/IContexthub.hal
+++ b/contexthub/1.0/IContexthub.hal
@@ -18,6 +18,13 @@
import IContexthubCallback;
+/*
+ * The Context Hub HAL provides an interface to a separate low-power processing
+ * domain that has direct access to contextual information, such as sensors.
+ * Native applications that run within a context hub are known as nanoapps, and
+ * they execute within the Context Hub Runtime Environment (CHRE), which is
+ * standardized via the CHRE API, defined elsewhere.
+ */
interface IContexthub {
/*
* Enumerate all available context hubs on the system.
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index d7e5673..2326b58 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -128,6 +128,22 @@
uint32_t maxSupportedMsgLen;// This is the maximum size of the message that can
// 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.
+ 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;
};
struct ContextHubMsg {
diff --git a/dumpstate/1.0/default/Android.mk b/dumpstate/1.0/default/Android.mk
index 4d5c908..0b15184 100644
--- a/dumpstate/1.0/default/Android.mk
+++ b/dumpstate/1.0/default/Android.mk
@@ -1,22 +1,22 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.dumpstate@1.0-impl
+LOCAL_MODULE := android.hardware.dumpstate@1.0-service
+LOCAL_INIT_RC := android.hardware.dumpstate@1.0-service.rc
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
DumpstateDevice.cpp \
+ service.cpp
LOCAL_SHARED_LIBRARIES := \
android.hardware.dumpstate@1.0 \
libbase \
libcutils \
+ libdumpstateutil \
libhidlbase \
libhidltransport \
libhwbinder \
liblog \
libutils
-LOCAL_STATIC_LIBRARIES := \
- libdumpstateutil
-
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_EXECUTABLE)
diff --git a/dumpstate/1.0/default/DumpstateDevice.cpp b/dumpstate/1.0/default/DumpstateDevice.cpp
index 4264235..8000d85 100644
--- a/dumpstate/1.0/default/DumpstateDevice.cpp
+++ b/dumpstate/1.0/default/DumpstateDevice.cpp
@@ -22,6 +22,9 @@
#include "DumpstateUtil.h"
+using android::os::dumpstate::DumpFileToFd;
+using android::os::dumpstate::RunCommandToFd;
+
namespace android {
namespace hardware {
namespace dumpstate {
@@ -30,6 +33,10 @@
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
+ // NOTE: this is just an example on how to use the DumpstateUtil.h functions to implement
+ // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
+ // be called by dumpstate.
+
if (handle->numFds < 1) {
ALOGE("no FDs\n");
return Void();
@@ -51,13 +58,6 @@
return Void();
}
-
-IDumpstateDevice* HIDL_FETCH_IDumpstateDevice(const char* /* name */) {
- // TODO: temporary returning nullptr until it's implemented on master devices
- return nullptr;
-// return new DumpstateDevice();
-}
-
} // namespace implementation
} // namespace V1_0
} // namespace dumpstate
diff --git a/dumpstate/1.0/default/DumpstateDevice.h b/dumpstate/1.0/default/DumpstateDevice.h
index f216304..f8585f5 100644
--- a/dumpstate/1.0/default/DumpstateDevice.h
+++ b/dumpstate/1.0/default/DumpstateDevice.h
@@ -41,8 +41,6 @@
};
-extern "C" IDumpstateDevice* HIDL_FETCH_IDumpstateDevice(const char* name);
-
} // namespace implementation
} // namespace V1_0
} // namespace dumpstate
diff --git a/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc b/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc
new file mode 100644
index 0000000..99b968e
--- /dev/null
+++ b/dumpstate/1.0/default/android.hardware.dumpstate@1.0-service.rc
@@ -0,0 +1,4 @@
+service dumpstate-1-0 /system/bin/hw/android.hardware.dumpstate@1.0-service
+ class hal
+ user system
+ group system
diff --git a/dumpstate/1.0/default/service.cpp b/dumpstate/1.0/default/service.cpp
new file mode 100644
index 0000000..0d5bd94
--- /dev/null
+++ b/dumpstate/1.0/default/service.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "android.hardware.dumpstate@1.0-service"
+
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "DumpstateDevice.h"
+
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
+using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
+using ::android::hardware::joinRpcThreadpool;
+using ::android::sp;
+
+int main (int /* argc */, char * /* argv */ []) {
+ sp<IDumpstateDevice> dumpstate = new DumpstateDevice;
+ configureRpcThreadpool(1, true);
+ dumpstate->registerAsService("dumpstate");
+ joinRpcThreadpool();
+}
diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal
index b072807..eb66d78 100644
--- a/gnss/1.0/IGnssCallback.hal
+++ b/gnss/1.0/IGnssCallback.hal
@@ -29,21 +29,21 @@
* If this is not set, then the framework will use 1000ms for
* minInterval and will call start() and stop() to schedule the GNSS.
*/
- SCHEDULING = 1 << 0,
+ SCHEDULING = 1 << 0,
/** GNSS supports MS-Based AGNSS mode */
- MSB = 1 << 1,
+ MSB = 1 << 1,
/** GNSS supports MS-Assisted AGNSS mode */
- MSA = 1 << 2,
+ MSA = 1 << 2,
/** GNSS supports single-shot fixes */
- SINGLE_SHOT = 1 << 3,
+ SINGLE_SHOT = 1 << 3,
/** GNSS supports on demand time injection */
- ON_DEMAND_TIME = 1 << 4,
+ ON_DEMAND_TIME = 1 << 4,
/** GNSS supports Geofencing */
- GEOFENCING = 1 << 5,
- /** GNSS supports Measurements. */
- MEASUREMENTS = 1 << 6,
+ GEOFENCING = 1 << 5,
+ /** GNSS supports Measurements for at least GPS. */
+ MEASUREMENTS = 1 << 6,
/** GNSS supports Navigation Messages */
- NAV_MESSAGES = 1 << 7,
+ NAV_MESSAGES = 1 << 7
};
/* GNSS status event values. */
@@ -64,10 +64,11 @@
* Flags that indicate information about the satellite
*/
enum GnssSvFlags : uint8_t {
- NONE = 0,
- HAS_EPHEMERIS_DATA = 1 << 0,
- HAS_ALMANAC_DATA = 1 << 1,
- USED_IN_FIX = 1 << 2
+ NONE = 0,
+ HAS_EPHEMERIS_DATA = 1 << 0,
+ HAS_ALMANAC_DATA = 1 << 1,
+ USED_IN_FIX = 1 << 2,
+ HAS_CARRIER_FREQUENCY = 1 << 3
};
struct GnssSvInfo {
@@ -109,6 +110,17 @@
float azimuthDegrees;
/*
+ * Carrier frequency of the signal tracked, for example it can be the
+ * GPS L1 = 1.57542e9 Hz, or L2, L5, varying GLO channels, etc. If
+ * the field is not set, it is the primary common use frequency,
+ * e.g. L1 for GPS.
+ *
+ * If the data is available, gnssClockFlags must contain
+ * HAS_CARRIER_FREQUENCY.
+ */
+ float carrierFrequencyHz;
+
+ /*
* Contains additional data about the given SV.
*/
bitfield<GnssSvFlags> svFlag;
diff --git a/gnss/1.0/IGnssDebug.hal b/gnss/1.0/IGnssDebug.hal
index ff9ea9f..8784d1a 100644
--- a/gnss/1.0/IGnssDebug.hal
+++ b/gnss/1.0/IGnssDebug.hal
@@ -45,11 +45,28 @@
double longitudeDegrees;
/* Altitude above ellipsoid expressed in meters */
float altitudeMeters;
+ /* Represents speed in meters per second. */
+ float speedMetersPerSec;
+ /* Represents heading in degrees. */
+ float bearingDegrees;
/*
* estimated horizontal accuracy of position expressed in meters, radial,
* 68% confidence.
*/
- double accuracyMeters;
+ double horizontalAccuracyMeters;
+ /*
+ * estimated vertical accuracy of position expressed in meters, with
+ * 68% confidence.
+ */
+ double verticalAccuracyMeters;
+ /*
+ * estimated speed accuracy in meters per second with 68% confidence.
+ */
+ double speedAccuracyMetersPerSecond;
+ /*
+ * estimated bearing accuracy degrees with 68% confidence.
+ */
+ double bearingAccuracyDegrees;
/*
* Time duration before this report that this position information was
* valid.
@@ -103,7 +120,7 @@
TimeDebug time;
/*
* Provides a list of the decoded satellite ephemeris.
- * Should provide a complete list for all constellations device can track,
+ * Must provide a complete list for all constellations device can track,
* including GnssConstellationType UNKNOWN.
*/
vec<SatelliteData> satelliteDataArray;
diff --git a/gnss/1.0/IGnssMeasurementCallback.hal b/gnss/1.0/IGnssMeasurementCallback.hal
index 9685942..de640ae 100644
--- a/gnss/1.0/IGnssMeasurementCallback.hal
+++ b/gnss/1.0/IGnssMeasurementCallback.hal
@@ -51,7 +51,9 @@
/** A valid 'carrier phase' is stored in the data structure. */
HAS_CARRIER_PHASE = 1 << 11,
/** A valid 'carrier phase uncertainty' is stored in the data structure. */
- HAS_CARRIER_PHASE_UNCERTAINTY = 1 << 12
+ HAS_CARRIER_PHASE_UNCERTAINTY = 1 << 12,
+ /** A valid automatic gain control is stored in the data structure. */
+ HAS_AUTOMATIC_GAIN_CONTROL = 1 << 13
};
/*
@@ -95,7 +97,9 @@
STATE_GAL_E1BC_CODE_LOCK = 1 << 10,
STATE_GAL_E1C_2ND_CODE_LOCK = 1 << 11,
STATE_GAL_E1B_PAGE_SYNC = 1 << 12,
- STATE_SBAS_SYNC = 1 << 13
+ STATE_SBAS_SYNC = 1 << 13,
+ STATE_TOW_KNOWN = 1 << 14,
+ STATE_GLO_TOD_KNOWN = 1 << 15,
};
/*
@@ -321,6 +325,11 @@
* Bit sync : [ 0 20ms ] : STATE_BIT_SYNC set
* Subframe sync : [ 0 6s ] : STATE_SUBFRAME_SYNC set
* TOW decoded : [ 0 1week ] : STATE_TOW_DECODED set
+ * TOW Known : [ 0 1week ] : STATE_TOW_KNOWN set
+ *
+ * Note: TOW Known refers to the case where TOW is possibly not decoded
+ * over the air but has been determined from other sources. If TOW
+ * decoded is set then TOW Known must also be set.
*
* Note: If there is any ambiguity in integer millisecond,
* GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS must be set accordingly, in the
@@ -333,33 +342,48 @@
*
* Given the highest sync state that can be achieved, per each satellite,
* valid range for this field can be:
- * Searching : [ 0 ] : STATE_UNKNOWN set
- * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set
- * Symbol sync : [ 0 10ms ] : STATE_SYMBOL_SYNC set
- * Bit sync : [ 0 20ms ] : STATE_BIT_SYNC set
- * String sync : [ 0 2s ] : STATE_GLO_STRING_SYNC set
- * Time of day : [ 0 1day ] : STATE_GLO_TOW_DECODED set
+ * Searching : [ 0 ] : STATE_UNKNOWN set
+ * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set
+ * Symbol sync : [ 0 10ms ] : STATE_SYMBOL_SYNC set
+ * Bit sync : [ 0 20ms ] : STATE_BIT_SYNC set
+ * String sync : [ 0 2s ] : STATE_GLO_STRING_SYNC set
+ * Time of day decoded : [ 0 1day ] : STATE_GLO_TOD_DECODED set
+ * Time of day known : [ 0 1day ] : STATE_GLO_TOD_KNOWN set
+ *
+ * Note: Time of day known refers to the case where it is possibly not
+ * decoded over the air but has been determined from other sources. If
+ * Time of day decoded is set then Time of day known must also be set.
*
* For Beidou, this is the received Beidou time of week,
* at the measurement time in nanoseconds.
*
* Given the highest sync state that can be achieved, per each satellite,
* valid range for this field can be:
- * Searching : [ 0 ] : STATE_UNKNOWN set.
- * C/A code lock: [ 0 1ms ] : STATE_CODE_LOCK set.
- * Bit sync (D2): [ 0 2ms ] : STATE_BDS_D2_BIT_SYNC set.
- * Bit sync (D1): [ 0 20ms ] : STATE_BIT_SYNC set.
- * Subframe (D2): [ 0 0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC set.
- * Subframe (D1): [ 0 6s ] : STATE_SUBFRAME_SYNC set.
- * Time of week : [ 0 1week ] : STATE_TOW_DECODED set.
+ * Searching : [ 0 ] : STATE_UNKNOWN set.
+ * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set.
+ * Bit sync (D2) : [ 0 2ms ] : STATE_BDS_D2_BIT_SYNC set.
+ * Bit sync (D1) : [ 0 20ms ] : STATE_BIT_SYNC set.
+ * Subframe (D2) : [ 0 0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC set.
+ * Subframe (D1) : [ 0 6s ] : STATE_SUBFRAME_SYNC set.
+ * Time of week decoded : [ 0 1week ] : STATE_TOW_DECODED set.
+ * Time of week known : [ 0 1week ] : STATE_TOW_KNOWN set
+ *
+ * Note: TOW Known refers to the case where TOW is possibly not decoded
+ * over the air but has been determined from other sources. If TOW
+ * decoded is set then TOW Known must also be set.
*
* For Galileo, this is the received Galileo time of week,
* at the measurement time in nanoseconds.
*
- * E1BC code lock : [ 0 4ms ] : STATE_GAL_E1BC_CODE_LOCK set.
- * E1C 2nd code lock: [ 0 100ms] : STATE_GAL_E1C_2ND_CODE_LOCK set.
- * E1B page : [ 0 2s ] : STATE_GAL_E1B_PAGE_SYNC set.
- * Time of week : [ 0 1week] : STATE_TOW_DECODED is set.
+ * E1BC code lock : [ 0 4ms ] : STATE_GAL_E1BC_CODE_LOCK set.
+ * E1C 2nd code lock : [ 0 100ms] : STATE_GAL_E1C_2ND_CODE_LOCK set.
+ * E1B page : [ 0 2s ] : STATE_GAL_E1B_PAGE_SYNC set.
+ * Time of week decoded : [ 0 1week] : STATE_TOW_DECODED is set.
+ * Time of week known : [ 0 1week] : STATE_TOW_KNOWN set
+ *
+ * Note: TOW Known refers to the case where TOW is possibly not decoded
+ * over the air but has been determined from other sources. If TOW
+ * decoded is set then TOW Known must also be set.
*
* For SBAS, this is received SBAS time, at the measurement time in
* nanoseconds.
@@ -455,9 +479,10 @@
double accumulatedDeltaRangeUncertaintyM;
/*
- * Carrier frequency at which codes and messages are modulated, it can
- * be L1 or L2. If the field is not set, the carrier frequency is
- * assumed to be L1.
+ * Carrier frequency of the signal tracked, for example it can be the
+ * GPS L1 = 1.57542e9 Hz, or L2, L5, varying GLO channels, etc. If the
+ * field is not set, it is the primary common use frequency,
+ * e.g. L1 for GPS.
*
* If the data is available, gnssClockFlags must contain
* HAS_CARRIER_FREQUENCY.
@@ -524,6 +549,24 @@
* observed noise floor" to "the noise RMS".
*/
double snrDb;
+
+ /*
+ * Automatic gain control (AGC) level. AGC acts as a variable gain
+ * amplifier adjusting the power of the incoming signal to minimize the
+ * quantization losses. The AGC level may be used to indicate potential
+ * interference. When AGC is at a nominal level, this value
+ * must be set as 0. Higher gain (and/or lower input power) must be
+ * output as a positive number. Hence in cases of strong jamming, in the
+ * band of this signal, this value must go more negative.
+ *
+ * Note: Different hardware designs (e.g. antenna, pre-amplification, or
+ * other RF HW components) may also affect the typical output of of this
+ * value on any given hardware design in an open sky test - the
+ * important aspect of this output is that changes in this value are
+ * indicative of changes on input signal power in the frequency band for
+ * this measurement.
+ */
+ double agcLevelDb;
};
/*
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 28a1950..19e22c2 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -121,7 +121,10 @@
.cN0Dbhz = svInfo.c_n0_dbhz,
.elevationDegrees = svInfo.elevation,
.azimuthDegrees = svInfo.azimuth,
- .svFlag = svInfo.flags
+ .svFlag = svInfo.flags,
+ // Older chipsets do not provide carrier frequency, hence HAS_CARRIER_FREQUENCY flag
+ // is not set and the carrierFrequencyHz field is set to zero
+ .carrierFrequencyHz = 0
};
svStatus.gnssSvList[i] = gnssSvInfo;
}
diff --git a/gnss/1.0/default/GnssMeasurement.cpp b/gnss/1.0/default/GnssMeasurement.cpp
index 0d11636..67f6d8d 100644
--- a/gnss/1.0/default/GnssMeasurement.cpp
+++ b/gnss/1.0/default/GnssMeasurement.cpp
@@ -51,12 +51,19 @@
for (size_t i = 0; i < gnssData.measurementCount; i++) {
auto entry = legacyGnssData->measurements[i];
+ auto state = static_cast<GnssMeasurementState>(entry.state);
+ if (state & IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED) {
+ state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_KNOWN;
+ }
+ if (state & IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED) {
+ state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_KNOWN;
+ }
gnssData.measurements[i] = {
.flags = entry.flags,
.svid = entry.svid,
.constellation = static_cast<GnssConstellationType>(entry.constellation),
.timeOffsetNs = entry.time_offset_ns,
- .state = entry.state,
+ .state = state,
.receivedSvTimeInNs = entry.received_sv_time_in_ns,
.receivedSvTimeUncertaintyInNs = entry.received_sv_time_uncertainty_in_ns,
.cN0DbHz = entry.c_n0_dbhz,
diff --git a/gnss/1.0/default/GnssUtils.cpp b/gnss/1.0/default/GnssUtils.cpp
index 9f7e356..82a516b 100644
--- a/gnss/1.0/default/GnssUtils.cpp
+++ b/gnss/1.0/default/GnssUtils.cpp
@@ -28,13 +28,22 @@
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,
.speedMetersPerSec = location->speed,
.bearingDegrees = location->bearing,
- .accuracyMeters = location->accuracy,
+ .horizontalAccuracyMeters = location->accuracy,
+ // Older chipsets do not provide the following 3 fields, hence the flags
+ // HAS_VERTICAL_ACCURACY, HAS_SPEED_ACCURACY and HAS_BEARING_ACCURACY are
+ // not set and the field are set to zeros.
+ .verticalAccuracyMeters = 0,
+ .speedAccuracyMetersPerSecond = 0,
+ .bearingAccuracyDegrees = 0,
.timestamp = location->timestamp
};
}
diff --git a/gnss/1.0/types.hal b/gnss/1.0/types.hal
index ea104c5..2721d44 100644
--- a/gnss/1.0/types.hal
+++ b/gnss/1.0/types.hal
@@ -40,15 +40,21 @@
/** Bit mask to indicate which values are valid in a GnssLocation object. */
enum GnssLocationFlags : uint16_t {
/** GnssLocation has valid latitude and longitude. */
- HAS_LAT_LONG = 0x0001,
+ HAS_LAT_LONG = 0x0001,
/** GnssLocation has valid altitude. */
- HAS_ALTITUDE = 0x0002,
+ HAS_ALTITUDE = 0x0002,
/** GnssLocation has valid speed. */
- HAS_SPEED = 0x0004,
+ HAS_SPEED = 0x0004,
/** GnssLocation has valid bearing. */
- HAS_BEARING = 0x0008,
- /** GnssLocation has valid accuracy. */
- HAS_ACCURACY = 0x0010
+ HAS_BEARING = 0x0008,
+ /** GpsLocation has valid horizontal accuracy. */
+ HAS_HORIZONTAL_ACCURACY = 0x0010,
+ /** GpsLocation has valid vertical accuracy. */
+ HAS_VERTICAL_ACCURACY = 0x0020,
+ /** GpsLocation has valid speed accuracy. */
+ HAS_SPEED_ACCURACY = 0x0040,
+ /** GpsLocation has valid bearing accuracy. */
+ HAS_BEARING_ACCURACY = 0x0080
};
/* Represents a location. */
@@ -73,8 +79,29 @@
/* Represents heading in degrees. */
float bearingDegrees;
- /* Represents expected accuracy in meters. */
- float accuracyMeters;
+ /*
+ * Represents expected horizontal position accuracy, radial, in meters
+ * (68% confidence).
+ */
+ float horizontalAccuracyMeters;
+
+ /*
+ * Represents expected vertical position accuracy in meters
+ * (68% confidence).
+ */
+ float verticalAccuracyMeters;
+
+ /*
+ * Represents expected speed accuracy in meter per seconds
+ * (68% confidence).
+ */
+ float speedAccuracyMetersPerSecond;
+
+ /*
+ * Represents expected bearing accuracy in degrees
+ * (68% confidence).
+ */
+ float bearingAccuracyDegrees;
/* Timestamp for the location fix. */
GnssUtcTime timestamp;
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/types.hal b/graphics/allocator/2.0/types.hal
index 6081db9..f9d1e1b 100644
--- a/graphics/allocator/2.0/types.hal
+++ b/graphics/allocator/2.0/types.hal
@@ -30,23 +30,23 @@
enum ProducerUsage : uint64_t {
/* bit 0 is reserved */
- /* buffer will be read by CPU occasionally */
+ /* buffer is read by CPU occasionally */
CPU_READ = 1ULL << 1,
- /* buffer will be read by CPU frequently */
+ /* buffer is read by CPU frequently */
CPU_READ_OFTEN = 1ULL << 2,
/* bit 3 is reserved */
/* bit 4 is reserved */
- /* buffer will be written by CPU occasionally */
+ /* buffer is written by CPU occasionally */
CPU_WRITE = 1ULL << 5,
- /* buffer will be written by CPU frequently */
+ /* buffer is written by CPU frequently */
CPU_WRITE_OFTEN = 1ULL << 6,
/* bit 7 is reserved */
/* bit 8 is reserved */
- /* buffer will be used as a GPU render target */
+ /* buffer is used as a GPU render target */
GPU_RENDER_TARGET = 1ULL << 9,
/* bit 10 is reserved */
@@ -64,7 +64,7 @@
/* bit 15 is reserved */
/* bit 16 is reserved */
- /* buffer will be used as a camera HAL output */
+ /* buffer is used as a camera HAL output */
CAMERA = 1ULL << 17,
/* bit 18 is reserved */
@@ -72,10 +72,13 @@
/* bit 20 is reserved */
/* bit 21 is reserved */
- /* buffer will be used as a video decoder output */
+ /* buffer is used as a video decoder output */
VIDEO_DECODER = 1ULL << 22,
- /* bits 23-27 are reserved for future versions */
+ /* buffer is used as a sensor direct report output */
+ SENSOR_DIRECT_DATA = 1ULL << 23,
+
+ /* bits 24-27 are reserved for future versions */
/* bits 28-31 are reserved for vendor extensions */
/* bits 32-47 are reserved for future versions */
@@ -85,9 +88,9 @@
enum ConsumerUsage : uint64_t {
/* bit 0 is reserved */
- /* buffer will be read by CPU occasionally */
+ /* buffer is read by CPU occasionally */
CPU_READ = 1ULL << 1,
- /* buffer will be read by CPU frequently */
+ /* buffer is read by CPU frequently */
CPU_READ_OFTEN = 1ULL << 2,
/* bit 3 is reserved */
@@ -96,40 +99,44 @@
/* bit 6 is reserved */
/* bit 7 is reserved */
- /* buffer will be used as a GPU texture */
+ /* buffer is used as a GPU texture */
GPU_TEXTURE = 1ULL << 8,
/* bit 9 is reserved */
/* bit 10 is reserved */
- /* buffer will be used by hwcomposer HAL */
+ /* buffer is used by hwcomposer HAL */
HWCOMPOSER = 1ULL << 11,
- /* buffer will be as a hwcomposer HAL client target */
+ /* buffer is a hwcomposer HAL client target */
CLIENT_TARGET = 1ULL << 12,
/* bit 13 is reserved */
/* bit 14 is reserved */
- /* buffer will be used as a hwcomposer HAL cursor */
+ /* buffer is used as a hwcomposer HAL cursor */
CURSOR = 1ULL << 15,
- /* buffer will be used as a video encoder input */
+ /* buffer is used as a video encoder input */
VIDEO_ENCODER = 1ULL << 16,
/* bit 17 is reserved */
- /* buffer will be used as a camera HAL input */
+ /* buffer is used as a camera HAL input */
CAMERA = 1ULL << 18,
/* bit 19 is reserved */
- /* buffer will be used as a renderscript allocation */
+ /* buffer is used as a renderscript allocation */
RENDERSCRIPT = 1ULL << 20,
/* bit 21 is reserved */
/* bit 22 is reserved */
- /* bits 23-27 are reserved for future versions */
+ /* buffer is used as as an OpenGL shader storage or uniform
+ buffer object */
+ GPU_DATA_BUFFER = 1ULL << 23,
+
+ /* bits 24-27 are reserved for future versions */
/* bits 28-31 are reserved for vendor extensions */
/* bits 32-47 are reserved for future versions */
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/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/ISensors.hal b/sensors/1.0/ISensors.hal
index a60cc10..c56da29 100644
--- a/sensors/1.0/ISensors.hal
+++ b/sensors/1.0/ISensors.hal
@@ -52,20 +52,6 @@
activate(int32_t sensorHandle, bool enabled) generates (Result result);
/**
- * Set the sampling period in nanoseconds for a given sensor.
- *
- * If samplingPeriodNs > maxDelay it will be truncated to
- * maxDelay and if samplingPeriodNs < minDelay it will be
- * replaced by minDelay.
- *
- * @param sensorHandle handle of sensor to be changed.
- * @param samplngPeriodNs specified sampling period in nanoseconds.
- * @return result OK on success, BAD_VALUE if sensorHandle is invalid.
- */
- setDelay(int32_t sensorHandle, int64_t samplingPeriodNs)
- generates (Result result);
-
- /**
* Generate a vector of sensor events containing at most "maxCount"
* entries.
*
@@ -105,7 +91,6 @@
* @return result OK on success, BAD_VALUE if any parameters are invalid.
*/
batch(int32_t sensorHandle,
- int32_t flags,
int64_t samplingPeriodNs,
int64_t maxReportLatencyNs) generates (Result result);
@@ -127,12 +112,26 @@
flush(int32_t sensorHandle) generates (Result result);
/*
- * Inject a single sensor sample to this device.
- * data points to the sensor event to be injected
- * Returns OK on success
- * PERMISSION_DENIED if operation is not allowed
- * INVALID_OPERATION, if this functionality is unsupported
- * BAD_VALUE if sensor event cannot be injected
+ * Inject a single sensor event or push operation environment parameters to
+ * device.
+ *
+ * When device is in NORMAL mode, this function is called to push operation
+ * environment data to device. In this operation, Event is always of
+ * SensorType::AdditionalInfo type. See operation evironment parameters
+ * section in AdditionalInfoType.
+ *
+ * When device is in DATA_INJECTION mode, this function is also used for
+ * injecting sensor events.
+ *
+ * Regardless of OperationMode, injected SensorType::ADDITIONAL_INFO
+ * type events should not be routed back to poll() function.
+ *
+ * @see AdditionalInfoType
+ * @see OperationMode
+ * @param event sensor event to be injected
+ * @return result OK on success; PERMISSION_DENIED if operation is not
+ * allowed; INVALID_OPERATION, if this functionality is
+ * unsupported; BAD_VALUE if sensor event cannot be injected.
*/
injectSensorData(Event event) generates (Result result);
diff --git a/sensors/1.0/default/Sensors.cpp b/sensors/1.0/default/Sensors.cpp
index f9f1ca6..8903397 100644
--- a/sensors/1.0/default/Sensors.cpp
+++ b/sensors/1.0/default/Sensors.cpp
@@ -142,15 +142,6 @@
enabled));
}
-Return<Result> Sensors::setDelay(
- int32_t sensor_handle, int64_t sampling_period_ns) {
- return ResultFromStatus(
- mSensorDevice->setDelay(
- reinterpret_cast<sensors_poll_device_t *>(mSensorDevice),
- sensor_handle,
- sampling_period_ns));
-}
-
Return<void> Sensors::poll(int32_t maxCount, poll_cb _hidl_cb) {
hidl_vec<Event> out;
hidl_vec<SensorInfo> dynamicSensorsAdded;
@@ -206,14 +197,13 @@
Return<Result> Sensors::batch(
int32_t sensor_handle,
- int32_t flags,
int64_t sampling_period_ns,
int64_t max_report_latency_ns) {
return ResultFromStatus(
mSensorDevice->batch(
mSensorDevice,
sensor_handle,
- flags,
+ 0, /*flags*/
sampling_period_ns,
max_report_latency_ns));
}
diff --git a/sensors/1.0/default/Sensors.h b/sensors/1.0/default/Sensors.h
index a33f283..e8bd98d 100644
--- a/sensors/1.0/default/Sensors.h
+++ b/sensors/1.0/default/Sensors.h
@@ -39,14 +39,10 @@
Return<Result> activate(
int32_t sensor_handle, bool enabled) override;
- Return<Result> setDelay(
- int32_t sensor_handle, int64_t sampling_period_ns) override;
-
Return<void> poll(int32_t maxCount, poll_cb _hidl_cb) override;
Return<Result> batch(
int32_t sensor_handle,
- int32_t flags,
int64_t sampling_period_ns,
int64_t max_report_latency_ns) override;
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index 18725e7..6735e96 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -72,18 +72,18 @@
dst->timestamp = src.timestamp;
switch (dst->sensorType) {
- case SensorType::SENSOR_TYPE_META_DATA:
+ case SensorType::META_DATA:
{
dst->u.meta.what = (MetaDataEventType)src.meta_data.what;
break;
}
- case SensorType::SENSOR_TYPE_ACCELEROMETER:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
- case SensorType::SENSOR_TYPE_ORIENTATION:
- case SensorType::SENSOR_TYPE_GYROSCOPE:
- case SensorType::SENSOR_TYPE_GRAVITY:
- case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
+ case SensorType::ACCELEROMETER:
+ case SensorType::MAGNETIC_FIELD:
+ case SensorType::ORIENTATION:
+ case SensorType::GYROSCOPE:
+ case SensorType::GRAVITY:
+ case SensorType::LINEAR_ACCELERATION:
{
dst->u.vec3.x = src.acceleration.x;
dst->u.vec3.y = src.acceleration.y;
@@ -92,9 +92,9 @@
break;
}
- case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
+ case SensorType::ROTATION_VECTOR:
+ case SensorType::GAME_ROTATION_VECTOR:
+ case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
{
dst->u.vec4.x = src.data[0];
dst->u.vec4.y = src.data[1];
@@ -103,146 +103,148 @@
break;
}
- case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
- case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
- {
- dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
- dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
- dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
- dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
- dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
- dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
- break;
- }
+ case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+ case SensorType::GYROSCOPE_UNCALIBRATED:
+ case SensorType::ACCELEROMETER_UNCALIBRATED:
+ {
+ dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
+ dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
+ dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
+ dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
+ dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
+ dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
+ break;
+ }
- case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
- case SensorType::SENSOR_TYPE_LIGHT:
- case SensorType::SENSOR_TYPE_PRESSURE:
- case SensorType::SENSOR_TYPE_TEMPERATURE:
- case SensorType::SENSOR_TYPE_PROXIMITY:
- case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
- case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
- case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
- case SensorType::SENSOR_TYPE_STEP_DETECTOR:
- case SensorType::SENSOR_TYPE_TILT_DETECTOR:
- case SensorType::SENSOR_TYPE_WAKE_GESTURE:
- case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
- case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
- case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
- case SensorType::SENSOR_TYPE_STATIONARY_DETECT:
- case SensorType::SENSOR_TYPE_MOTION_DETECT:
- case SensorType::SENSOR_TYPE_HEART_BEAT:
- {
- dst->u.scalar = src.data[0];
- break;
- }
+ case SensorType::DEVICE_ORIENTATION:
+ case SensorType::LIGHT:
+ case SensorType::PRESSURE:
+ case SensorType::TEMPERATURE:
+ case SensorType::PROXIMITY:
+ case SensorType::RELATIVE_HUMIDITY:
+ case SensorType::AMBIENT_TEMPERATURE:
+ case SensorType::SIGNIFICANT_MOTION:
+ case SensorType::STEP_DETECTOR:
+ case SensorType::TILT_DETECTOR:
+ case SensorType::WAKE_GESTURE:
+ case SensorType::GLANCE_GESTURE:
+ case SensorType::PICK_UP_GESTURE:
+ case SensorType::WRIST_TILT_GESTURE:
+ case SensorType::STATIONARY_DETECT:
+ case SensorType::MOTION_DETECT:
+ case SensorType::HEART_BEAT:
+ {
+ dst->u.scalar = src.data[0];
+ break;
+ }
- case SensorType::SENSOR_TYPE_STEP_COUNTER:
- {
- dst->u.stepCount = src.u64.step_counter;
- break;
- }
+ case SensorType::STEP_COUNTER:
+ {
+ dst->u.stepCount = src.u64.step_counter;
+ break;
+ }
- case SensorType::SENSOR_TYPE_HEART_RATE:
- {
- dst->u.heartRate.bpm = src.heart_rate.bpm;
- dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
- break;
- }
+ case SensorType::HEART_RATE:
+ {
+ dst->u.heartRate.bpm = src.heart_rate.bpm;
+ dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
+ break;
+ }
- case SensorType::SENSOR_TYPE_POSE_6DOF: // 15 floats
- {
- for (size_t i = 0; i < 15; ++i) {
- dst->u.pose6DOF[i] = src.data[i];
- }
- break;
- }
+ case SensorType::POSE_6DOF: // 15 floats
+ {
+ for (size_t i = 0; i < 15; ++i) {
+ dst->u.pose6DOF[i] = src.data[i];
+ }
+ break;
+ }
- case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
- {
- dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
- dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
+ case SensorType::DYNAMIC_SENSOR_META:
+ {
+ dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
+ dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
- memcpy(dst->u.dynamic.uuid.data(),
- src.dynamic_sensor_meta.uuid,
- 16);
+ memcpy(dst->u.dynamic.uuid.data(),
+ src.dynamic_sensor_meta.uuid,
+ 16);
- break;
- }
+ break;
+ }
- case SensorType::SENSOR_TYPE_ADDITIONAL_INFO:
- {
- ::android::hardware::sensors::V1_0::AdditionalInfo *dstInfo =
- &dst->u.additional;
+ case SensorType::ADDITIONAL_INFO:
+ {
+ ::android::hardware::sensors::V1_0::AdditionalInfo *dstInfo =
+ &dst->u.additional;
- const additional_info_event_t &srcInfo = src.additional_info;
+ const additional_info_event_t &srcInfo = src.additional_info;
- dstInfo->type =
- (::android::hardware::sensors::V1_0::AdditionalInfoType)
- srcInfo.type;
+ dstInfo->type =
+ (::android::hardware::sensors::V1_0::AdditionalInfoType)
+ srcInfo.type;
- dstInfo->serial = srcInfo.serial;
+ dstInfo->serial = srcInfo.serial;
- CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
- memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
- break;
- }
+ CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
+ memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
+ break;
+ }
- default:
- {
- CHECK_GE((int32_t)dst->sensorType,
- (int32_t)SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE);
+ default:
+ {
+ CHECK_GE((int32_t)dst->sensorType,
+ (int32_t)SensorType::DEVICE_PRIVATE_BASE);
- memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
- break;
- }
- }
+ memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
+ break;
+ }
+ }
}
void convertToSensorEvent(const Event &src, sensors_event_t *dst) {
- dst->version = sizeof(sensors_event_t);
- dst->sensor = src.sensorHandle;
- dst->type = (int32_t)src.sensorType;
- dst->reserved0 = 0;
- dst->timestamp = src.timestamp;
- dst->flags = 0;
- dst->reserved1[0] = dst->reserved1[1] = dst->reserved1[2] = 0;
+ dst->version = sizeof(sensors_event_t);
+ dst->sensor = src.sensorHandle;
+ dst->type = (int32_t)src.sensorType;
+ dst->reserved0 = 0;
+ dst->timestamp = src.timestamp;
+ dst->flags = 0;
+ dst->reserved1[0] = dst->reserved1[1] = dst->reserved1[2] = 0;
- switch (src.sensorType) {
- case SensorType::SENSOR_TYPE_META_DATA:
- {
- dst->meta_data.what = (int32_t)src.u.meta.what;
- dst->meta_data.sensor = dst->sensor;
- break;
- }
+ switch (src.sensorType) {
+ case SensorType::META_DATA:
+ {
+ dst->meta_data.what = (int32_t)src.u.meta.what;
+ dst->meta_data.sensor = dst->sensor;
+ break;
+ }
- case SensorType::SENSOR_TYPE_ACCELEROMETER:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
- case SensorType::SENSOR_TYPE_ORIENTATION:
- case SensorType::SENSOR_TYPE_GYROSCOPE:
- case SensorType::SENSOR_TYPE_GRAVITY:
- case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
- {
- dst->acceleration.x = src.u.vec3.x;
- dst->acceleration.y = src.u.vec3.y;
- dst->acceleration.z = src.u.vec3.z;
- dst->acceleration.status = (int8_t)src.u.vec3.status;
- break;
- }
+ case SensorType::ACCELEROMETER:
+ case SensorType::MAGNETIC_FIELD:
+ case SensorType::ORIENTATION:
+ case SensorType::GYROSCOPE:
+ case SensorType::GRAVITY:
+ case SensorType::LINEAR_ACCELERATION:
+ {
+ dst->acceleration.x = src.u.vec3.x;
+ dst->acceleration.y = src.u.vec3.y;
+ dst->acceleration.z = src.u.vec3.z;
+ dst->acceleration.status = (int8_t)src.u.vec3.status;
+ break;
+ }
- case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
- {
- dst->data[0] = src.u.vec4.x;
- dst->data[1] = src.u.vec4.y;
- dst->data[2] = src.u.vec4.z;
- dst->data[3] = src.u.vec4.w;
- break;
- }
+ case SensorType::ROTATION_VECTOR:
+ case SensorType::GAME_ROTATION_VECTOR:
+ case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
+ {
+ dst->data[0] = src.u.vec4.x;
+ dst->data[1] = src.u.vec4.y;
+ dst->data[2] = src.u.vec4.z;
+ dst->data[3] = src.u.vec4.w;
+ break;
+ }
- case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
- case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+ case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+ case SensorType::GYROSCOPE_UNCALIBRATED:
+ case SensorType::ACCELEROMETER_UNCALIBRATED:
{
dst->uncalibrated_gyro.x_uncalib = src.u.uncal.x;
dst->uncalibrated_gyro.y_uncalib = src.u.uncal.y;
@@ -253,42 +255,42 @@
break;
}
- case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
- case SensorType::SENSOR_TYPE_LIGHT:
- case SensorType::SENSOR_TYPE_PRESSURE:
- case SensorType::SENSOR_TYPE_TEMPERATURE:
- case SensorType::SENSOR_TYPE_PROXIMITY:
- case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
- case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
- case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
- case SensorType::SENSOR_TYPE_STEP_DETECTOR:
- case SensorType::SENSOR_TYPE_TILT_DETECTOR:
- case SensorType::SENSOR_TYPE_WAKE_GESTURE:
- case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
- case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
- case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
- case SensorType::SENSOR_TYPE_STATIONARY_DETECT:
- case SensorType::SENSOR_TYPE_MOTION_DETECT:
- case SensorType::SENSOR_TYPE_HEART_BEAT:
+ case SensorType::DEVICE_ORIENTATION:
+ case SensorType::LIGHT:
+ case SensorType::PRESSURE:
+ case SensorType::TEMPERATURE:
+ case SensorType::PROXIMITY:
+ case SensorType::RELATIVE_HUMIDITY:
+ case SensorType::AMBIENT_TEMPERATURE:
+ case SensorType::SIGNIFICANT_MOTION:
+ case SensorType::STEP_DETECTOR:
+ case SensorType::TILT_DETECTOR:
+ case SensorType::WAKE_GESTURE:
+ case SensorType::GLANCE_GESTURE:
+ case SensorType::PICK_UP_GESTURE:
+ case SensorType::WRIST_TILT_GESTURE:
+ case SensorType::STATIONARY_DETECT:
+ case SensorType::MOTION_DETECT:
+ case SensorType::HEART_BEAT:
{
dst->data[0] = src.u.scalar;
break;
}
- case SensorType::SENSOR_TYPE_STEP_COUNTER:
+ case SensorType::STEP_COUNTER:
{
dst->u64.step_counter = src.u.stepCount;
break;
}
- case SensorType::SENSOR_TYPE_HEART_RATE:
+ case SensorType::HEART_RATE:
{
dst->heart_rate.bpm = src.u.heartRate.bpm;
dst->heart_rate.status = (int8_t)src.u.heartRate.status;
break;
}
- case SensorType::SENSOR_TYPE_POSE_6DOF: // 15 floats
+ case SensorType::POSE_6DOF: // 15 floats
{
for (size_t i = 0; i < 15; ++i) {
dst->data[i] = src.u.pose6DOF[i];
@@ -296,7 +298,7 @@
break;
}
- case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
+ case SensorType::DYNAMIC_SENSOR_META:
{
dst->dynamic_sensor_meta.connected = src.u.dynamic.connected;
dst->dynamic_sensor_meta.handle = src.u.dynamic.sensorHandle;
@@ -309,7 +311,7 @@
break;
}
- case SensorType::SENSOR_TYPE_ADDITIONAL_INFO:
+ case SensorType::ADDITIONAL_INFO:
{
const ::android::hardware::sensors::V1_0::AdditionalInfo &srcInfo =
src.u.additional;
@@ -330,7 +332,7 @@
default:
{
CHECK_GE((int32_t)src.sensorType,
- (int32_t)SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE);
+ (int32_t)SensorType::DEVICE_PRIVATE_BASE);
memcpy(dst->data, src.u.data.data(), 16 * sizeof(float));
break;
diff --git a/sensors/1.0/types.hal b/sensors/1.0/types.hal
index 3527106..c8c8dfc 100644
--- a/sensors/1.0/types.hal
+++ b/sensors/1.0/types.hal
@@ -34,10 +34,10 @@
/*
* Sensor HAL modes used in setOperationMode method
*/
-@export(name="")
+@export(name="", value_prefix="SENSOR_HAL_", value_suffix="_MODE")
enum OperationMode : int32_t {
- SENSOR_HAL_NORMAL_MODE = 0,
- SENSOR_HAL_DATA_INJECTION_MODE = 1,
+ NORMAL = 0,
+ DATA_INJECTION = 1,
};
/*
@@ -52,21 +52,22 @@
* Device manufacturers (OEMs) can define their own sensor types, for
* their private use by applications or services provided by them. Such
* sensor types are specific to an OEM and can't be exposed in the SDK.
- * These types must start at SENSOR_TYPE_DEVICE_PRIVATE_BASE.
+ * These types must start at SensorType::DEVICE_PRIVATE_BASE.
*
* All sensors defined outside of the device private range must correspond to
* a type defined in this file, and must satisfy the characteristics listed in
* the description of the sensor type.
*
* Each sensor also has a "typeAsString".
- * - StringType of sensors inside of the device private range MUST be prefixed
+ * - string type of sensors defined in this file is overridden by Android to
+ * values defined in Android API with "android.sensor." prefix.
+ * Example: for an accelerometer,
+ * type = SensorType::Acclerometer
+ * typeAsString = "" (will be replace by "android.sensor.accelerometer" by
+ * Android frameowrk)
+ * - string type of sensors inside of the device private range MUST be prefixed
* by the sensor provider's or OEM reverse domain name. In particular, they
- * cannot use the "android.sensor" prefix.
- * - StringType of sensors outside of the device private range MUST correspond
- * to the one defined in this file (starting with "android.sensor").
- * For example, accelerometers must have
- * type=SENSOR_TYPE_ACCELEROMETER and
- * stringType=SENSOR_STRING_TYPE_ACCELEROMETER
+ * cannot use the "android.sensor." prefix.
*
* When android introduces a new sensor type that can replace an OEM-defined
* sensor type, the OEM must use the official sensor type and stringType on
@@ -76,13 +77,14 @@
* detecting that Glass is on a head.
* - Such a sensor is not officially supported in android KitKat
* - Glass devices launching on KitKat can implement a sensor with
- * type = 0x10001 and stringType = "com.google.glass.onheaddetector"
+ * type = 0x10001
+ * typeAsString = "com.google.glass.onheaddetector"
* - In L android release, if android decides to define
- * SENSOR_TYPE_ON_HEAD_DETECTOR and STRING_SENSOR_TYPE_ON_HEAD_DETECTOR,
+ * SensorType::ON_HEAD_DETECTOR and STRING_SensorType::ON_HEAD_DETECTOR,
* those types should replace the Glass-team-specific types in all future
* launches.
* - When launching Glass on the L release, Google should now use the official
- * type (SENSOR_TYPE_ON_HEAD_DETECTOR) and stringType.
+ * type (SensorType::ON_HEAD_DETECTOR) and stringType.
* - This way, all applications can now use this sensor.
*/
@@ -102,39 +104,39 @@
* previous releases are also wake-up sensors and must be treated as such.
* Wake-up one-shot sensors like SIGNIFICANT_MOTION cannot be batched, hence
* the text about batch above doesn't apply to them. See the definitions of
- * SENSOR_TYPE_PROXIMITY and SENSOR_TYPE_SIGNIFICANT_MOTION for more info.
+ * SensorType::PROXIMITY and SensorType::SIGNIFICANT_MOTION for more info.
*
* Set SENSOR_FLAG_WAKE_UP flag for all wake-up sensors.
*
- * For example, A device can have two sensors both of SENSOR_TYPE_ACCELEROMETER
+ * For example, A device can have two sensors both of SensorType::ACCELEROMETER
* and one of them can be a wake_up sensor (with SENSOR_FLAG_WAKE_UP flag set)
* and the other can be a regular non wake_up sensor. Both of these sensors
* must be activated/deactivated independently of the other.
*/
-@export(name="")
+@export(name="", value_prefix="SENSOR_TYPE_")
enum SensorType : int32_t {
/* META_DATA is a special event type used to populate the MetaData
* structure. It doesn't correspond to a physical sensor. Events of this
* type exist only inside the HAL, their primary purpose is to signal the
* completion of a flush request.
*/
- SENSOR_TYPE_META_DATA = 0,
+ META_DATA = 0,
/*
- * SENSOR_TYPE_ACCELEROMETER
+ * ACCELEROMETER
* reporting-mode: continuous
*
* All values are in SI units (m/s^2) and measure the acceleration of the
- * device minus the force of gravity.
+ * device minus the acceleration due to gravity.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_ACCELEROMETER = 1,
+ ACCELEROMETER = 1,
/*
- * SENSOR_TYPE_GEOMAGNETIC_FIELD
+ * MAGNETIC_FIELD
* reporting-mode: continuous
*
* All values are in micro-Tesla (uT) and measure the geomagnetic
@@ -143,10 +145,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GEOMAGNETIC_FIELD = 2,
+ MAGNETIC_FIELD = 2,
/*
- * SENSOR_TYPE_ORIENTATION
+ * ORIENTATION
* reporting-mode: continuous
*
* All values are angles in degrees.
@@ -157,10 +159,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_ORIENTATION = 3,
+ ORIENTATION = 3,
/*
- * SENSOR_TYPE_GYROSCOPE
+ * GYROSCOPE
* reporting-mode: continuous
*
* All values are in radians/second and measure the rate of rotation
@@ -169,20 +171,20 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GYROSCOPE = 4,
+ GYROSCOPE = 4,
/*
- * SENSOR_TYPE_LIGHT
+ * LIGHT
* reporting-mode: on-change
*
* The light sensor value is returned in SI lux units.
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_LIGHT = 5,
+ LIGHT = 5,
/*
- * SENSOR_TYPE_PRESSURE
+ * PRESSURE
* reporting-mode: continuous
*
* The pressure sensor return the athmospheric pressure in hectopascal (hPa)
@@ -190,13 +192,13 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_PRESSURE = 6,
+ PRESSURE = 6,
- /* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */
- SENSOR_TYPE_TEMPERATURE = 7,
+ /* TEMPERATURE is deprecated in the HAL */
+ TEMPERATURE = 7,
/*
- * SENSOR_TYPE_PROXIMITY
+ * PROXIMITY
* reporting-mode: on-change
*
* The proximity sensor which turns the screen off and back on during calls
@@ -206,10 +208,10 @@
* The value corresponds to the distance to the nearest object in
* centimeters.
*/
- SENSOR_TYPE_PROXIMITY = 8,
+ PROXIMITY = 8,
/*
- * SENSOR_TYPE_GRAVITY
+ * GRAVITY
* reporting-mode: continuous
*
* A gravity output indicates the direction of and magnitude of gravity in
@@ -218,10 +220,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GRAVITY = 9,
+ GRAVITY = 9,
/*
- * SENSOR_TYPE_LINEAR_ACCELERATION
+ * LINEAR_ACCELERATION
* reporting-mode: continuous
*
* Indicates the linear acceleration of the device in device coordinates,
@@ -230,10 +232,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_LINEAR_ACCELERATION = 10,
+ LINEAR_ACCELERATION = 10,
/*
- * SENSOR_TYPE_ROTATION_VECTOR
+ * ROTATION_VECTOR
* reporting-mode: continuous
*
* The rotation vector symbolizes the orientation of the device relative to
@@ -242,10 +244,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_ROTATION_VECTOR = 11,
+ ROTATION_VECTOR = 11,
/*
- * SENSOR_TYPE_RELATIVE_HUMIDITY
+ * RELATIVE_HUMIDITY
* reporting-mode: on-change
*
* A relative humidity sensor measures relative ambient air humidity and
@@ -253,44 +255,44 @@
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_RELATIVE_HUMIDITY = 12,
+ RELATIVE_HUMIDITY = 12,
/*
- * SENSOR_TYPE_AMBIENT_TEMPERATURE
+ * AMBIENT_TEMPERATURE
* reporting-mode: on-change
*
* The ambient (room) temperature in degree Celsius.
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_AMBIENT_TEMPERATURE = 13,
+ AMBIENT_TEMPERATURE = 13,
/*
- * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED
+ * MAGNETIC_FIELD_UNCALIBRATED
* reporting-mode: continuous
*
- * Similar to SENSOR_TYPE_MAGNETIC_FIELD, but the hard iron calibration is
+ * Similar to MAGNETIC_FIELD, but the hard iron calibration is
* reported separately instead of being included in the measurement.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14,
+ MAGNETIC_FIELD_UNCALIBRATED = 14,
/*
- * SENSOR_TYPE_GAME_ROTATION_VECTOR
+ * GAME_ROTATION_VECTOR
* reporting-mode: continuous
*
- * Similar to SENSOR_TYPE_ROTATION_VECTOR, but not using the geomagnetic
+ * Similar to ROTATION_VECTOR, but not using the geomagnetic
* field.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GAME_ROTATION_VECTOR = 15,
+ GAME_ROTATION_VECTOR = 15,
/*
- * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+ * GYROSCOPE_UNCALIBRATED
* reporting-mode: continuous
*
* All values are in radians/second and measure the rate of rotation
@@ -299,10 +301,10 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16,
+ GYROSCOPE_UNCALIBRATED = 16,
/*
- * SENSOR_TYPE_SIGNIFICANT_MOTION
+ * SIGNIFICANT_MOTION
* reporting-mode: one-shot
*
* A sensor of this type triggers an event each time significant motion
@@ -312,10 +314,10 @@
* significant motion sensor. A non wake-up version is not useful.
* The only allowed value to return is 1.0.
*/
- SENSOR_TYPE_SIGNIFICANT_MOTION = 17,
+ SIGNIFICANT_MOTION = 17,
/*
- * SENSOR_TYPE_STEP_DETECTOR
+ * STEP_DETECTOR
* reporting-mode: special
*
* A sensor of this type triggers an event each time a step is taken
@@ -324,10 +326,10 @@
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_STEP_DETECTOR = 18,
+ STEP_DETECTOR = 18,
/*
- * SENSOR_TYPE_STEP_COUNTER
+ * STEP_COUNTER
* reporting-mode: on-change
*
* A sensor of this type returns the number of steps taken by the user since
@@ -337,22 +339,22 @@
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_STEP_COUNTER = 19,
+ STEP_COUNTER = 19,
/*
- * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
+ * GEOMAGNETIC_ROTATION_VECTOR
* reporting-mode: continuous
*
- * Similar to SENSOR_TYPE_ROTATION_VECTOR, but using a magnetometer instead
+ * Similar to ROTATION_VECTOR, but using a magnetometer instead
* of using a gyroscope.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
- SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20,
+ GEOMAGNETIC_ROTATION_VECTOR = 20,
/*
- * SENSOR_TYPE_HEART_RATE
+ * HEART_RATE
* reporting-mode: on-change
*
* A sensor of this type returns the current heart rate.
@@ -364,7 +366,7 @@
* when heart_rate.bpm or heart_rate.status have changed since the last
* event. In particular, upon the first activation, unless the device is
* known to not be on the body, the status field of the first event must be
- * set to SENSOR_STATUS_UNRELIABLE. The event must not be generated faster
+ * set to SensorStatus::UNRELIABLE. The event should be generated no faster
* than every period_ns passed to setDelay() or to batch().
* See the definition of the on-change reporting mode for more information.
*
@@ -373,10 +375,10 @@
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_HEART_RATE = 21,
+ HEART_RATE = 21,
/*
- * SENSOR_TYPE_WAKE_UP_TILT_DETECTOR
+ * WAKE_UP_TILT_DETECTOR
* reporting-mode: special (setDelay has no impact)
*
* A sensor of this type generates an event each time a tilt event is
@@ -412,10 +414,10 @@
*
* Implement only the wake-up version of this sensor.
*/
- SENSOR_TYPE_TILT_DETECTOR = 22,
+ TILT_DETECTOR = 22,
/*
- * SENSOR_TYPE_WAKE_GESTURE
+ * WAKE_GESTURE
* reporting-mode: one-shot
*
* A sensor enabling waking up the device based on a device specific motion.
@@ -433,10 +435,10 @@
*
* Implement only the wake-up version of this sensor.
*/
- SENSOR_TYPE_WAKE_GESTURE = 23,
+ WAKE_GESTURE = 23,
/*
- * SENSOR_TYPE_GLANCE_GESTURE
+ * GLANCE_GESTURE
* reporting-mode: one-shot
*
* A sensor enabling briefly turning the screen on to enable the user to
@@ -458,10 +460,10 @@
*
* Implement only the wake-up version of this sensor.
*/
- SENSOR_TYPE_GLANCE_GESTURE = 24,
+ GLANCE_GESTURE = 24,
/**
- * SENSOR_TYPE_PICK_UP_GESTURE
+ * PICK_UP_GESTURE
* reporting-mode: one-shot
*
* A sensor of this type triggers when the device is picked up regardless of
@@ -470,10 +472,10 @@
*
* Implement only the wake-up version of this sensor.
*/
- SENSOR_TYPE_PICK_UP_GESTURE = 25,
+ PICK_UP_GESTURE = 25,
/*
- * SENSOR_TYPE_WRIST_TILT_GESTURE
+ * WRIST_TILT_GESTURE
* trigger-mode: special
* wake-up sensor: yes
*
@@ -485,10 +487,10 @@
*
* Implement only the wake-up version of this sensor.
*/
- SENSOR_TYPE_WRIST_TILT_GESTURE = 26,
+ WRIST_TILT_GESTURE = 26,
/*
- * SENSOR_TYPE_DEVICE_ORIENTATION
+ * DEVICE_ORIENTATION
* reporting-mode: on-change
*
* The current orientation of the device. The value is reported in
@@ -519,10 +521,10 @@
*
* Both wake-up and non wake-up versions are useful.
*/
- SENSOR_TYPE_DEVICE_ORIENTATION = 27,
+ DEVICE_ORIENTATION = 27,
/*
- * SENSOR_TYPE_POSE_6DOF
+ * POSE_6DOF
* trigger-mode: continuous
*
* A sensor of this type returns the pose of the device.
@@ -537,10 +539,10 @@
* . Depth Camera
*
*/
- SENSOR_TYPE_POSE_6DOF = 28,
+ POSE_6DOF = 28,
/*
- * SENSOR_TYPE_STATIONARY_DETECT
+ * STATIONARY_DETECT
* trigger mode: one shot
*
* A sensor of this type returns an event if the device is still/stationary
@@ -551,10 +553,10 @@
*
* The only allowed value to return is 1.0.
*/
- SENSOR_TYPE_STATIONARY_DETECT = 29,
+ STATIONARY_DETECT = 29,
/*
- * SENSOR_TYPE_MOTION_DETECT
+ * MOTION_DETECT
* trigger mode: one shot
*
* A sensor of this type returns an event if the device is not still for
@@ -569,10 +571,10 @@
*
* The only allowed value to return is 1.0.
*/
- SENSOR_TYPE_MOTION_DETECT = 30,
+ MOTION_DETECT = 30,
/*
- * SENSOR_TYPE_HEART_BEAT
+ * HEART_BEAT
* trigger mode: continuous
*
* A sensor of this type returns an event everytime a hear beat peak is
@@ -589,10 +591,10 @@
* of the peak where 0.0 represent no information at all, and 1.0 represents
* certainty.
*/
- SENSOR_TYPE_HEART_BEAT = 31,
+ HEART_BEAT = 31,
/**
- * SENSOR_TYPE_DYNAMIC_SENSOR_META
+ * DYNAMIC_SENSOR_META
* trigger-mode: special
*
* A sensor event of this type is received when a dynamic sensor is added to
@@ -607,7 +609,7 @@
* A dynamic sensor connection indicates connection of a physical device or
* instantiation of a virtual sensor backed by algorithm; and a dynamic
* sensor disconnection indicates the the opposite. A sensor event of
- * SENSOR_TYPE_DYNAMIC_SENSOR_META type must be delivered regardless of
+ * DYNAMIC_SENSOR_META type should be delivered regardless of
* the activation status of the sensor in the event of dynamic sensor
* connection and disconnection. In the sensor event, besides the common
* data entries, "dynamic_sensor_meta", which includes fields for connection
@@ -636,10 +638,10 @@
* unit.
*
*/
- SENSOR_TYPE_DYNAMIC_SENSOR_META = 32,
+ DYNAMIC_SENSOR_META = 32,
/**
- * SENSOR_TYPE_ADDITIONAL_INFO
+ * ADDITIONAL_INFO
* reporting-mode: N/A
*
* This sensor type is for delivering additional sensor information aside
@@ -652,9 +654,13 @@
* sensor list can have the type SENSOR_TYPE_ADDITIONAL_INFO. If a
* sensor HAL supports sensor additional information feature, it reports
* sensor_event_t with "sensor" field set to handle of the reporting sensor
- * and "type" field set to SENSOR_TYPE_ADDITIONAL_INFO. Delivery of
+ * and "type" field set to ADDITIONAL_INFO. Delivery of
* additional information events is triggered under two conditions: an
* enable activate() call or a flush() call to the corresponding sensor.
+ * Besides, time varying parameters can update infrequently without being
+ * triggered. Device is responsible to control update rate. The recommend
+ * update rate is less than 1/1000 of sensor event rate or less than once
+ * per minute in average.
*
* A single additional information report consists of multiple frames.
* Sequences of these frames are ordered using timestamps, which means the
@@ -668,13 +674,13 @@
* spans multiple frames. The first frame of the entire report is always of
* type AINFO_BEGIN, and the last frame is always AINFO_END.
*
- * All additional information frames have to be delivered after flush
- * complete event if flush() was triggering the report.
+ * If flush() was triggering the report, all additional information frames
+ * must be delivered after flush complete event.
*/
- SENSOR_TYPE_ADDITIONAL_INFO = 33,
+ ADDITIONAL_INFO = 33,
/*
- * SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT
+ * LOW_LATENCY_OFFBODY_DETECT
* trigger-mode: on-change
* wake-up sensor: yes
*
@@ -694,17 +700,29 @@
* 1.0 for on-body
*
*/
- SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
+ LOW_LATENCY_OFFBODY_DETECT = 34,
+
+ /*
+ * ACCELEROMETER_UNCALIBRATED
+ * reporting-mode: continuous
+ *
+ * All values are in SI units (m/s^2) and measure the acceleration of the
+ * device minus the acceleration due to gravity.
+ *
+ * Implement the non-wake-up version of this sensor and implement the
+ * wake-up version if the system possesses a wake up fifo.
+ */
+ ACCELEROMETER_UNCALIBRATED = 35,
/*
* Base for device manufacturers private sensor types.
* These sensor types can't be exposed in the SDK.
*/
- SENSOR_TYPE_DEVICE_PRIVATE_BASE = 0x10000
+ DEVICE_PRIVATE_BASE = 0x10000
};
-@export(name="")
-enum SensorFlagBits : uint64_t {
+@export(name="", value_prefix="SENSOR_FLAG_")
+enum SensorFlagBits : uint32_t {
/*
* Whether this sensor wakes up the AP from suspend mode when data is
* available. Whenever sensor events are delivered from a wake_up sensor,
@@ -714,7 +732,7 @@
* SensorService, the driver can safely release the wake_lock. SensorService
* will continue to hold a wake_lock till the app actually reads the events.
*/
- SENSOR_FLAG_WAKE_UP = 1,
+ WAKE_UP = 1,
/*
* Reporting modes for various sensors. Each sensor will have exactly one of
@@ -722,10 +740,10 @@
* The least significant 2nd, 3rd and 4th bits are used to represent four
* possible reporting modes.
*/
- SENSOR_FLAG_CONTINUOUS_MODE = 0,
- SENSOR_FLAG_ON_CHANGE_MODE = 2,
- SENSOR_FLAG_ONE_SHOT_MODE = 4,
- SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6,
+ CONTINUOUS_MODE = 0,
+ ON_CHANGE_MODE = 2,
+ ONE_SHOT_MODE = 4,
+ SPECIAL_REPORTING_MODE = 6,
/*
* Set this flag if the sensor supports data_injection mode and allows data
@@ -735,48 +753,58 @@
* can be set with this flag and SensorService will inject accelerometer
* data and read the corresponding step counts.
*/
- SENSOR_FLAG_SUPPORTS_DATA_INJECTION = 0x10,
+ DATA_INJECTION = 0x10,
/*
* Set this flag if the sensor is a dynamically connected sensor. See
* DynamicSensorInfo and DYNAMIC_SENSOR_META for details.
*/
- SENSOR_FLAG_DYNAMIC_SENSOR = 0x20,
+ DYNAMIC_SENSOR = 0x20,
/*
* Set this flag if sensor additional information is supported.
* See ADDITIONAL_INFO and AdditionalInfo for details.
*/
- SENSOR_FLAG_ADDITIONAL_INFO = 0x40,
+ ADDITIONAL_INFO = 0x40,
/*
* Set this flag if sensor suppor direct channel backed by ashmem.
* See SharedMemType and registerDirectChannel for more details.
*/
- SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 0x400,
+ DIRECT_CHANNEL_ASHMEM = 0x400,
/*
* Set this flag if sensor suppor direct channel backed by gralloc HAL memory.
* See SharedMemType and registerDirectChannel for more details.
*/
- SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 0x800,
+ DIRECT_CHANNEL_GRALLOC = 0x800,
/*
* Flags mask for reporting mode of sensor.
*/
- SENSOR_FLAG_MASK_REPORTING_MODE = 0xE,
+ MASK_REPORTING_MODE = 0xE,
/*
* Flags mask for direct report maximum rate level support.
* See RateLevel.
*/
- SENSOR_FLAG_MASK_DIRECT_REPORT = 0x380,
+ MASK_DIRECT_REPORT = 0x380,
/*
* Flags mask for all direct channel support bits.
* See SharedMemType.
*/
- SENSOR_FLAG_MASK_DIRECT_CHANNEL = 0xC00,
+ MASK_DIRECT_CHANNEL = 0xC00,
+};
+
+@export(name="sensor_flag_shift_t", value_prefix="SENSOR_FLAG_SHIFT_")
+enum SensorFlagShift : uint8_t {
+ REPORTING_MODE = 1,
+ DATA_INJECTION = 4,
+ DYNAMIC_SENSOR = 5,
+ ADDITIONAL_INFO = 6,
+ DIRECT_REPORT = 7,
+ DIRECT_CHANNEL = 10,
};
struct SensorInfo {
@@ -803,13 +831,14 @@
/* this sensor's type. */
SensorType type;
- /* type of this sensor as a string. Set to corresponding
- * SENSOR_STRING_TYPE_*.
+ /* type of this sensor as a string.
+ *
* When defining an OEM specific sensor or sensor manufacturer specific
* sensor, use your reserve domain name as a prefix.
- * ex: com.google.glass.onheaddetector
- * For sensors of known type, the android framework might overwrite this
- * string automatically.
+ * e.g. com.google.glass.onheaddetector
+ *
+ * For sensors of known type defined in SensorType (value <
+ * SensorType::DEVICE_PRIVATE_BASE), this can be an empty string.
*/
string typeAsString;
@@ -872,16 +901,16 @@
int32_t maxDelay;
/* Bitmask of SensorFlagBits */
- uint64_t flags;
+ bitfield<SensorFlagBits> flags;
};
-@export(name="")
+@export(name="", value_prefix="SENSOR_STATUS_")
enum SensorStatus : int8_t {
- SENSOR_STATUS_NO_CONTACT = -1,
- SENSOR_STATUS_UNRELIABLE = 0,
- SENSOR_STATUS_ACCURACY_LOW = 1,
- SENSOR_STATUS_ACCURACY_MEDIUM = 2,
- SENSOR_STATUS_ACCURACY_HIGH = 3,
+ NO_CONTACT = -1,
+ UNRELIABLE = 0,
+ ACCURACY_LOW = 1,
+ ACCURACY_MEDIUM = 2,
+ ACCURACY_HIGH = 3,
};
struct Vec3 {
@@ -908,8 +937,9 @@
};
struct HeartRate {
- /* Heart rate in beats per minute. Set to 0 when status is
- * SENSOR_STATUS_UNRELIABLE or SENSOR_STATUS_NO_CONTACT.
+ /* Heart rate in beats per minute.
+ * Set to 0 when status is SensorStatus::UNRELIABLE or
+ * SensorStatus::NO_CONTACT
*/
float bpm;
@@ -974,8 +1004,9 @@
*/
AINFO_SAMPLING,
- /* Sampling channel modeling information
- * int32_t: noise type
+ // Sampling channel modeling information section
+
+ /* int32_t: noise type
* float[n]: parameters
*/
AINFO_CHANNEL_NOISE = 0x20000,
@@ -1005,7 +1036,7 @@
AINFO_CHANNEL_LINEAR_TRANSFORM,
/* int32_t[2]: extrapolate method, interpolate method
- * float[n]: mapping key points in paris, (in, out)...
+ * float[n]: mapping key points in pairs, (in, out)...
* (may be used to model saturation).
*/
AINFO_CHANNEL_NONLINEAR_MAP,
@@ -1015,6 +1046,49 @@
*/
AINFO_CHANNEL_RESAMPLER,
+ /* Operation environment parameters section
+ * Types in the following section is sent down (instead of reported from)
+ * device as additional information to aid sensor operation. Data is sent
+ * via injectSensorData() function to sensor handle -1 denoting all sensors
+ * in device.
+ */
+
+ /* Local geomagnetic field information based on device geo location. This
+ * type is primarily for for magnetic field calibration and rotation vector
+ * sensor fusion.
+ * float[3]: strength (uT), declination and inclination angle (rad).
+ */
+ AINFO_LOCAL_GEOMAGNETIC_FIELD = 0x30000,
+
+ /* Local gravitational acceleration strength at device geo location.
+ * float: gravitational acceleration norm in m/s^2.
+ */
+ AINFO_LOCAL_GRAVITY,
+
+ /* Device dock state.
+ * int32_t: dock state following Android API Intent.EXTRA_DOCK_STATE
+ * definition, undefined value is ignored.
+ */
+ AINFO_DOCK_STATE,
+
+ /* High performance mode hint. Device is able to use up more power and take
+ * more reources to improve throughput and latency in high performance mode.
+ * One possible use case is virtual reality, when sensor latency need to be
+ * carefully controlled.
+ * int32_t: 1 or 0, denote if device is in/out of high performance mode,
+ * other values is ignored.
+ */
+ AINFO_HIGH_PERFORMANCE_MODE,
+
+ /* Magnetic field calibration hint. Device is notified when manually
+ * triggered magnetic field calibration procedure is started or stopped. The
+ * calibration procedure is assumed timed out after 1 minute from start,
+ * even if an explicit stop is not received.
+ *
+ * int32_t: 1 for start, 0 for stop, other value is ignored.
+ */
+ AINFO_MAGNETIC_FIELD_CALIBRATION,
+
/* Custom information */
AINFO_CUSTOM_START = 0x10000000,
@@ -1046,52 +1120,53 @@
* relative humidity in percent
*/
union EventPayload {
- /* SENSOR_TYPE_ACCELEROMETER, SENSOR_TYPE_GEOMAGNETIC_FIELD,
- * SENSOR_TYPE_ORIENTATION, SENSOR_TYPE_GYROSCOPE, SENSOR_TYPE_GRAVITY,
- * SENSOR_TYPE_LINEAR_ACCELERATION
+ /* SensorType::ACCELEROMETER, SensorType::MAGNETIC_FIELD,
+ * SensorType::ORIENTATION, SensorType::GYROSCOPE, SensorType::GRAVITY,
+ * SensorType::LINEAR_ACCELERATION
*/
Vec3 vec3;
- /* SENSOR_TYPE_ROTATION_VECTOR, SENSOR_TYPE_GAME_ROTATION_VECTOR,
- * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
+ /* SensorType::ROTATION_VECTOR, SensorType::GAME_ROTATION_VECTOR,
+ * SensorType::GEOMAGNETIC_ROTATION_VECTOR
*/
Vec4 vec4;
- /* SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
- * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+ /* SensorType::MAGNETIC_FIELD_UNCALIBRATED,
+ * SensorType::GYROSCOPE_UNCALIBRATED
+ * SensorType::ACCELEROMETER_UNCALIBRATED
*/
Uncal uncal;
- /* SENSOR_TYPE_META_DATA */
+ /* SensorType::META_DATA */
MetaData meta;
- /* SENSOR_TYPE_DEVICE_ORIENTATION, SENSOR_TYPE_LIGHT, SENSOR_TYPE_PRESSURE,
- * SENSOR_TYPE_TEMPERATURE, SENSOR_TYPE_PROXIMITY,
- * SENSOR_TYPE_RELATIVE_HUMIDITY, SENSOR_TYPE_AMBIENT_TEMPERATURE,
- * SENSOR_TYPE_SIGNIFICANT_MOTION, SENSOR_TYPE_STEP_DETECTOR,
- * SENSOR_TYPE_TILT_DETECTOR, SENSOR_TYPE_WAKE_GESTURE,
- * SENSOR_TYPE_GLANCE_GESTURE, SENSOR_TYPE_PICK_UP_GESTURE,
- * SENSOR_TYPE_WRIST_TILT_GESTURE, SENSOR_TYPE_STATIONARY_DETECT,
- * SENSOR_TYPE_MOTION_DETECT, SENSOR_TYPE_HEART_BEAT
+ /* SensorType::DEVICE_ORIENTATION, SensorType::LIGHT, SensorType::PRESSURE,
+ * SensorType::TEMPERATURE, SensorType::PROXIMITY,
+ * SensorType::RELATIVE_HUMIDITY, SensorType::AMBIENT_TEMPERATURE,
+ * SensorType::SIGNIFICANT_MOTION, SensorType::STEP_DETECTOR,
+ * SensorType::TILT_DETECTOR, SensorType::WAKE_GESTURE,
+ * SensorType::GLANCE_GESTURE, SensorType::PICK_UP_GESTURE,
+ * SensorType::WRIST_TILT_GESTURE, SensorType::STATIONARY_DETECT,
+ * SensorType::MOTION_DETECT, SensorType::HEART_BEAT
*/
float scalar;
- /* SENSOR_TYPE_STEP_COUNTER */
+ /* SensorType::STEP_COUNTER */
uint64_t stepCount;
- /* SENSOR_TYPE_HEART_RATE */
+ /* SensorType::HEART_RATE */
HeartRate heartRate;
- /* SENSOR_TYPE_POSE_6DOF */
+ /* SensorType::POSE_6DOF */
float[15] pose6DOF;
- /* SENSOR_TYPE_DYNAMIC_SENSOR_META */
+ /* SensorType::DYNAMIC_SENSOR_META */
DynamicSensorInfo dynamic;
- /* SENSOR_TYPE_ADDITIONAL_INFO */
+ /* SensorType::ADDITIONAL_INFO */
AdditionalInfo additional;
- /* undefined/custom sensor type, >= SENSOR_TYPE_DEVICE_PRIVATE_BASE */
+ /* undefined/custom sensor type >= SensorType::DEVICE_PRIVATE_BASE */
float[16] data;
};
diff --git a/sensors/1.0/vts/Sensors.vts b/sensors/1.0/vts/Sensors.vts
index f80fff5..9e90755 100644
--- a/sensors/1.0/vts/Sensors.vts
+++ b/sensors/1.0/vts/Sensors.vts
@@ -47,22 +47,6 @@
}
api: {
- name: "setDelay"
- return_type_hidl: {
- type: TYPE_ENUM
- predefined_type: "::android::hardware::sensors::V1_0::Result"
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
- }
- arg: {
- type: TYPE_SCALAR
- scalar_type: "int64_t"
- }
- }
-
- api: {
name: "poll"
return_type_hidl: {
type: TYPE_ENUM
@@ -100,10 +84,6 @@
}
arg: {
type: TYPE_SCALAR
- scalar_type: "int32_t"
- }
- arg: {
- type: TYPE_SCALAR
scalar_type: "int64_t"
}
arg: {
@@ -136,4 +116,56 @@
}
}
+ api: {
+ name: "registerDirectChannel"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::Result"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::sensors::V1_0::SharedMemInfo"
+ }
+ }
+
+ api: {
+ name: "unregisterDirectChannel"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::Result"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ }
+
+ api: {
+ name: "configDirectReport"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::Result"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::RateLevel"
+ }
+ }
+
}
diff --git a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
index 17c439e..2edc5c3 100644
--- a/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
+++ b/sensors/1.0/vts/functional/sensors_hidl_hal_test.cpp
@@ -203,16 +203,16 @@
inline static SensorFlagBits extractReportMode(uint64_t flag) {
return (SensorFlagBits) (flag
- & ((uint64_t) SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE
- | (uint64_t) SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE
- | (uint64_t) SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE
- | (uint64_t) SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE));
+ & ((uint64_t) SensorFlagBits::CONTINUOUS_MODE
+ | (uint64_t) SensorFlagBits::ON_CHANGE_MODE
+ | (uint64_t) SensorFlagBits::ONE_SHOT_MODE
+ | (uint64_t) SensorFlagBits::SPECIAL_REPORTING_MODE));
}
inline static bool isMetaSensorType(SensorType type) {
- return (type == SensorType::SENSOR_TYPE_META_DATA
- || type == SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META
- || type == SensorType::SENSOR_TYPE_ADDITIONAL_INFO);
+ return (type == SensorType::META_DATA
+ || type == SensorType::DYNAMIC_SENSOR_META
+ || type == SensorType::ADDITIONAL_INFO);
}
inline static bool isValidType(SensorType type) {
@@ -225,14 +225,14 @@
bool SensorsHidlTest::typeMatchStringType(SensorType type, const hidl_string& stringType) {
- if (type >= SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE) {
+ if (type >= SensorType::DEVICE_PRIVATE_BASE) {
return true;
}
bool res = true;
switch (type) {
#define CHECK_TYPE_STRING_FOR_SENSOR_TYPE(type) \
- case SensorType::SENSOR_TYPE_ ## type: res = stringType == SENSOR_STRING_TYPE_ ## type;\
+ case SensorType::type: res = stringType == SENSOR_STRING_TYPE_ ## type;\
break;\
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER);
@@ -277,7 +277,7 @@
}
bool SensorsHidlTest::typeMatchReportMode(SensorType type, SensorFlagBits reportMode) {
- if (type >= SensorType::SENSOR_TYPE_DEVICE_PRIVATE_BASE) {
+ if (type >= SensorType::DEVICE_PRIVATE_BASE) {
return true;
}
@@ -290,19 +290,21 @@
int32_t minDelay, int32_t maxDelay, SensorFlagBits reportMode) {
bool res = true;
switch(reportMode) {
- case SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE:
+ case SensorFlagBits::CONTINUOUS_MODE:
res = (minDelay > 0) && (maxDelay >= 0);
break;
- case SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE:
+ case SensorFlagBits::ON_CHANGE_MODE:
//TODO: current implementation does not satisfy minDelay == 0 on Proximity
res = (minDelay >= 0) && (maxDelay >= 0);
//res = (minDelay == 0) && (maxDelay >= 0);
break;
- case SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE:
+ case SensorFlagBits::ONE_SHOT_MODE:
res = (minDelay == -1) && (maxDelay == 0);
break;
- case SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE:
+ case SensorFlagBits::SPECIAL_REPORTING_MODE:
res = (minDelay == 0) && (maxDelay == 0);
+ default:
+ res = false;
}
return res;
@@ -310,44 +312,44 @@
SensorFlagBits SensorsHidlTest::expectedReportModeForType(SensorType type) {
switch (type) {
- case SensorType::SENSOR_TYPE_ACCELEROMETER:
- case SensorType::SENSOR_TYPE_GYROSCOPE:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_FIELD:
- case SensorType::SENSOR_TYPE_ORIENTATION:
- case SensorType::SENSOR_TYPE_PRESSURE:
- case SensorType::SENSOR_TYPE_TEMPERATURE:
- case SensorType::SENSOR_TYPE_GRAVITY:
- case SensorType::SENSOR_TYPE_LINEAR_ACCELERATION:
- case SensorType::SENSOR_TYPE_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
- case SensorType::SENSOR_TYPE_GAME_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
- case SensorType::SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
- case SensorType::SENSOR_TYPE_POSE_6DOF:
- case SensorType::SENSOR_TYPE_HEART_BEAT:
- return SensorFlagBits::SENSOR_FLAG_CONTINUOUS_MODE;
+ case SensorType::ACCELEROMETER:
+ case SensorType::GYROSCOPE:
+ case SensorType::MAGNETIC_FIELD:
+ case SensorType::ORIENTATION:
+ case SensorType::PRESSURE:
+ case SensorType::TEMPERATURE:
+ case SensorType::GRAVITY:
+ case SensorType::LINEAR_ACCELERATION:
+ case SensorType::ROTATION_VECTOR:
+ case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+ case SensorType::GAME_ROTATION_VECTOR:
+ case SensorType::GYROSCOPE_UNCALIBRATED:
+ case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
+ case SensorType::POSE_6DOF:
+ case SensorType::HEART_BEAT:
+ return SensorFlagBits::CONTINUOUS_MODE;
- case SensorType::SENSOR_TYPE_LIGHT:
- case SensorType::SENSOR_TYPE_PROXIMITY:
- case SensorType::SENSOR_TYPE_RELATIVE_HUMIDITY:
- case SensorType::SENSOR_TYPE_AMBIENT_TEMPERATURE:
- case SensorType::SENSOR_TYPE_HEART_RATE:
- case SensorType::SENSOR_TYPE_DEVICE_ORIENTATION:
- case SensorType::SENSOR_TYPE_MOTION_DETECT:
- case SensorType::SENSOR_TYPE_STEP_COUNTER:
- return SensorFlagBits::SENSOR_FLAG_ON_CHANGE_MODE;
+ case SensorType::LIGHT:
+ case SensorType::PROXIMITY:
+ case SensorType::RELATIVE_HUMIDITY:
+ case SensorType::AMBIENT_TEMPERATURE:
+ case SensorType::HEART_RATE:
+ case SensorType::DEVICE_ORIENTATION:
+ case SensorType::MOTION_DETECT:
+ case SensorType::STEP_COUNTER:
+ return SensorFlagBits::ON_CHANGE_MODE;
- case SensorType::SENSOR_TYPE_SIGNIFICANT_MOTION:
- case SensorType::SENSOR_TYPE_WAKE_GESTURE:
- case SensorType::SENSOR_TYPE_GLANCE_GESTURE:
- case SensorType::SENSOR_TYPE_PICK_UP_GESTURE:
- return SensorFlagBits::SENSOR_FLAG_ONE_SHOT_MODE;
+ case SensorType::SIGNIFICANT_MOTION:
+ case SensorType::WAKE_GESTURE:
+ case SensorType::GLANCE_GESTURE:
+ case SensorType::PICK_UP_GESTURE:
+ return SensorFlagBits::ONE_SHOT_MODE;
- case SensorType::SENSOR_TYPE_STEP_DETECTOR:
- case SensorType::SENSOR_TYPE_TILT_DETECTOR:
- case SensorType::SENSOR_TYPE_WRIST_TILT_GESTURE:
- case SensorType::SENSOR_TYPE_DYNAMIC_SENSOR_META:
- return SensorFlagBits::SENSOR_FLAG_SPECIAL_REPORTING_MODE;
+ case SensorType::STEP_DETECTOR:
+ case SensorType::TILT_DETECTOR:
+ case SensorType::WRIST_TILT_GESTURE:
+ case SensorType::DYNAMIC_SENSOR_META:
+ return SensorFlagBits::SPECIAL_REPORTING_MODE;
default:
ALOGW("Type %d is not implemented in expectedReportModeForType", (int)type);
@@ -399,8 +401,8 @@
// Info type, should have no sensor
ASSERT_FALSE(
- s.type == SensorType::SENSOR_TYPE_ADDITIONAL_INFO
- || s.type == SensorType::SENSOR_TYPE_META_DATA);
+ s.type == SensorType::ADDITIONAL_INFO
+ || s.type == SensorType::META_DATA);
// Test fifoMax >= fifoReserved
ALOGV("max reserve = %d, %d", s.fifoMaxEventCount, s.fifoReservedEventCount);
@@ -426,7 +428,7 @@
constexpr int64_t batchingPeriodInNs = 0; // no batching
constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s
constexpr size_t minNEvent = 100; // at lease 100 events
- constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+ constexpr SensorType type = SensorType::ACCELEROMETER;
SensorInfo sensor = defaultSensorByType(type);
@@ -437,7 +439,7 @@
int32_t handle = sensor.sensorHandle;
- S()->batch(handle, 0, samplingPeriodInNs, batchingPeriodInNs);
+ S()->batch(handle, samplingPeriodInNs, batchingPeriodInNs);
S()->activate(handle, 1);
events = collectEvents(minTimeUs, minNEvent, true /*clearBeforeStart*/);
S()->activate(handle, 0);
@@ -480,7 +482,7 @@
constexpr int64_t batchingPeriodInNs = 0; // no batching
constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s
constexpr size_t minNEvent = 200;
- constexpr SensorType type = SensorType::SENSOR_TYPE_GYROSCOPE;
+ constexpr SensorType type = SensorType::GYROSCOPE;
SensorInfo sensor = defaultSensorByType(type);
@@ -491,7 +493,7 @@
int32_t handle = sensor.sensorHandle;
- S()->batch(handle, 0, samplingPeriodInNs, batchingPeriodInNs);
+ S()->batch(handle, samplingPeriodInNs, batchingPeriodInNs);
S()->activate(handle, 1);
events = collectEvents(minTimeUs, minNEvent, true /*clearBeforeStart*/);
S()->activate(handle, 0);
@@ -533,7 +535,7 @@
constexpr int64_t batchingPeriodInNs = 0; // no batching
constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s
constexpr size_t minNEvent = 50;
- constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+ constexpr SensorType type = SensorType::ACCELEROMETER;
SensorInfo sensor = defaultSensorByType(type);
@@ -551,13 +553,13 @@
return;
}
- S()->batch(handle, 0, minSamplingPeriodInNs, batchingPeriodInNs);
+ S()->batch(handle, minSamplingPeriodInNs, batchingPeriodInNs);
S()->activate(handle, 1);
usleep(500000); // sleep 0.5 sec to wait for change rate to happen
events1 = collectEvents(sensor.minDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
- S()->batch(handle, 0, maxSamplingPeriodInNs, batchingPeriodInNs);
+ S()->batch(handle, maxSamplingPeriodInNs, batchingPeriodInNs);
usleep(500000); // sleep 0.5 sec to wait for change rate to happen
events2 = collectEvents(sensor.maxDelay * minNEvent, minNEvent, true /*clearBeforeStart*/);
@@ -620,7 +622,7 @@
constexpr int64_t oneSecondInNs = 1ull * 1000 * 1000 * 1000;
constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s
constexpr size_t minNEvent = 50;
- constexpr SensorType type = SensorType::SENSOR_TYPE_ACCELEROMETER;
+ constexpr SensorType type = SensorType::ACCELEROMETER;
constexpr int64_t maxBatchingTestTimeNs = 30ull * 1000 * 1000 * 1000;
SensorInfo sensor = defaultSensorByType(type);
@@ -647,7 +649,7 @@
int64_t allowedBatchDeliverTimeNs =
std::max(oneSecondInNs, batchingPeriodInNs / 10);
- S()->batch(handle, 0, minSamplingPeriodInNs, INT64_MAX);
+ S()->batch(handle, minSamplingPeriodInNs, INT64_MAX);
S()->activate(handle, 1);
usleep(500000); // sleep 0.5 sec to wait for initialization
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/sensors/1.0/vts/types.vts b/sensors/1.0/vts/types.vts
index 37271fd..2980507 100644
--- a/sensors/1.0/vts/types.vts
+++ b/sensors/1.0/vts/types.vts
@@ -15,17 +15,21 @@
scalar_value: {
int32_t: 0
}
- enumerator: "BAD_VALUE"
- scalar_value: {
- int32_t: 1
- }
enumerator: "PERMISSION_DENIED"
scalar_value: {
- int32_t: 2
+ int32_t: -1
+ }
+ enumerator: "NO_MEMORY"
+ scalar_value: {
+ int32_t: -12
+ }
+ enumerator: "BAD_VALUE"
+ scalar_value: {
+ int32_t: -22
}
enumerator: "INVALID_OPERATION"
scalar_value: {
- int32_t: 3
+ int32_t: -38
}
}
}
@@ -36,11 +40,11 @@
enum_value: {
scalar_type: "int32_t"
- enumerator: "SENSOR_HAL_NORMAL_MODE"
+ enumerator: "NORMAL"
scalar_value: {
int32_t: 0
}
- enumerator: "SENSOR_HAL_DATA_INJECTION_MODE"
+ enumerator: "DATA_INJECTION"
scalar_value: {
int32_t: 1
}
@@ -53,147 +57,151 @@
enum_value: {
scalar_type: "int32_t"
- enumerator: "SENSOR_TYPE_META_DATA"
+ enumerator: "META_DATA"
scalar_value: {
int32_t: 0
}
- enumerator: "SENSOR_TYPE_ACCELEROMETER"
+ enumerator: "ACCELEROMETER"
scalar_value: {
int32_t: 1
}
- enumerator: "SENSOR_TYPE_GEOMAGNETIC_FIELD"
+ enumerator: "MAGNETIC_FIELD"
scalar_value: {
int32_t: 2
}
- enumerator: "SENSOR_TYPE_ORIENTATION"
+ enumerator: "ORIENTATION"
scalar_value: {
int32_t: 3
}
- enumerator: "SENSOR_TYPE_GYROSCOPE"
+ enumerator: "GYROSCOPE"
scalar_value: {
int32_t: 4
}
- enumerator: "SENSOR_TYPE_LIGHT"
+ enumerator: "LIGHT"
scalar_value: {
int32_t: 5
}
- enumerator: "SENSOR_TYPE_PRESSURE"
+ enumerator: "PRESSURE"
scalar_value: {
int32_t: 6
}
- enumerator: "SENSOR_TYPE_TEMPERATURE"
+ enumerator: "TEMPERATURE"
scalar_value: {
int32_t: 7
}
- enumerator: "SENSOR_TYPE_PROXIMITY"
+ enumerator: "PROXIMITY"
scalar_value: {
int32_t: 8
}
- enumerator: "SENSOR_TYPE_GRAVITY"
+ enumerator: "GRAVITY"
scalar_value: {
int32_t: 9
}
- enumerator: "SENSOR_TYPE_LINEAR_ACCELERATION"
+ enumerator: "LINEAR_ACCELERATION"
scalar_value: {
int32_t: 10
}
- enumerator: "SENSOR_TYPE_ROTATION_VECTOR"
+ enumerator: "ROTATION_VECTOR"
scalar_value: {
int32_t: 11
}
- enumerator: "SENSOR_TYPE_RELATIVE_HUMIDITY"
+ enumerator: "RELATIVE_HUMIDITY"
scalar_value: {
int32_t: 12
}
- enumerator: "SENSOR_TYPE_AMBIENT_TEMPERATURE"
+ enumerator: "AMBIENT_TEMPERATURE"
scalar_value: {
int32_t: 13
}
- enumerator: "SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED"
+ enumerator: "MAGNETIC_FIELD_UNCALIBRATED"
scalar_value: {
int32_t: 14
}
- enumerator: "SENSOR_TYPE_GAME_ROTATION_VECTOR"
+ enumerator: "GAME_ROTATION_VECTOR"
scalar_value: {
int32_t: 15
}
- enumerator: "SENSOR_TYPE_GYROSCOPE_UNCALIBRATED"
+ enumerator: "GYROSCOPE_UNCALIBRATED"
scalar_value: {
int32_t: 16
}
- enumerator: "SENSOR_TYPE_SIGNIFICANT_MOTION"
+ enumerator: "SIGNIFICANT_MOTION"
scalar_value: {
int32_t: 17
}
- enumerator: "SENSOR_TYPE_STEP_DETECTOR"
+ enumerator: "STEP_DETECTOR"
scalar_value: {
int32_t: 18
}
- enumerator: "SENSOR_TYPE_STEP_COUNTER"
+ enumerator: "STEP_COUNTER"
scalar_value: {
int32_t: 19
}
- enumerator: "SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR"
+ enumerator: "GEOMAGNETIC_ROTATION_VECTOR"
scalar_value: {
int32_t: 20
}
- enumerator: "SENSOR_TYPE_HEART_RATE"
+ enumerator: "HEART_RATE"
scalar_value: {
int32_t: 21
}
- enumerator: "SENSOR_TYPE_TILT_DETECTOR"
+ enumerator: "TILT_DETECTOR"
scalar_value: {
int32_t: 22
}
- enumerator: "SENSOR_TYPE_WAKE_GESTURE"
+ enumerator: "WAKE_GESTURE"
scalar_value: {
int32_t: 23
}
- enumerator: "SENSOR_TYPE_GLANCE_GESTURE"
+ enumerator: "GLANCE_GESTURE"
scalar_value: {
int32_t: 24
}
- enumerator: "SENSOR_TYPE_PICK_UP_GESTURE"
+ enumerator: "PICK_UP_GESTURE"
scalar_value: {
int32_t: 25
}
- enumerator: "SENSOR_TYPE_WRIST_TILT_GESTURE"
+ enumerator: "WRIST_TILT_GESTURE"
scalar_value: {
int32_t: 26
}
- enumerator: "SENSOR_TYPE_DEVICE_ORIENTATION"
+ enumerator: "DEVICE_ORIENTATION"
scalar_value: {
int32_t: 27
}
- enumerator: "SENSOR_TYPE_POSE_6DOF"
+ enumerator: "POSE_6DOF"
scalar_value: {
int32_t: 28
}
- enumerator: "SENSOR_TYPE_STATIONARY_DETECT"
+ enumerator: "STATIONARY_DETECT"
scalar_value: {
int32_t: 29
}
- enumerator: "SENSOR_TYPE_MOTION_DETECT"
+ enumerator: "MOTION_DETECT"
scalar_value: {
int32_t: 30
}
- enumerator: "SENSOR_TYPE_HEART_BEAT"
+ enumerator: "HEART_BEAT"
scalar_value: {
int32_t: 31
}
- enumerator: "SENSOR_TYPE_DYNAMIC_SENSOR_META"
+ enumerator: "DYNAMIC_SENSOR_META"
scalar_value: {
int32_t: 32
}
- enumerator: "SENSOR_TYPE_ADDITIONAL_INFO"
+ enumerator: "ADDITIONAL_INFO"
scalar_value: {
int32_t: 33
}
- enumerator: "SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT"
+ enumerator: "LOW_LATENCY_OFFBODY_DETECT"
scalar_value: {
int32_t: 34
}
- enumerator: "SENSOR_TYPE_DEVICE_PRIVATE_BASE"
+ enumerator: "ACCELEROMETER_UNCALIBRATED"
+ scalar_value: {
+ int32_t: 35
+ }
+ enumerator: "DEVICE_PRIVATE_BASE"
scalar_value: {
int32_t: 65536
}
@@ -204,39 +212,92 @@
name: "::android::hardware::sensors::V1_0::SensorFlagBits"
type: TYPE_ENUM
enum_value: {
- scalar_type: "uint64_t"
+ scalar_type: "uint32_t"
- enumerator: "SENSOR_FLAG_WAKE_UP"
+ enumerator: "WAKE_UP"
scalar_value: {
- uint64_t: 1
+ uint32_t: 1
}
- enumerator: "SENSOR_FLAG_CONTINUOUS_MODE"
+ enumerator: "CONTINUOUS_MODE"
scalar_value: {
- uint64_t: 0
+ uint32_t: 0
}
- enumerator: "SENSOR_FLAG_ON_CHANGE_MODE"
+ enumerator: "ON_CHANGE_MODE"
scalar_value: {
- uint64_t: 2
+ uint32_t: 2
}
- enumerator: "SENSOR_FLAG_ONE_SHOT_MODE"
+ enumerator: "ONE_SHOT_MODE"
scalar_value: {
- uint64_t: 4
+ uint32_t: 4
}
- enumerator: "SENSOR_FLAG_SPECIAL_REPORTING_MODE"
+ enumerator: "SPECIAL_REPORTING_MODE"
scalar_value: {
- uint64_t: 6
+ uint32_t: 6
}
- enumerator: "SENSOR_FLAG_SUPPORTS_DATA_INJECTION"
+ enumerator: "DATA_INJECTION"
scalar_value: {
- uint64_t: 16
+ uint32_t: 16
}
- enumerator: "SENSOR_FLAG_DYNAMIC_SENSOR"
+ enumerator: "DYNAMIC_SENSOR"
scalar_value: {
- uint64_t: 32
+ uint32_t: 32
}
- enumerator: "SENSOR_FLAG_ADDITIONAL_INFO"
+ enumerator: "ADDITIONAL_INFO"
scalar_value: {
- uint64_t: 64
+ uint32_t: 64
+ }
+ enumerator: "DIRECT_CHANNEL_ASHMEM"
+ scalar_value: {
+ uint32_t: 1024
+ }
+ enumerator: "DIRECT_CHANNEL_GRALLOC"
+ scalar_value: {
+ uint32_t: 2048
+ }
+ enumerator: "MASK_REPORTING_MODE"
+ scalar_value: {
+ uint32_t: 14
+ }
+ enumerator: "MASK_DIRECT_REPORT"
+ scalar_value: {
+ uint32_t: 896
+ }
+ enumerator: "MASK_DIRECT_CHANNEL"
+ scalar_value: {
+ uint32_t: 3072
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::sensors::V1_0::SensorFlagShift"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint8_t"
+
+ enumerator: "REPORTING_MODE"
+ scalar_value: {
+ uint8_t: 1
+ }
+ enumerator: "DATA_INJECTION"
+ scalar_value: {
+ uint8_t: 4
+ }
+ enumerator: "DYNAMIC_SENSOR"
+ scalar_value: {
+ uint8_t: 5
+ }
+ enumerator: "ADDITIONAL_INFO"
+ scalar_value: {
+ uint8_t: 6
+ }
+ enumerator: "DIRECT_REPORT"
+ scalar_value: {
+ uint8_t: 7
+ }
+ enumerator: "DIRECT_CHANNEL"
+ scalar_value: {
+ uint8_t: 10
}
}
}
@@ -312,8 +373,11 @@
}
struct_value: {
name: "flags"
- type: TYPE_SCALAR
- scalar_type: "uint64_t"
+ type: TYPE_MASK
+ enum_value: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::SensorFlagBits"
+ }
}
}
@@ -323,23 +387,23 @@
enum_value: {
scalar_type: "int8_t"
- enumerator: "SENSOR_STATUS_NO_CONTACT"
+ enumerator: "NO_CONTACT"
scalar_value: {
int8_t: -1
}
- enumerator: "SENSOR_STATUS_UNRELIABLE"
+ enumerator: "UNRELIABLE"
scalar_value: {
int8_t: 0
}
- enumerator: "SENSOR_STATUS_ACCURACY_LOW"
+ enumerator: "ACCURACY_LOW"
scalar_value: {
int8_t: 1
}
- enumerator: "SENSOR_STATUS_ACCURACY_MEDIUM"
+ enumerator: "ACCURACY_MEDIUM"
scalar_value: {
int8_t: 2
}
- enumerator: "SENSOR_STATUS_ACCURACY_HIGH"
+ enumerator: "ACCURACY_HIGH"
scalar_value: {
int8_t: 3
}
@@ -697,3 +761,82 @@
}
}
+attribute: {
+ name: "::android::hardware::sensors::V1_0::RateLevel"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "STOP"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "NORMAL"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "FAST"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "VERY_FAST"
+ scalar_value: {
+ int32_t: 3
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::sensors::V1_0::SharedMemType"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "ASHMEM"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "GRALLOC"
+ scalar_value: {
+ int32_t: 2
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::sensors::V1_0::SharedMemFormat"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "SENSORS_EVENT"
+ scalar_value: {
+ int32_t: 1
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::sensors::V1_0::SharedMemInfo"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "type"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::SharedMemType"
+ }
+ struct_value: {
+ name: "format"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::sensors::V1_0::SharedMemFormat"
+ }
+ struct_value: {
+ name: "size"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ struct_value: {
+ name: "memoryHandle"
+ type: TYPE_HANDLE
+ }
+}
+
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
index 73066e6..afda739 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
@@ -295,7 +295,7 @@
}
SoundTriggerHalImpl::SoundTriggerHalImpl(const char *moduleName)
- : mModuleName(moduleName), mNextModelId(1)
+ : mModuleName(moduleName), mHwDevice(NULL), mNextModelId(1)
{
}
diff --git a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
index 3379d93..cb00ad5 100644
--- a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
+++ b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
@@ -40,9 +40,8 @@
class SoundTriggerHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary", false);
+ mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary");
ASSERT_NE(nullptr, mSoundTriggerHal.get());
- ASSERT_TRUE(mSoundTriggerHal->isRemote());
mCallback = new MyCallback();
ASSERT_NE(nullptr, mCallback.get());
}
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/tests/msgq/1.0/ITestMsgQ.hal b/tests/msgq/1.0/ITestMsgQ.hal
index e000f55..3ed1b37 100644
--- a/tests/msgq/1.0/ITestMsgQ.hal
+++ b/tests/msgq/1.0/ITestMsgQ.hal
@@ -93,6 +93,15 @@
oneway requestBlockingRead(int32_t count);
/*
+ * This method requests the service to trigger a blocking read using
+ * default Event Flag notification bits defined by the MessageQueue class.
+ *
+ * @param count Number of messages to read.
+ *
+ */
+ oneway requestBlockingReadDefaultEventFlagBits(int32_t count);
+
+ /*
* This method requests the service to repeatedly trigger blocking reads.
*
* @param count Number of messages to read in a single blocking read.
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 98af043..0d6b560 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -81,9 +81,13 @@
*/
TDLS_OFFCHANNEL = 1 << 11,
/**
+ * Support for keep alive packet offload.
+ */
+ KEEP_ALIVE = 1 << 12,
+ /**
* Support for tracking connection packets' fate.
*/
- DEBUG_PACKET_FATE = 1 << 12
+ DEBUG_PACKET_FATE = 1 << 13
};
/**
@@ -379,6 +383,55 @@
setRoamingState(StaRoamingState state) generates (WifiStatus status);
/**
+ * Enable/Disable Neighbour discovery offload functionality in the firmware.
+ *
+ * @param enable true to enable, false to disable.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ enableNdOffload(bool enable) generates (WifiStatus status);
+
+ /**
+ * Start sending the specified keep alive packets periodically.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param ipPacketData IP packet contents to be transmitted.
+ * @param etherType 16 bit ether type to be set in the ethernet frame
+ * transmitted.
+ * @param srcAddress Source MAC address of the packet.
+ * @param dstAddress Destination MAC address of the packet.
+ * @param periodInMs Interval at which this packet must be transmitted.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ startSendingKeepAlivePackets(
+ CommandId cmdId, vec<uint8_t> ipPacketData, uint16_t etherType,
+ MacAddress srcAddress, MacAddress dstAddress, uint32_t periodInMs)
+ generates (WifiStatus status);
+
+ /**
+ * Stop sending the specified keep alive packets.
+ *
+ * @param cmdId command Id corresponding to the request.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ stopSendingKeepAlivePackets(CommandId cmdId) generates (WifiStatus status);
+
+ /**
* API to start packet fate monitoring.
* - Once stared, monitoring must remain active until HAL is unloaded.
* - When HAL is unloaded, all packet fate buffers must be cleared.
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 9cc57bb..80cc56e 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_MKEEP_ALIVE:
+ return HidlStaIfaceCaps::KEEP_ALIVE;
};
CHECK(false) << "Unknown legacy feature: " << feature;
return {};
@@ -239,7 +241,8 @@
WIFI_FEATURE_HOTSPOT,
WIFI_FEATURE_PNO,
WIFI_FEATURE_TDLS,
- WIFI_FEATURE_TDLS_OFFCHANNEL}) {
+ WIFI_FEATURE_TDLS_OFFCHANNEL,
+ WIFI_FEATURE_MKEEP_ALIVE}) {
if (feature & legacy_feature_set) {
*hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature);
}
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 3b99e60..3bfd2bb 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -633,15 +633,46 @@
return {status, caps};
}
+wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
+ wifi_roaming_config config_internal = config;
+ return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
+ &config_internal);
+}
+
wifi_error WifiLegacyHal::enableFirmwareRoaming(fw_roaming_state_t state) {
return global_func_table_.wifi_enable_firmware_roaming(wlan_interface_handle_,
state);
}
-wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
- wifi_roaming_config config_internal = config;
- return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
- &config_internal);
+wifi_error WifiLegacyHal::configureNdOffload(bool enable) {
+ return global_func_table_.wifi_configure_nd_offload(wlan_interface_handle_,
+ enable);
+}
+
+wifi_error WifiLegacyHal::startSendingOffloadedPacket(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms) {
+ std::vector<uint8_t> ip_packet_data_internal(ip_packet_data);
+ std::vector<uint8_t> src_address_internal(
+ src_address.data(), src_address.data() + src_address.size());
+ std::vector<uint8_t> dst_address_internal(
+ dst_address.data(), dst_address.data() + dst_address.size());
+ return global_func_table_.wifi_start_sending_offloaded_packet(
+ cmd_id,
+ wlan_interface_handle_,
+ ip_packet_data_internal.data(),
+ ip_packet_data_internal.size(),
+ src_address_internal.data(),
+ dst_address_internal.data(),
+ period_in_ms);
+}
+
+wifi_error WifiLegacyHal::stopSendingOffloadedPacket(uint32_t cmd_id) {
+ return global_func_table_.wifi_stop_sending_offloaded_packet(
+ cmd_id, wlan_interface_handle_);
}
std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index b585314..a3ac075 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -182,8 +182,16 @@
on_threshold_breached_callback);
wifi_error stopRssiMonitoring(wifi_request_id id);
std::pair<wifi_error, wifi_roaming_capabilities> getRoamingCapabilities();
- wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
wifi_error configureRoaming(const wifi_roaming_config& config);
+ wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
+ wifi_error configureNdOffload(bool enable);
+ wifi_error startSendingOffloadedPacket(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms);
+ wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
// Logger/debug functions.
std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
wifi_error startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index e48978e..a00c5bc 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -212,6 +212,44 @@
state);
}
+Return<void> WifiStaIface::enableNdOffload(bool enable,
+ enableNdOffload_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::enableNdOffloadInternal,
+ hidl_status_cb,
+ enable);
+}
+
+Return<void> WifiStaIface::startSendingKeepAlivePackets(
+ uint32_t cmd_id,
+ const hidl_vec<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const hidl_array<uint8_t, 6>& src_address,
+ const hidl_array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms,
+ startSendingKeepAlivePackets_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::startSendingKeepAlivePacketsInternal,
+ hidl_status_cb,
+ cmd_id,
+ ip_packet_data,
+ ether_type,
+ src_address,
+ dst_address,
+ period_in_ms);
+}
+
+Return<void> WifiStaIface::stopSendingKeepAlivePackets(
+ uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::stopSendingKeepAlivePacketsInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
Return<void> WifiStaIface::startDebugPacketFateMonitoring(
startDebugPacketFateMonitoring_cb hidl_status_cb) {
return validateAndCall(this,
@@ -498,6 +536,31 @@
return createWifiStatusFromLegacyError(legacy_status);
}
+WifiStatus WifiStaIface::enableNdOffloadInternal(bool enable) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->configureNdOffload(enable);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::startSendingKeepAlivePacketsInternal(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ uint16_t /* ether_type */,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->startSendingOffloadedPacket(
+ cmd_id, ip_packet_data, src_address, dst_address, period_in_ms);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(uint32_t cmd_id) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->stopSendingOffloadedPacket(cmd_id);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() {
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h
index 90126cd..311c991 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.0/default/wifi_sta_iface.h
@@ -83,6 +83,18 @@
configureRoaming_cb hidl_status_cb) override;
Return<void> setRoamingState(StaRoamingState state,
setRoamingState_cb hidl_status_cb) override;
+ Return<void> enableNdOffload(bool enable,
+ enableNdOffload_cb hidl_status_cb) override;
+ Return<void> startSendingKeepAlivePackets(
+ uint32_t cmd_id,
+ const hidl_vec<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const hidl_array<uint8_t, 6>& src_address,
+ const hidl_array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms,
+ startSendingKeepAlivePackets_cb hidl_status_cb) override;
+ Return<void> stopSendingKeepAlivePackets(
+ uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) override;
Return<void> startDebugPacketFateMonitoring(
startDebugPacketFateMonitoring_cb hidl_status_cb) override;
Return<void> stopDebugPacketFateMonitoring(
@@ -121,6 +133,15 @@
getRoamingCapabilitiesInternal();
WifiStatus configureRoamingInternal(const StaRoamingConfig& config);
WifiStatus setRoamingStateInternal(StaRoamingState state);
+ WifiStatus enableNdOffloadInternal(bool enable);
+ WifiStatus startSendingKeepAlivePacketsInternal(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms);
+ WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id);
WifiStatus startDebugPacketFateMonitoringInternal();
WifiStatus stopDebugPacketFateMonitoringInternal();
std::pair<WifiStatus, std::vector<WifiDebugTxPacketFateReport>>
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
index 0fa19c8..ddf05cc 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -261,12 +261,12 @@
/**
* Set up a P2P group owner manually (i.e., without group owner
* negotiation with a specific peer). This is also known as autonomous
- * group owner. Optional |persistent| may be used to specify restart of a
- * persistent group.
+ * group owner. Optional |persistentNetworkId| may be used to specify
+ * restart of a persistent group.
*
* @param persistent Used to request a persistent group to be formed.
* @param persistentNetworkId Used to specify the restart of a persistent
- * group.
+ * group. Set to UINT32_MAX for a non-persistent group.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
@@ -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();
};