SensorEvent.java revision 0f791a799dc81d93935fd2597297cf7ac2c0a044
19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you may not use this file except in compliance with the License.
69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * You may obtain a copy of the License at
79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * See the License for the specific language governing permissions and
149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * limitations under the License.
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.hardware;
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/**
2074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <p>
2174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * This class represents a {@link android.hardware.Sensor Sensor} event and
2274cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * holds informations such as the sensor's type, the time-stamp, accuracy and of
2374cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * course the sensor's {@link SensorEvent#values data}.
2474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * </p>
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
2674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <p>
2774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <u>Definition of the coordinate system used by the SensorEvent API.</u>
2874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * </p>
2974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian *
3074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <p>
310f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * The coordinate-system is defined relative to the screen of the phone in its
3274cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * default orientation. The axes are not swapped when the device's screen
3374cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * orientation changes.
3474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * </p>
3574cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian *
3674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <p>
370f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * The X axis is horizontal and points to the right, the Y axis is vertical and
380f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * points up and the Z axis points towards the outside of the front face of the
390f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * screen. In this system, coordinates behind the screen have negative Z values.
400f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * </p>
410f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian *
420f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * <p>
430f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * <center><img src="../../../images/axis_device.png"
440f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * alt="Sensors coordinate-system diagram." border="0" /></center>
4574cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * </p>
4674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian *
4774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * <p>
489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <b>Note:</b> This coordinate system is different from the one used in the
4974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * Android 2D APIs where the origin is in the top-left corner.
5074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian * </p>
519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
520f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * @see SensorManager
530f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * @see SensorEvent
540f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian * @see Sensor
559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class SensorEvent {
599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
6074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
610f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * The length and contents of the {@link #values values} array depends on
620f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * which {@link android.hardware.Sensor sensor} type is being monitored (see
630f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * also {@link SensorEvent} for a definition of the coordinate system used).
6474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * </p>
6574cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     *
660f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <h4>{@link android.hardware.Sensor#TYPE_ACCELEROMETER
670f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * Sensor.TYPE_ACCELEROMETER}:</h4> All values are in SI units (m/s^2)
680f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
6974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <ul>
7074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
710f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[0]: Acceleration minus Gx on the x-axis
720f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
7374cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
740f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[1]: Acceleration minus Gy on the y-axis
750f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
7674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
770f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[2]: Acceleration minus Gz on the z-axis
780f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
7974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * </ul>
800f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
8174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
820f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * A sensor of this type measures the acceleration applied to the device
830f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * (<b>Ad</b>). Conceptually, it does so by measuring forces applied to the
840f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * sensor itself (<b>Fs</b>) using the relation:
850f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
860f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
870f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b><center>Ad = - �Fs / mass</center></b>
880f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
8974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
900f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * In particular, the force of gravity is always influencing the measured
910f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * acceleration:
920f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
930f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
940f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b><center>Ad = -g - �F / mass</center></b>
950f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
9674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
970f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * For this reason, when the device is sitting on a table (and obviously not
980f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * accelerating), the accelerometer reads a magnitude of <b>g</b> = 9.81
990f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * m/s^2
1000f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1010f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
10274cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
1030f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * Similarly, when the device is in free-fall and therefore dangerously
1040f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * accelerating towards to ground at 9.81 m/s^2, its accelerometer reads a
1050f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * magnitude of 0 m/s^2.
1060f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1070f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
10874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
1090f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * It should be apparent that in order to measure the real acceleration of
1100f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * the device, the contribution of the force of gravity must be eliminated.
1110f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * This can be achieved by applying a <i>high-pass</i> filter. Conversely, a
1120f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <i>low-pass</i> filter can be used to isolate the force of gravity.
1130f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
11474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
11574cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <u>Examples</u>:
11674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <ul>
11774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <li>When the device lies flat on a table and is pushed on its left side
11874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * toward the right, the x acceleration value is positive.</li>
1190f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
12074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <li>When the device lies flat on a table, the acceleration value is
12174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * +9.81, which correspond to the acceleration of the device (0 m/s^2) minus
12274cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * the force of gravity (-9.81 m/s^2).</li>
1230f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
12474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <li>When the device lies flat on a table and is pushed toward the sky
12574cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * with an acceleration of A m/s^2, the acceleration value is equal to
12674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * A+9.81 which correspond to the acceleration of the device (+A m/s^2)
12774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * minus the force of gravity (-9.81 m/s^2).</li>
12874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * </ul>
1290f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1300f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1310f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <h4>{@link android.hardware.Sensor#TYPE_MAGNETIC_FIELD
1320f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * Sensor.TYPE_MAGNETIC_FIELD}:</h4>
13374cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * All values are in micro-Tesla (uT) and measure the ambient magnetic field
13474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * in the X, Y and Z axis.
1350f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1360f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <h4>{@link android.hardware.Sensor#TYPE_LIGHT Sensor.TYPE_LIGHT}:</h4>
1370f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
13874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <ul>
13974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
14074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * values[0]: Ambient light level in SI lux units
14174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * </ul>
1420f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1430f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <h4>{@link android.hardware.Sensor#TYPE_PROXIMITY Sensor.TYPE_PROXIMITY}:
1440f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </h4>
1450f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
14674cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <ul>
14774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
14874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * values[0]: Proximity sensor distance measured in centimeters
14974cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * </ul>
1500f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
15174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * <p>
1520f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b>Note:</b> Some proximity sensors only support a binary <i>near</i> or
1530f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <i>far</i> measurement. In this case, the sensor should report its
1540f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * {@link android.hardware.Sensor#getMaximumRange() maximum range} value in
1550f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * the <i>far</i> state and a lesser value in the <i>near</i> state.
1560f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1570f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1580f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <h4>{@link android.hardware.Sensor#TYPE_ORIENTATION
1590f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * Sensor.TYPE_ORIENTATION}:</h4> All values are angles in degrees.
1600f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1610f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <ul>
1620f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1630f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[0]: Azimuth, angle between the magnetic north direction and the
1640f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * y-axis, around the z-axis (0 to 359). 0=North, 90=East, 180=South,
1650f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * 270=West
1660f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1670f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1680f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1690f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[1]: Pitch, rotation around x-axis (-180 to 180), with positive
1700f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values when the z-axis moves <b>toward</b> the y-axis.
1710f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1720f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1730f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1740f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * values[2]: Roll, rotation around y-axis (-90 to 90), with positive values
1750f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * when the x-axis moves <b>toward</b> the z-axis.
1760f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1770f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </ul>
1780f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1790f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1800f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b>Note:</b> This definition is different from <b>yaw, pitch and roll</b>
1810f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * used in aviation where the X axis is along the long side of the plane
1820f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * (tail to nose).
1830f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1840f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1850f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1860f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b>Note:</b> This sensor type exists for legacy reasons, please use
1870f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * {@link android.hardware.SensorManager#getRotationMatrix
1880f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * getRotationMatrix()} in conjunction with
1890f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * {@link android.hardware.SensorManager#remapCoordinateSystem
1900f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * remapCoordinateSystem()} and
1910f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * {@link android.hardware.SensorManager#getOrientation getOrientation()} to
1920f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * compute these values instead.
1930f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
1940f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
1950f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <p>
1960f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * <b>Important note:</b> For historical reasons the roll angle is positive
1970f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * in the clockwise direction (mathematically speaking, it should be
1980f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * positive in the counter-clockwise direction).
1990f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * </p>
2000f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     *
2010f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * @see SensorEvent
2020f791a799dc81d93935fd2597297cf7ac2c0a044Mathias Agopian     * @see GeomagneticField
2034115c518753052add46b017bb3044da6f6169a7bMike Lockwood     */
2049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public final float[] values;
2059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
2069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
20774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * The sensor that generated this event. See
20874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * {@link android.hardware.SensorManager SensorManager} for details.
2099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
21074cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian   public Sensor sensor;
21174cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian
2129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
21374cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * The accuracy of this event. See {@link android.hardware.SensorManager
21474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian     * SensorManager} for details.
2159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
2169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int accuracy;
21774cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian
21874cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian
2199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
2209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * The time in nanosecond at which the event happened
2219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
2229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public long timestamp;
2239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
22474cde2cee9e53006a710f4e80700cd560c2d0e4dMathias Agopian
2259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    SensorEvent(int size) {
2269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        values = new float[size];
2279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
2289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}
229