From 162190933bb1456d48a41b0205f3864170691aa1 Mon Sep 17 00:00:00 2001 From: Pierre Fite-Georgel Date: Tue, 17 Dec 2019 16:52:29 -0800 Subject: Changing logic that generates virtual SENSOR_TYPE_LINEAR_ACCELERATION. New logic only requires accel/gyro to be available rather than accel/gyro/mag which is not necessary. Bug: 145707966 Fix: 145707966 Test: Flashed a Hawk device (AAE development platform) that does not have Linear Acceleration Sensor currently. After flashing : Linear Acceleration Sensor | AOSP | ver: 3 | type: android.sensor.linear_acceleration(10) | perm: n/a | flags: 0x00000000 continuous | maxDelay=0us | maxRate=500.00Hz | no batching | non-wakeUp | Change-Id: Idfe7c1ab357e363cb2c8daf6e4175adbbcf9d8c4 (cherry picked from commit 63daa668128d04797edfed504322f8915457ac60) --- services/sensorservice/SensorService.cpp | 11 +++++------ 1 file 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<