Fix sub-HAL handle in dynamic sensor meta events am: 280fd70dc4 am: f36e358316 am: b0625b0c96 am: 916352ec6b

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2064302

Change-Id: I13875daf5dddbabd6d69407f47e879239ed25b96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Brian Duddie 2022-04-27 04:10:19 +00:00 committed by Automerger Merge Worker
commit 48dbbd8341

View file

@ -68,6 +68,10 @@ std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V
std::vector<V2_1::Event> eventsOut; std::vector<V2_1::Event> eventsOut;
for (V2_1::Event event : events) { for (V2_1::Event event : events) {
event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex); event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex);
if (event.sensorType == V2_1::SensorType::DYNAMIC_SENSOR_META) {
event.u.dynamic.sensorHandle =
setSubHalIndex(event.u.dynamic.sensorHandle, mSubHalIndex);
}
eventsOut.push_back(event); eventsOut.push_back(event);
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle); const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) { if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) {