add network info
This commit is contained in:
parent
9f49a19530
commit
985eba8516
@ -53,7 +53,7 @@ class NetworkInfo(private val context: Context) {
|
|||||||
val wifiPasspoint: Boolean?, // 是否支持Passpoint
|
val wifiPasspoint: Boolean?, // 是否支持Passpoint
|
||||||
val support5G: Boolean?, // 是否支持5GHz Wi-Fi
|
val support5G: Boolean?, // 是否支持5GHz Wi-Fi
|
||||||
val support6G: Boolean?, // 是否支持6GHz 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详细信息
|
* 获取当前Wi-Fi详细信息
|
||||||
* 需要权限: ACCESS_WIFI_STATE, ACCESS_FINE_LOCATION (Android 10+)
|
* 需要权限: ACCESS_WIFI_STATE, (Android 10+)
|
||||||
*/
|
*/
|
||||||
fun getWifiDetails(): WifiDetails? {
|
fun getWifiDetails(): WifiDetails? {
|
||||||
val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
|
val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
|
||||||
@ -230,7 +230,7 @@ class NetworkInfo(private val context: Context) {
|
|||||||
WifiDetails(
|
WifiDetails(
|
||||||
connected, ssid, bssid, capabilities, linkSpeed, rssi, level, freq, channel, standard,
|
connected, ssid, bssid, capabilities, linkSpeed, rssi, level, freq, channel, standard,
|
||||||
dhcpServer, leaseDuration, gateway, subnetMask, dns1, dns2, ip, ipv6,
|
dhcpServer, leaseDuration, gateway, subnetMask, dns1, dns2, ip, ipv6,
|
||||||
supportedStandards, wifiDirect, wifiAware, wifiPasspoint, support5G, support6G
|
supportedStandards, wifiDirect, wifiAware, wifiPasspoint, support5G, support6G, support60G
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
null
|
null
|
||||||
@ -423,7 +423,7 @@ class NetworkInfo(private val context: Context) {
|
|||||||
private fun createEmptyWifiDetails() = WifiDetails(
|
private fun createEmptyWifiDetails() = WifiDetails(
|
||||||
false, null, null, null, null, null, null, null, null, null,
|
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, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
null
|
null, support60G = null
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user