Fix for VTS test CleanupConnectionsOnInitialize am: 45a15ed8b9

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

Change-Id: I105d3e8472f27f2d49a6ab675d173af739fca039
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
index ea5dc70..0a663fa 100644
--- a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
+++ b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
@@ -560,6 +560,11 @@
 }
 
 TEST_P(SensorsHidlTest, CleanupConnectionsOnInitialize) {
+    if (getSensorsList().size() == 0) {
+        // No sensors
+        return;
+    }
+
     activateAllSensors(true);
 
     // Verify that events are received