mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Properly append META_DATA event on flush"
This commit is contained in:
committed by
Android (Google) Code Review
commit
c9da65afbb
@@ -87,7 +87,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<Event> evs{ev};
|
||||
mCallback->postEvents(evs, isWakeUpSensor());
|
||||
|
||||
@@ -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<std::recursive_mutex> lock(mFlushMutex);
|
||||
mFlushMap[event.sensorHandle]++;
|
||||
|
||||
Reference in New Issue
Block a user