mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Increase poll max size, avoid performance issue when batching
Vts polls sensor events with max size of 1, which can cause
performance issue when batching. Increase it to 64 to help eliminate
potential performance issue.
Note this CL has no change in behavior of test.
Test: VTS target test pass on several devices
Bug: 62027156
Change-Id: I04a6791f407ec0a54eb6cd8df4d4ef41e8a89c12
Merged-In: I04a6791f407ec0a54eb6cd8df4d4ef41e8a89c12
(cherry picked from commit e337dfe3d2)
This commit is contained in:
@@ -200,19 +200,18 @@ void SensorsHidlEnvironment::pollingThread(
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user