From 913334e0368d63ae47748cb0ab9a17296cfff995 Mon Sep 17 00:00:00 2001 From: Brian Stack Date: Tue, 29 Jan 2019 15:39:13 -0800 Subject: [PATCH] Properly append META_DATA event on flush Bug: 123597380 Test: atest VtsHalSensorsV2_0TargetTest:SensorsHidlTest#FlushSensor Test: Framework properly receives and handles flush complete events Change-Id: I09d2b52555c27602e1fd2ee2282f8ad700a1be18 --- sensors/2.0/default/Sensor.cpp | 2 +- sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sensors/2.0/default/Sensor.cpp b/sensors/2.0/default/Sensor.cpp index 373ab1280d..e8067d00ba 100644 --- a/sensors/2.0/default/Sensor.cpp +++ b/sensors/2.0/default/Sensor.cpp @@ -83,7 +83,7 @@ Result Sensor::flush() { // to the Event FMQ prior to writing the flush complete event. Event ev; ev.sensorHandle = mSensorInfo.sensorHandle; - ev.sensorType = SensorType::ADDITIONAL_INFO; + ev.sensorType = SensorType::META_DATA; ev.u.meta.what = MetaDataEventType::META_DATA_FLUSH_COMPLETE; std::vector evs{ev}; mCallback->postEvents(evs, isWakeUpSensor()); diff --git a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp index 4a1f8f111d..39053fe75f 100644 --- a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp +++ b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp @@ -51,7 +51,7 @@ class EventCallback : public IEventCallback { } void onEvent(const ::android::hardware::sensors::V1_0::Event& event) override { - if (event.sensorType == SensorType::ADDITIONAL_INFO && + if (event.sensorType == SensorType::META_DATA && event.u.meta.what == MetaDataEventType::META_DATA_FLUSH_COMPLETE) { std::unique_lock lock(mFlushMutex); mFlushMap[event.sensorHandle]++;