From f9b7f8548eb95f2c387c4c2331acfaa04b6099b8 Mon Sep 17 00:00:00 2001 From: Aravind Akella Date: Thu, 10 Sep 2015 14:52:31 -0700 Subject: [PATCH] Set DATA_INJECTION mode flag for sensors. Bug: 24001171 Change-Id: I70133546c68fb478b2c2062f05a4164a36cd9e4b --- libs/gui/Sensor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp index 2545eec33..1b8d06e54 100644 --- a/libs/gui/Sensor.cpp +++ b/libs/gui/Sensor.cpp @@ -241,6 +241,11 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion) break; } + // Set DATA_INJECTION flag here. Defined in HAL 1_4. + if (halVersion >= SENSORS_DEVICE_API_VERSION_1_4) { + mFlags |= (hwSensor->flags & DATA_INJECTION_MASK); + } + // For the newer HALs log errors if reporting mask flags are set incorrectly. if (halVersion >= SENSORS_DEVICE_API_VERSION_1_3) { // Wake-up flag is set here.