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)
             }
         }