summaryrefslogtreecommitdiff
path: root/hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java')
-rw-r--r--hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java b/hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java
index b797e687cd7..a6aaebf9916 100644
--- a/hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java
+++ b/hostsidetests/statsdatom/src/android/cts/statsdatom/sizecompatrestartbutton/SizeCompatRestartButtonStatsTests.java
@@ -98,8 +98,9 @@ public class SizeCompatRestartButtonStatsTests extends DeviceTestCase implements
}
public void testSizeCompatRestartButtonAppearedButNotClicked() throws Exception {
- if (!isOpenedDeviceStateAvailable()) {
- CLog.i("Device doesn't support OPENED device state.");
+ if (!isDeviceStateAvailable(DEVICE_STATE_OPENED)
+ || !isDeviceStateAvailable(DEVICE_STATE_CLOSED)) {
+ CLog.i("Device doesn't support OPENED or CLOSED device states.");
return;
}
@@ -120,11 +121,10 @@ public class SizeCompatRestartButtonStatsTests extends DeviceTestCase implements
assertThat(atom.getEvent()).isEqualTo(Event.APPEARED);
}
- private boolean isOpenedDeviceStateAvailable() throws Exception {
+ private boolean isDeviceStateAvailable(int state) throws Exception {
return Arrays.stream(
getDevice().executeShellCommand(CMD_GET_AVAILABLE_DEVICE_STATES).split(","))
.map(Integer::valueOf)
- .anyMatch(state -> state == DEVICE_STATE_OPENED);
+ .anyMatch(availableState -> availableState == state);
}
}
-