OSDN Git Service

Merge "Skip direct report test if sensor is not available" into oc-dev
authorPeng Xu <pengxu@google.com>
Wed, 9 Aug 2017 17:04:32 +0000 (17:04 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Wed, 9 Aug 2017 17:04:32 +0000 (17:04 +0000)
am: 63524f9fcc

Change-Id: Iffe683356ed925142ef877ecb5289463d8d4ac1e

sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp

index 3006508..357270f 100644 (file)
@@ -1235,6 +1235,11 @@ void SensorsHidlTest::testDirectReportOperation(
 
   SensorInfo sensor = defaultSensorByType(type);
 
+  if (!isValidType(sensor.type)) {
+    // no default sensor of this type
+    return;
+  }
+
   if (!isDirectReportRateSupported(sensor, rate)) {
     return;
   }