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

Commit 24f2a6f9 authored by Ashutosh Joshi's avatar Ashutosh Joshi Committed by Android (Google) Code Review
Browse files

Merge "Add an uncalibrated acclerometer sensor type."

parents 836320ff e33eb928
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -13991,6 +13991,7 @@ package android.hardware {
    field public static final int REPORTING_MODE_ON_CHANGE = 1; // 0x1
    field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER_UNCALIBRATED = "android.sensor.accelerometer_uncalibrated";
    field public static final java.lang.String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
    field public static final java.lang.String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
    field public static final java.lang.String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR = "android.sensor.geomagnetic_rotation_vector";
@@ -14016,6 +14017,7 @@ package android.hardware {
    field public static final java.lang.String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
    field public static final deprecated java.lang.String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
    field public static final int TYPE_ACCELEROMETER = 1; // 0x1
    field public static final int TYPE_ACCELEROMETER_UNCALIBRATED = 35; // 0x23
    field public static final int TYPE_ALL = -1; // 0xffffffff
    field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd
    field public static final int TYPE_DEVICE_PRIVATE_BASE = 65536; // 0x10000
+2 −0
Original line number Diff line number Diff line
@@ -14497,6 +14497,7 @@ package android.hardware {
    field public static final int REPORTING_MODE_ON_CHANGE = 1; // 0x1
    field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER_UNCALIBRATED = "android.sensor.accelerometer_uncalibrated";
    field public static final java.lang.String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
    field public static final java.lang.String STRING_TYPE_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta";
    field public static final java.lang.String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
@@ -14524,6 +14525,7 @@ package android.hardware {
    field public static final deprecated java.lang.String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
    field public static final java.lang.String STRING_TYPE_WRIST_TILT_GESTURE = "android.sensor.wrist_tilt_gesture";
    field public static final int TYPE_ACCELEROMETER = 1; // 0x1
    field public static final int TYPE_ACCELEROMETER_UNCALIBRATED = 35; // 0x23
    field public static final int TYPE_ALL = -1; // 0xffffffff
    field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd
    field public static final int TYPE_DEVICE_PRIVATE_BASE = 65536; // 0x10000
+2 −0
Original line number Diff line number Diff line
@@ -14022,6 +14022,7 @@ package android.hardware {
    field public static final int REPORTING_MODE_ON_CHANGE = 1; // 0x1
    field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER_UNCALIBRATED = "android.sensor.accelerometer_uncalibrated";
    field public static final java.lang.String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
    field public static final java.lang.String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
    field public static final java.lang.String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR = "android.sensor.geomagnetic_rotation_vector";
@@ -14047,6 +14048,7 @@ package android.hardware {
    field public static final java.lang.String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
    field public static final deprecated java.lang.String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
    field public static final int TYPE_ACCELEROMETER = 1; // 0x1
    field public static final int TYPE_ACCELEROMETER_UNCALIBRATED = 35; // 0x23
    field public static final int TYPE_ALL = -1; // 0xffffffff
    field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd
    field public static final int TYPE_DEVICE_PRIVATE_BASE = 65536; // 0x10000
+31 −0
Original line number Diff line number Diff line
@@ -644,6 +644,31 @@ public final class Sensor {
    public static final String STRING_TYPE_DYNAMIC_SENSOR_META =
            "android.sensor.dynamic_sensor_meta";

    /* TYPE_ADDITIONAL_INFO - defined as type 33 in the HAL is not exposed to
     * applications. There are parts of the framework that require the sensors
     * to be in the same order as the HAL. Skipping this sensor
     */

    /* TYPE_LOW_LATENCY_OFF_BODY_SENSOR - defined as type 34 in the HAL needs to
     * be defined in this space.
     */

    /**
     * A constant describing an uncalibrated accelerometer sensor.
     *
     * See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
     *
     */
    public static final int TYPE_ACCELEROMETER_UNCALIBRATED = 35;

    /**
     * A constant string describing an uncalibrated accelerometer sensor.
     *
     * @see #TYPE_ACCELEROMETER_UNCALIBRATED
     *
     */
    public static final String STRING_TYPE_ACCELEROMETER_UNCALIBRATED =
            "android.sensor.accelerometer_uncalibrated";
    /**
     * A constant describing all sensor types.
     */
@@ -752,6 +777,9 @@ public final class Sensor {
            1, // SENSOR_TYPE_MOTION_DETECT
            1, // SENSOR_TYPE_HEART_BEAT
            2, // SENSOR_TYPE_DYNAMIC_SENSOR_META
            16,// skip over additional sensor info type
            1, // reserving for LLOB sensor type
            6, // SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
    };

    /**
@@ -1123,6 +1151,9 @@ public final class Sensor {
            case TYPE_DYNAMIC_SENSOR_META:
                mStringType = STRING_TYPE_DYNAMIC_SENSOR_META;
                return true;
            case TYPE_ACCELEROMETER_UNCALIBRATED:
                mStringType = STRING_TYPE_ACCELEROMETER_UNCALIBRATED;
                return true;
            default:
                return false;
        }
+27 −0
Original line number Diff line number Diff line
@@ -578,6 +578,33 @@ public class SensorEvent {
     * A confidence value of 1.0 indicates complete certainly - that a peak is
     * completely unlikely to be anywhere else on the QRS complex.
     * </p>
     *
     * <h4>{@link android.hardware.Sensor#TYPE_ACCELEROMETER_UNCALIBRATED
     * Sensor.TYPE_ACCELEROMETER_UNCALIBRATED}:</h4> All values are in SI
     * units (m/s^2)
     *
     * Similar to {@link android.hardware.Sensor#TYPE_ACCELEROMETER},
     * Factory calibration and temperature compensation will still be applied
     * to the "uncalibrated" measurement.
     *
     * <p>
     * The values array is shown below:
     * <ul>
     * <li> values[0] = x_uncalib without bias compensation </li>
     * <li> values[1] = y_uncalib without bias compensation </li>
     * <li> values[2] = z_uncalib without bias compensation </li>
     * <li> values[3] = estimated x_bias </li>
     * <li> values[4] = estimated y_bias </li>
     * <li> values[5] = estimated z_bias </li>
     * </ul>
     * </p>
     * <p>
     * x_uncalib, y_uncalib, z_uncalib are the measured acceleration in X, Y, Z
     * axes similar to the  {@link android.hardware.Sensor#TYPE_ACCELEROMETER},
     * without any bias correction (factory bias compensation and any
     * temperature compensation is allowed).
     * x_bias, y_bias, z_bias are the estimated biases.
     * </p>
     */
    public final float[] values;