From edb5242355023c6f16d46be32bdfef8471f88890 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Tue, 16 Apr 2013 11:10:05 -0700 Subject: [PATCH] Fix wrong index value. Rotation vector was at the wrong index value. b/8165631 Change-Id: I50662befabf80393965c94a0335359019b98eb85 --- core/java/android/hardware/Sensor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java index 074f8fed6876e..71a538268a735 100644 --- a/core/java/android/hardware/Sensor.java +++ b/core/java/android/hardware/Sensor.java @@ -188,6 +188,8 @@ public final class Sensor { // Upon detection of an event, the sensor deactivates itself and then sends a single event. static int REPORTING_MODE_ONE_SHOT = 3; + // TODO(): The following arrays are fragile and error-prone. This needs to be refactored. + // Note: This needs to be updated, whenever a new sensor is added. private static int[] sSensorReportingModes = { REPORTING_MODE_CONTINUOUS, REPORTING_MODE_CONTINUOUS, REPORTING_MODE_CONTINUOUS, @@ -201,7 +203,7 @@ public final class Sensor { // Holds the maximum length of the values array associated with {@link SensorEvent} or // {@link TriggerEvent} for the Sensor private static int[] sMaxLengthValuesArray = { - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 6, 4, 6, 1 }; static int getReportingMode(Sensor sensor) {