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

Commit 4115c518 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Add documentation for proximity and light sensors.



Change-Id: I116424c468d1d3afe89e0e17be773ee8b80ada92
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 8637759a
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -46,13 +46,21 @@ public class Sensor {

    /** A constant describing a gyroscope sensor type */
    public static final int TYPE_GYROSCOPE      = 4;
    /** A constant describing a light sensor type */
    /**
     * A constant describing an light sensor type.
     * See {@link android.hardware.SensorEvent SensorEvent}
     * for more details.
     */
    public static final int TYPE_LIGHT          = 5;
    /** A constant describing a pressure sensor type */
    public static final int TYPE_PRESSURE       = 6;
    /** A constant describing a temperature sensor type */
    public static final int TYPE_TEMPERATURE    = 7;
    /** A constant describing a proximity sensor type */
    /**
     * A constant describing an proximity sensor type.
     * See {@link android.hardware.SensorEvent SensorEvent}
     * for more details.
     */
    public static final int TYPE_PROXIMITY      = 8;

    
+13 −2
Original line number Diff line number Diff line
@@ -116,6 +116,17 @@ public class SensorEvent {
     *  All values are in micro-Tesla (uT) and measure the ambient magnetic
     *  field in the X, Y and Z axis.
     *
     * <p>{@link android.hardware.Sensor#TYPE_LIGHT Sensor.TYPE_LIGHT}:<p>
     *
     *  <p>values[0]: Ambient light level in SI lux units
     *
     * <p>{@link android.hardware.Sensor#TYPE_PROXIMITY Sensor.TYPE_PROXIMITY}:<p>
     *
     *  <p>values[0]: Proximity sensor distance measured in centimeters
     *
     *  <p> Note that some proximity sensors only support a binary "close" or "far" measurement.
     *   In this case, the sensor should report its maxRange value in the "far" state and a value
     *   less than maxRange in the "near" state.
     */
    public final float[] values;