Only save newly received events during testing

All events in the temporary event buffer were being saved during
testing. This caused some events to be saved multiple times. This
patch ensures that only new events are saved.

Bug: 115969174
Test: Verified duplicate events are not received
Change-Id: Ia2c7df7273456700e0da2ddd927f7daf42e69334
diff --git a/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp b/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp
index 5444287..2fb67a6 100644
--- a/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp
+++ b/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp
@@ -123,8 +123,8 @@
     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]);
             }
         }
     }