Exclude TYPE_HEART_RATE sensor type from CtsSensorTestCases[instant]
android.hardware.cts.SensorTest#testBatchAndFlushUidIdle TC requires android.permission.BODY_SENSORS permission.
According to the CTS document, some functions cannot be tested due to the permission problem of instant app, and these classes can be excluded from the test. https://source.android.com/compatibility/cts/cts-instant
The heartrate sensor is processed to be excluded from the test like above document in the code, but in reality, the test is performed in the instant mode and a fail occurs
Bug: b/141494456
Test: run cts -m CtsSensorTestCases -t android.hardware.cts.SensorTest#testBatchAndFlushUidIdle
Change-Id: I482f4a3bd29e27726b8479fe401bf4f35144f488
Signed-off-by: Mark Hong <sungmin.h@samsung.com>
(cherry picked from commit 5cbe2a3ace2e59c4fe86dab23b9f9e5a115cc75b)
diff --git a/tests/sensor/src/android/hardware/cts/SensorTest.java b/tests/sensor/src/android/hardware/cts/SensorTest.java
index f48ed77..8b2e234 100644
--- a/tests/sensor/src/android/hardware/cts/SensorTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorTest.java
@@ -87,7 +87,8 @@
mAndroidSensorList = new ArrayList<>();
for (Sensor s : mSensorList) {
- if (s.getType() < Sensor.TYPE_DEVICE_PRIVATE_BASE) {
+ if (s.getType() < Sensor.TYPE_DEVICE_PRIVATE_BASE &&
+ (!context.getPackageManager().isInstantApp() || s.getType() != Sensor.TYPE_HEART_RATE)) {
mAndroidSensorList.add(s);
}
}