From 0bb756daebb81be4252d243d1eab6277ba8edd03 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 31 Jul 2020 04:18:40 +0800 Subject: [PATCH] Be more descriptive of unrecognized key mgmt --- .../be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt index 93f913b3..8a9a8cec 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt @@ -219,7 +219,9 @@ data class SoftApConfigurationCompat( SoftApConfiguration.SECURITY_TYPE_WPA2_PSK } android.net.wifi.WifiConfiguration.KeyMgmt.SAE -> SoftApConfiguration.SECURITY_TYPE_WPA3_SAE - else -> throw IllegalArgumentException("Unrecognized key management: $allowedKeyManagement") + else -> android.net.wifi.WifiConfiguration.KeyMgmt.strings.getOrElse(selected) { "?" }.let { + throw IllegalArgumentException("Unrecognized key management $it ($selected)") + } } }, if (Build.VERSION.SDK_INT >= 28) TetherTimeoutMonitor.enabled else false,