diff options
| author | 2020-06-02 13:56:35 -0400 | |
|---|---|---|
| committer | 2020-06-02 13:56:35 -0400 | |
| commit | 5dc55cac388fe56f323ea2e78ec0a7001df454d0 (patch) | |
| tree | 7ced02fe93e311a2da4b8d1e8717f8b610d4f1e1 | |
| parent | c7f9e4eea2c97ed653df990a38a92feca55c5db8 (diff) | |
Stop requantizing complex derived sensors
Sensors that derive their output from physical sensors and effectively
apply an irreversible filter onto their data. Requantizing this
information has little benefit and can potentially increase floating
point inaccuracy due to the additional math.
Bug: 157986376
Test: presubmits
Change-Id: I4158739abb6b74d978abe75bd8e03ac32ad4e998
| -rw-r--r-- | services/sensorservice/SensorDeviceUtils.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/services/sensorservice/SensorDeviceUtils.cpp b/services/sensorservice/SensorDeviceUtils.cpp index 0dcf8c0ea2..52213cff7a 100644 --- a/services/sensorservice/SensorDeviceUtils.cpp +++ b/services/sensorservice/SensorDeviceUtils.cpp @@ -40,22 +40,12 @@ void quantizeSensorEventValues(sensors_event_t *event, float resolution) { switch ((SensorTypeV2_1)event->type) { case SensorTypeV2_1::ACCELEROMETER: case SensorTypeV2_1::MAGNETIC_FIELD: - case SensorTypeV2_1::ORIENTATION: case SensorTypeV2_1::GYROSCOPE: - case SensorTypeV2_1::GRAVITY: - case SensorTypeV2_1::LINEAR_ACCELERATION: case SensorTypeV2_1::MAGNETIC_FIELD_UNCALIBRATED: case SensorTypeV2_1::GYROSCOPE_UNCALIBRATED: case SensorTypeV2_1::ACCELEROMETER_UNCALIBRATED: axes = 3; break; - case SensorTypeV2_1::GAME_ROTATION_VECTOR: - axes = 4; - break; - case SensorTypeV2_1::ROTATION_VECTOR: - case SensorTypeV2_1::GEOMAGNETIC_ROTATION_VECTOR: - axes = 5; - break; case SensorTypeV2_1::DEVICE_ORIENTATION: case SensorTypeV2_1::LIGHT: case SensorTypeV2_1::PRESSURE: @@ -77,11 +67,8 @@ void quantizeSensorEventValues(sensors_event_t *event, float resolution) { case SensorTypeV2_1::HINGE_ANGLE: axes = 1; break; - case SensorTypeV2_1::POSE_6DOF: - axes = 15; - break; default: - // No other sensors have data that needs to be rounded. + // No other sensors have data that needs to be quantized. break; } |