commit | 7f9469e808c81b1726962e0d9501d711854b544d | [log] [tgz] |
---|---|---|
author | Patrick Rohr <prohr@google.com> | Tue Feb 25 13:04:47 2025 -0800 |
committer | Patrick Rohr <prohr@google.com> | Tue Feb 25 15:30:52 2025 -0800 |
tree | 9b96acbbaa36b343fd63a9ffbbfda35f803a5a22 | |
parent | b4809fdd0862fc8f0f200419f6484f505fe2b738 [diff] |
Reverse pollingCheck arguments to be more kotlin friendly Test: TH Change-Id: Ibe52ccd9eec619ced5f8b84896d2a1efc6c0fefc
diff --git a/staticlibs/testutils/devicetests/com/android/testutils/PollingUtils.kt b/staticlibs/testutils/devicetests/com/android/testutils/PollingUtils.kt index 0a0290a..06c9497 100644 --- a/staticlibs/testutils/devicetests/com/android/testutils/PollingUtils.kt +++ b/staticlibs/testutils/devicetests/com/android/testutils/PollingUtils.kt
@@ -19,7 +19,7 @@ private const val POLLING_INTERVAL_MS: Int = 100 /** Calls condition() until it returns true or timeout occurs. */ -fun pollingCheck(condition: () -> Boolean, timeout_ms: Int): Boolean { +fun pollingCheck(timeout_ms: Int, condition: () -> Boolean): Boolean { var polling_time = 0 do { Thread.sleep(POLLING_INTERVAL_MS.toLong())
diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt index 4d2e740..cfca462 100644 --- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt +++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
@@ -150,7 +150,9 @@ // This is a workaround for b/366037029. Thread.sleep(2000L) } else { - val result = pollingCheck({ powerManager.isInteractive() }, timeout_ms = 2000) + val result = pollingCheck(timeout_ms = 2000) { + powerManager.isInteractive() + } assertThat(result).isEqualTo(interactive) } }