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

Commit 3e244be4 authored by Anh Pham's avatar Anh Pham Committed by Android (Google) Code Review
Browse files

Merge "Update API doc w/ high-rate permission requirement" into sc-dev

parents 72c30b0a 629ba495
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -848,8 +848,10 @@ public final class Sensor {
    /**
     * Get the highest supported direct report mode rate level of the sensor.
     *
     * @return Highest direct report rate level of this sensor. If the sensor does not support
     * direct report mode, this returns {@link SensorDirectChannel#RATE_STOP}.
     * @return Highest direct report rate level of this sensor. Note that if the app does not have
     * the {@link android.Manifest.permission#HIGH_SAMPLING_RATE_SENSORS} permission, the highest
     * direct report rate level is {@link SensorDirectChannel#RATE_NORMAL}. If the sensor
     * does not support direct report mode, this returns {@link SensorDirectChannel#RATE_STOP}.
     * @see SensorDirectChannel#RATE_STOP
     * @see SensorDirectChannel#RATE_NORMAL
     * @see SensorDirectChannel#RATE_FAST
@@ -1002,9 +1004,11 @@ public final class Sensor {
    }

    /**
     * @return the minimum delay allowed between two events in microsecond
     * @return the minimum delay allowed between two events in microseconds
     * or zero if this sensor only returns a value when the data it's measuring
     * changes.
     * changes. Note that if the app does not have the
     * {@link android.Manifest.permission#HIGH_SAMPLING_RATE_SENSORS} permission, the
     * minimum delay is capped at 5000 microseconds (200 Hz).
     */
    public int getMinDelay() {
        return mMinDelay;
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,13 @@ import java.util.List;
 * at {@link TriggerEventListener}. {@link Sensor#TYPE_SIGNIFICANT_MOTION}
 * is an example of a trigger sensor.
 * </p>
 * <p>
 * In order to access sensor data at high sampling rates (i.e. greater than 200 Hz
 * for {@link SensorEventListener} and greater than {@link SensorDirectChannel#RATE_NORMAL}
 * for {@link SensorDirectChannel}), apps must declare
 * the {@link android.Manifest.permission#HIGH_SAMPLING_RATE_SENSORS} permission
 * in their AndroidManifest.xml file.
 * </p>
 * <pre class="prettyprint">
 * public class SensorActivity extends Activity implements SensorEventListener {
 *     private final SensorManager mSensorManager;