summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author android-build-team Robot <android-build-team-robot@google.com> 2020-02-17 00:04:16 +0000
committer android-build-team Robot <android-build-team-robot@google.com> 2020-02-17 00:04:16 +0000
commit78a57640c50032296bcf17eea51ddb91dbe97698 (patch)
tree094bd580e284e33b0a3499a2d943a861875d8e71
parent27a36f06ca9a77ab1a00e9e5db4d533677daaca7 (diff)
parent162190933bb1456d48a41b0205f3864170691aa1 (diff)
Snap for 6212576 from 162190933bb1456d48a41b0205f3864170691aa1 to qt-qpr3-release
Change-Id: I35f543b632180ef1b5e48a7c9f11f47f437ab7f1
-rw-r--r--services/sensorservice/SensorService.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 14ed73deaf..090a0ce478 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -208,12 +208,6 @@ void SensorService::onFirstRef() {
registerSensor(new RotationVectorSensor(), !needRotationVector, true);
registerSensor(new OrientationSensor(), !needRotationVector, true);
- bool needLinearAcceleration =
- (virtualSensorsNeeds & (1<<SENSOR_TYPE_LINEAR_ACCELERATION)) != 0;
-
- registerSensor(new LinearAccelerationSensor(list, count),
- !needLinearAcceleration, true);
-
// virtual debugging sensors are not for user
registerSensor( new CorrectedGyroSensor(list, count), true, true);
registerSensor( new GyroDriftSensor(), true, true);
@@ -223,6 +217,11 @@ void SensorService::onFirstRef() {
bool needGravitySensor = (virtualSensorsNeeds & (1<<SENSOR_TYPE_GRAVITY)) != 0;
registerSensor(new GravitySensor(list, count), !needGravitySensor, true);
+ bool needLinearAcceleration =
+ (virtualSensorsNeeds & (1<<SENSOR_TYPE_LINEAR_ACCELERATION)) != 0;
+ registerSensor(new LinearAccelerationSensor(list, count),
+ !needLinearAcceleration, true);
+
bool needGameRotationVector =
(virtualSensorsNeeds & (1<<SENSOR_TYPE_GAME_ROTATION_VECTOR)) != 0;
registerSensor(new GameRotationVectorSensor(), !needGameRotationVector, true);