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

Commit acba3016 authored by Eva Chen's avatar Eva Chen Committed by Android (Google) Code Review
Browse files

Merge "Add TYPE_HEADING sensor type definitions."

parents d8bfccdc a81deb0f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ parcelable Event {
    android.hardware.sensors.Event.EventPayload.HeadTracker headTracker;
    android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu;
    android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal;
    android.hardware.sensors.Event.EventPayload.Heading heading;
    @FixedSize @VintfStability
    parcelable Vec4 {
      float x;
@@ -114,6 +115,11 @@ parcelable Event {
      android.hardware.sensors.SensorStatus status;
    }
    @FixedSize @VintfStability
    parcelable Heading {
      float heading;
      float accuracy;
    }
    @FixedSize @VintfStability
    parcelable MetaData {
      android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what;
      @Backing(type="int") @VintfStability
+1 −0
Original line number Diff line number Diff line
@@ -75,5 +75,6 @@ enum SensorType {
  GYROSCOPE_LIMITED_AXES = 39,
  ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40,
  GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41,
  HEADING = 42,
  DEVICE_PRIVATE_BASE = 65536,
}
+26 −0
Original line number Diff line number Diff line
@@ -144,6 +144,11 @@ parcelable Event {
         */
        LimitedAxesImuUncal limitedAxesImuUncal;

        /**
         * SensorType::HEADING
         */
        Heading heading;

        @FixedSize
        @VintfStability
        parcelable Vec4 {
@@ -292,6 +297,27 @@ parcelable Event {
            SensorStatus status;
        }

        @FixedSize
        @VintfStability
        parcelable Heading {
            /**
             * The direction in which the device is pointing relative to true
             * north in degrees. The value must be between 0.0 (inclusive) and
             * 360.0 (exclusive), with 0 indicating north, 90 east, 180 south,
             * and 270 west.
             */
            float heading;
            /**
             * Accuracy is defined at 68% confidence. In the case where the
             * underlying distribution is assumed Gaussian normal, this would be
             * considered one standard deviation. For example, if the heading
             * returns 60 degrees, and accuracy returns 10 degrees, then there
             * is a 68 percent probability of the true heading being between 50
             * degrees and 70 degrees.
             */
            float accuracy;
        }

        @FixedSize
        @VintfStability
        parcelable MetaData {
+15 −0
Original line number Diff line number Diff line
@@ -702,6 +702,21 @@ enum SensorType {
     */
    GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41,

    /**
     * HEADING
     * reporting-mode: continuous
     *
     * A sensor of this type measures the direction in which the device is
     * pointing relative to true north in degrees.
     *
     * This sensor was added for automotive form factors. Other devices with a
     * clear forward direction might find it useful as well. However, devices
     * with a more ambiguous orientation such as phones or wearables might want
     * to consider using other sensors such as Sensor.TYPE_ROTATION_VECTOR
     * which might be more suitable.
     */
    HEADING = 42,

    /**
     * Base for device manufacturers private sensor types.
     * These sensor types can't be exposed in the SDK.