Merge "Increase poll max size, avoid performance issue when batching" into oc-dev
am: 538fa39cf8
Change-Id: I834c6e72498963bbe48299903e12f79b29a7479b
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index f757a64..06a9d7e 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -200,19 +200,18 @@
bool needExit = *stop;
while(!needExit) {
- env->sensors->poll(1,
- [&](auto result, const auto &events, const auto &dynamicSensorsAdded) {
+ env->sensors->poll(64, [&](auto result, const auto& events, const auto& dynamicSensorsAdded) {
if (result != Result::OK
|| (events.size() == 0 && dynamicSensorsAdded.size() == 0)
|| *stop) {
- needExit = true;
- return;
+ needExit = true;
+ return;
}
- if (events.size() > 0) {
- env->addEvent(events[0]);
+ for (const auto& e : events) {
+ env->addEvent(e);
}
- });
+ });
}
ALOGD("polling thread end");
}