sm8150-common: sensors: Fix sub-HAL handle in dynamic sensor meta events

Need to apply the sub-HAL index byte to ensure handles provided in
DYNAMIC_SENSOR_META events align properly with the [dis]connected
callbacks.

Bug: 228879057
Test: try on device with dynamic sensors sub-HAL at index > 0
Merged-In: Ic7290b51733bb829a5494ef41e9430b51dc6074e
Change-Id: Ic7290b51733bb829a5494ef41e9430b51dc6074e
This commit is contained in:
Brian Duddie 2022-04-18 12:41:44 -07:00 committed by TimoDo
parent 56a6368e97
commit 5f490fb597
1 changed files with 4 additions and 0 deletions

View File

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