Merge "Only save newly received events during testing"

This commit is contained in:
TreeHugger Robot 2018-11-06 03:54:28 +00:00 committed by Android (Google) Code Review
commit a29f60d68a

View file

@ -123,8 +123,8 @@ void SensorsHidlEnvironmentV2_0::readEvents() {
size_t eventsToRead = std::min(availableEvents, mEventBuffer.size());
if (eventsToRead > 0) {
if (mEventQueue->read(mEventBuffer.data(), eventsToRead)) {
for (const auto& e : mEventBuffer) {
addEvent(e);
for (size_t i = 0; i < eventsToRead; i++) {
addEvent(mEventBuffer[i]);
}
}
}