Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a05294a authored by Eva Chen's avatar Eva Chen
Browse files

Add limited axes imu sensor type definitions.

Includes changes for the following sensors:
- ACCELEROMETER_LIMITED_AXES
- GYROSCOPE_LIMITED_AXES
- ACCELEROMETER_LIMITED_AXES_UNCALIBRATED
- GYROSCOPE_LIMITED_AXES_UNCALIBRATED

These new sensor types will help support varying sensor configurations
for automotive devices.

Bug: 187342209
Test: Compile only. Will be validated with other CLs.
Change-Id: I3f01eb74c26ab58c051a58c4b5f1dfd90d7e853c
parent 94da2bcc
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ parcelable Event {
    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 @@ parcelable Event {
      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;
+4 −0
Original line number Diff line number Diff line
@@ -71,5 +71,9 @@ enum SensorType {
  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,
}
+76 −0
Original line number Diff line number Diff line
@@ -132,6 +132,18 @@ parcelable Event {
         */
        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 @@ parcelable Event {
            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 {
+36 −0
Original line number Diff line number Diff line
@@ -666,6 +666,42 @@ enum SensorType {
     */
    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.