Merge "Support subscribe/unsubscribe in VHAL."
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
index 41bc9ae..d998478 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
@@ -39,4 +39,6 @@
WIFI_SCANNING = 3,
AIRPLANE_MODE = 4,
MICROPHONE = 5,
+ BT_MAIN = 6,
+ BT_SCANNING = 7,
}
diff --git a/contexthub/aidl/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/android/hardware/contexthub/Setting.aidl
index f2e55db..91d4c3f 100644
--- a/contexthub/aidl/android/hardware/contexthub/Setting.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/Setting.aidl
@@ -39,4 +39,12 @@
* by CHRE.
*/
MICROPHONE,
+ /**
+ * The main BT toggle in the Android settings for BT connectivity.
+ */
+ BT_MAIN,
+ /**
+ * The "BT scanning" setting for location scans.
+ */
+ BT_SCANNING,
}
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index a47f64e..f0583be 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -300,6 +300,14 @@
testSettingChanged(Setting::MICROPHONE);
}
+TEST_P(ContextHubAidl, TestOnBtMainSettingChanged) {
+ testSettingChanged(Setting::BT_MAIN);
+}
+
+TEST_P(ContextHubAidl, TestOnBtScanningSettingChanged) {
+ testSettingChanged(Setting::BT_SCANNING);
+}
+
std::vector<std::tuple<std::string, int32_t>> generateContextHubMapping() {
std::vector<std::tuple<std::string, int32_t>> tuples;
auto contextHubAidlNames = android::getAidlHalInstanceNames(IContextHub::descriptor);
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
index c92ab1a..763cb8e 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
@@ -52,6 +52,8 @@
android.hardware.sensors.AdditionalInfo additional;
android.hardware.sensors.Event.EventPayload.Data data;
android.hardware.sensors.Event.EventPayload.HeadTracker headTracker;
+ android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu;
+ android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal;
@FixedSize @VintfStability
parcelable Vec4 {
float x;
@@ -86,6 +88,27 @@
int discontinuityCount;
}
@FixedSize @VintfStability
+ parcelable LimitedAxesImu {
+ float x;
+ float y;
+ float z;
+ float xSupported;
+ float ySupported;
+ float zSupported;
+ }
+ @FixedSize @VintfStability
+ parcelable LimitedAxesImuUncal {
+ float x;
+ float y;
+ float z;
+ float xBias;
+ float yBias;
+ float zBias;
+ float xSupported;
+ float ySupported;
+ float zSupported;
+ }
+ @FixedSize @VintfStability
parcelable HeartRate {
float bpm;
android.hardware.sensors.SensorStatus status;
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
index 3d7ab45..896617b 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
@@ -71,5 +71,9 @@
ACCELEROMETER_UNCALIBRATED = 35,
HINGE_ANGLE = 36,
HEAD_TRACKER = 37,
+ ACCELEROMETER_LIMITED_AXES = 38,
+ GYROSCOPE_LIMITED_AXES = 39,
+ ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40,
+ GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41,
DEVICE_PRIVATE_BASE = 65536,
}
diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl
index fd6a8cc..8b7e409 100644
--- a/sensors/aidl/android/hardware/sensors/Event.aidl
+++ b/sensors/aidl/android/hardware/sensors/Event.aidl
@@ -132,6 +132,18 @@
*/
HeadTracker headTracker;
+ /**
+ * SensorType::ACCELEROMETER_LIMITED_AXES
+ * SensorType::GYROSCOPE_LIMITED_AXES
+ */
+ LimitedAxesImu limitedAxesImu;
+
+ /**
+ * SensorType::ACCELEROMETER_LIMITED_AXES_UNCALIBRATED
+ * SensorType::GYROSCOPE_LIMITED_AXES_UNCALIBRATED
+ */
+ LimitedAxesImuUncal limitedAxesImuUncal;
+
@FixedSize
@VintfStability
parcelable Vec4 {
@@ -201,6 +213,70 @@
int discontinuityCount;
}
+ /**
+ * Payload of the ACCELEROMETER_LIMITED_AXES and GYROSCOPE_LIMITED_AXES
+ * sensor types.
+ */
+ @FixedSize
+ @VintfStability
+ parcelable LimitedAxesImu {
+ /**
+ * Acceleration or angular speed values. If certain axes are not
+ * supported, the associated value must be set to 0.
+ */
+ float x;
+ float y;
+ float z;
+
+ /**
+ * Limited axes sensors must not be supported for all three axes.
+ * These values indicate which axes are supported with a 1.0 for
+ * supported, and a 0 for not supported. The supported axes should
+ * be determined at build time and these values must not change
+ * during runtime.
+ */
+ float xSupported;
+ float ySupported;
+ float zSupported;
+ }
+
+ /**
+ * Payload of the ACCELEROMETER_LIMITED_AXES_UNCALIBRATED and
+ * GYROSCOPE_LIMITED_AXES_UNCALIBRATED sensor types.
+ */
+ @FixedSize
+ @VintfStability
+ parcelable LimitedAxesImuUncal {
+ /**
+ * Acceleration (without bias compensation) or angular (speed
+ * (without drift compensation) values. If certain axes are not
+ * supported, the associated value must be set to 0.
+ */
+ float x;
+ float y;
+ float z;
+
+ /**
+ * Estimated bias values for uncalibrated accelerometer or
+ * estimated drift values for uncalibrated gyroscope. If certain
+ * axes are not supported, the associated value must be set to 0.
+ */
+ float xBias;
+ float yBias;
+ float zBias;
+
+ /**
+ * Limited axes sensors must not be supported for all three axes.
+ * These values indicate which axes are supported with a 1.0 for
+ * supported, and a 0 for not supported. The supported axes should
+ * be determined at build time and these values must not change
+ * during runtime.
+ */
+ float xSupported;
+ float ySupported;
+ float zSupported;
+ }
+
@FixedSize
@VintfStability
parcelable HeartRate {
diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl
index 01e6bee..000728c 100644
--- a/sensors/aidl/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl
@@ -667,6 +667,42 @@
HEAD_TRACKER = 37,
/**
+ * ACCELEROMETER_LIMITED_AXES
+ * reporting-mode: continuous
+ *
+ * Equivalent to ACCELEROMETER, but supporting cases where one or two axes
+ * are not supported.
+ */
+ ACCELEROMETER_LIMITED_AXES = 38,
+
+ /**
+ * GYROSCOPE_LIMITED_AXES
+ * reporting-mode: continuous
+ *
+ * Equivalent to GYROSCOPE, but supporting cases where one or two axes are
+ * not supported.
+ */
+ GYROSCOPE_LIMITED_AXES = 39,
+
+ /**
+ * ACCELEROMETER_LIMITED_AXES_UNCALIBRATED
+ * reporting-mode: continuous
+ *
+ * Equivalent to ACCELEROMETER_UNCALIBRATED, but supporting cases where one
+ * or two axes are not supported.
+ */
+ ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40,
+
+ /**
+ * GYROSCOPE_LIMITED_AXES_UNCALIBRATED
+ * reporting-mode: continuous
+ *
+ * Equivalent to GYROSCOPE_UNCALIBRATED, but supporting cases where one or
+ * two axes are not supported.
+ */
+ GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41,
+
+ /**
* Base for device manufacturers private sensor types.
* These sensor types can't be exposed in the SDK.
*/