Commit b96565ad authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

[sensor] Fix rounding of fused sensors.

Fused sensors were being rounded (r746199) for privacy. The fused
sensors were interpretig the SensorReading as the wrong type, using
the input type instead of the fused output type. This resulted in
interpreting a relative Euler sensor as quaternion.

Bug: 1058722
Change-Id: I41bb81daa65314f1e069487c4614177efee273ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095868
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748795}
parent 6495b657
...@@ -197,7 +197,7 @@ void PlatformSensorFusion::OnSensorReadingChanged(mojom::SensorType type) { ...@@ -197,7 +197,7 @@ void PlatformSensorFusion::OnSensorReadingChanged(mojom::SensorType type) {
return; return;
// Round the reading to guard user privacy. See https://crbug.com/1018180. // Round the reading to guard user privacy. See https://crbug.com/1018180.
RoundSensorReading(&reading, type); RoundSensorReading(&reading, fusion_algorithm_->fused_type());
if (GetReportingMode() == mojom::ReportingMode::ON_CHANGE && if (GetReportingMode() == mojom::ReportingMode::ON_CHANGE &&
!fusion_algorithm_->IsReadingSignificantlyDifferent(reading_, reading)) { !fusion_algorithm_->IsReadingSignificantlyDifferent(reading_, reading)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment