From b2969d4eaae55e0abc28ef5477bc0ec824ffd5c3 Mon Sep 17 00:00:00 2001 From: Ben Fennema Date: Fri, 24 Mar 2017 18:45:50 -0700 Subject: [PATCH] Add missing LOW_LATENCY_OFFBODY_DETECT handling Bug: 36580454 Test: unlock watch with LLOB sensor and verify no SensorService crash Change-Id: Ib1d086efd80e829bb844521fa39325f095b1c2c9 Signed-off-by: Ben Fennema --- sensors/1.0/default/convert.cpp | 2 ++ sensors/1.0/types.hal | 3 ++- sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp index 306d3a3bc2..3d859ec242 100644 --- a/sensors/1.0/default/convert.cpp +++ b/sensors/1.0/default/convert.cpp @@ -137,6 +137,7 @@ void convertFromSensorEvent(const sensors_event_t &src, Event *dst) { case SensorType::STATIONARY_DETECT: case SensorType::MOTION_DETECT: case SensorType::HEART_BEAT: + case SensorType::LOW_LATENCY_OFFBODY_DETECT: { dst->u.scalar = src.data[0]; break; @@ -280,6 +281,7 @@ void convertToSensorEvent(const Event &src, sensors_event_t *dst) { case SensorType::STATIONARY_DETECT: case SensorType::MOTION_DETECT: case SensorType::HEART_BEAT: + case SensorType::LOW_LATENCY_OFFBODY_DETECT: { dst->data[0] = src.u.scalar; break; diff --git a/sensors/1.0/types.hal b/sensors/1.0/types.hal index c0d8c5d72f..efb18c60e5 100644 --- a/sensors/1.0/types.hal +++ b/sensors/1.0/types.hal @@ -1148,7 +1148,8 @@ union EventPayload { * SensorType::TILT_DETECTOR, SensorType::WAKE_GESTURE, * SensorType::GLANCE_GESTURE, SensorType::PICK_UP_GESTURE, * SensorType::WRIST_TILT_GESTURE, SensorType::STATIONARY_DETECT, - * SensorType::MOTION_DETECT, SensorType::HEART_BEAT + * SensorType::MOTION_DETECT, SensorType::HEART_BEAT, + * SensorType::LOW_LATENCY_OFFBODY_DETECT */ float scalar; diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp index d21b512e66..a65c7b86af 100644 --- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp +++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp @@ -722,6 +722,7 @@ SensorFlagBits SensorsHidlTest::expectedReportModeForType(SensorType type) { case SensorType::DEVICE_ORIENTATION: case SensorType::MOTION_DETECT: case SensorType::STEP_COUNTER: + case SensorType::LOW_LATENCY_OFFBODY_DETECT: return SensorFlagBits::ON_CHANGE_MODE; case SensorType::SIGNIFICANT_MOTION: