Test timeout by platform as well

This commit is contained in:
Mygod
2022-07-11 19:26:50 -04:00
parent a73c94c8de
commit 0d2f4e3ce5
2 changed files with 4 additions and 2 deletions

View File

@@ -364,6 +364,8 @@ data class SoftApConfigurationCompat(
fun testPlatformValidity(channels: SparseIntArray) = setChannelsCompat(staticBuilder, channels) fun testPlatformValidity(channels: SparseIntArray) = setChannelsCompat(staticBuilder, channels)
@RequiresApi(30) @RequiresApi(30)
fun testPlatformValidity(bssid: MacAddress) = setBssid(staticBuilder, bssid) fun testPlatformValidity(bssid: MacAddress) = setBssid(staticBuilder, bssid)
@RequiresApi(30)
fun testPlatformValidity(timeout: Long) = setShutdownTimeoutMillis(staticBuilder, timeout)
} }
@Suppress("DEPRECATION") @Suppress("DEPRECATION")

View File

@@ -293,9 +293,9 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
dialogView.passwordWrapper.error = if (passwordValid) null else " " dialogView.passwordWrapper.error = if (passwordValid) null else " "
val timeoutError = dialogView.timeout.text.let { text -> val timeoutError = dialogView.timeout.text.let { text ->
if (text.isNullOrEmpty()) null else try { if (text.isNullOrEmpty()) null else try {
text.toString().toLong() SoftApConfigurationCompat.testPlatformValidity(text.toString().toLong())
null null
} catch (e: NumberFormatException) { } catch (e: Exception) {
e.readableMessage e.readableMessage
} }
} }