Fix sub-HAL handle in dynamic sensor meta events am: 280fd70dc4

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

Change-Id: I33879a2a441fe8ea6190f98973be6a55499793ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Brian Duddie 2022-04-27 02:29:13 +00:00 committed by Automerger Merge Worker
commit f36e358316

View file

@ -68,6 +68,10 @@ std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V
std::vector<V2_1::Event> eventsOut;
for (V2_1::Event event : events) {
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);
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) {