add network info

This commit is contained in:
xsean 2025-12-23 12:17:45 +08:00
parent 9f49a19530
commit 985eba8516

View File

@ -53,7 +53,7 @@ class NetworkInfo(private val context: Context) {
val wifiPasspoint: Boolean?, // 是否支持Passpoint
val support5G: Boolean?, // 是否支持5GHz Wi-Fi
val support6G: Boolean?, // 是否支持6GHz Wi-Fi
//val support60G: Boolean? // 是否支持60GHz Wi-Fi
val support60G: Boolean? // 是否支持60GHz Wi-Fi
)
/**
@ -120,7 +120,7 @@ class NetworkInfo(private val context: Context) {
/**
* 获取当前Wi-Fi详细信息
* 需要权限: ACCESS_WIFI_STATE, ACCESS_FINE_LOCATION (Android 10+)
* 需要权限: ACCESS_WIFI_STATE, (Android 10+)
*/
fun getWifiDetails(): WifiDetails? {
val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
@ -230,7 +230,7 @@ class NetworkInfo(private val context: Context) {
WifiDetails(
connected, ssid, bssid, capabilities, linkSpeed, rssi, level, freq, channel, standard,
dhcpServer, leaseDuration, gateway, subnetMask, dns1, dns2, ip, ipv6,
supportedStandards, wifiDirect, wifiAware, wifiPasspoint, support5G, support6G
supportedStandards, wifiDirect, wifiAware, wifiPasspoint, support5G, support6G, support60G
)
} catch (e: Exception) {
null
@ -423,7 +423,7 @@ class NetworkInfo(private val context: Context) {
private fun createEmptyWifiDetails() = WifiDetails(
false, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null,
null
null, support60G = null
)
/**