From 373eca430109b16c12cdd8b95434ad9a58220e1b Mon Sep 17 00:00:00 2001 From: Anthony Stange Date: Wed, 27 May 2020 16:02:16 -0400 Subject: [PATCH] Ensure Java code verifies hinge angle sensor is wakeup Previously, only the NDK enforced the default sensor type was wakeup and if an app called the Java APIs it'd get a null value if there was only a wakeup version of the hinge sensor. Bug: 157581504 Test: Run on emulator and verify that getDefaultSensor returns the sensor instance Change-Id: Ica13c70a456780891f366394848e4c649f6ea70b --- core/java/android/hardware/SensorManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index 6bf754f6935e3..0a76a9c6bee35 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -498,7 +498,7 @@ public abstract class SensorManager { || type == Sensor.TYPE_TILT_DETECTOR || type == Sensor.TYPE_WAKE_GESTURE || type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE || type == Sensor.TYPE_WRIST_TILT_GESTURE - || type == Sensor.TYPE_DYNAMIC_SENSOR_META) { + || type == Sensor.TYPE_DYNAMIC_SENSOR_META || type == Sensor.TYPE_HINGE_ANGLE) { wakeUpSensor = true; }