diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2015-02-11 00:39:14 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-02-11 00:39:14 +0000 |
commit | 668ebe950143c76936685378fb0ae9b682ab24f5 (patch) | |
tree | c743978d5615c25989f07ffbdb6b2e11987e4afa /core/java/android/hardware | |
parent | 9408ce362e6c01656f280696af3aabd190d53356 (diff) | |
parent | 5ff571155f0a405d6f7d298c7acaddc84bb8fb26 (diff) | |
download | frameworks_base-668ebe950143c76936685378fb0ae9b682ab24f5.zip frameworks_base-668ebe950143c76936685378fb0ae9b682ab24f5.tar.gz frameworks_base-668ebe950143c76936685378fb0ae9b682ab24f5.tar.bz2 |
am d0d13d82: Merge "Update API to contain new wrist tilt sensor type and string." into lmp-mr1-modular-dev
automerge: 5ff5711
* commit '5ff571155f0a405d6f7d298c7acaddc84bb8fb26':
Update API to contain new wrist tilt sensor type and string.
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r-- | core/java/android/hardware/Sensor.java | 23 | ||||
-rw-r--r-- | core/java/android/hardware/SensorManager.java | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java index cf6a779..fa5e9d2 100644 --- a/core/java/android/hardware/Sensor.java +++ b/core/java/android/hardware/Sensor.java @@ -18,6 +18,7 @@ package android.hardware; import android.os.Build; +import android.annotation.SystemApi; /** * Class representing a sensor. Use {@link SensorManager#getSensorList} to get @@ -511,6 +512,27 @@ public final class Sensor { */ public static final String STRING_TYPE_PICK_UP_GESTURE = "android.sensor.pick_up_gesture"; + /** + * A constant describing a wrist tilt gesture sensor. + * + * A sensor of this type triggers when the device face is tilted towards the user. + * The only allowed return value is 1.0. + * This sensor remains active until disabled. + * + * @hide This sensor is expected to only be used by the system ui + */ + @SystemApi + public static final int TYPE_WRIST_TILT_GESTURE = 26; + + /** + * A constant string describing a wrist tilt gesture sensor. + * + * @hide This sensor is expected to only be used by the system ui + * @see #TYPE_WRIST_TILT_GESTURE + */ + @SystemApi + public static final String STRING_TYPE_WRIST_TILT_GESTURE = "android.sensor.wrist_tilt_gesture"; + /** * A constant describing all sensor types. */ @@ -591,6 +613,7 @@ public final class Sensor { 1, // SENSOR_TYPE_WAKE_GESTURE 1, // SENSOR_TYPE_GLANCE_GESTURE 1, // SENSOR_TYPE_PICK_UP_GESTURE + 1, // SENSOR_TYPE_WRIST_TILT_GESTURE }; /** diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index e4e5a8c..34b895b 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -451,7 +451,8 @@ public abstract class SensorManager { // non_wake-up version. if (type == Sensor.TYPE_PROXIMITY || type == Sensor.TYPE_SIGNIFICANT_MOTION || type == Sensor.TYPE_TILT_DETECTOR || type == Sensor.TYPE_WAKE_GESTURE || - type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE) { + type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE || + type == Sensor.TYPE_WRIST_TILT_GESTURE) { wakeUpSensor = true; } |