Fix frequency calculations

This commit is contained in:
Mygod
2020-07-02 08:39:42 +08:00
parent 71e0ab6ed1
commit 4c5265f0c2
4 changed files with 60 additions and 29 deletions

View File

@@ -192,12 +192,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
ssid = networkName
securityType = SoftApConfiguration.SECURITY_TYPE_WPA2_PSK // is not actually used
this.passphrase = passphrase
band = when (RepeaterService.operatingBand) {
WifiP2pConfig.GROUP_OWNER_BAND_AUTO -> SoftApConfigurationCompat.BAND_ANY
WifiP2pConfig.GROUP_OWNER_BAND_2GHZ -> SoftApConfigurationCompat.BAND_2GHZ
WifiP2pConfig.GROUP_OWNER_BAND_5GHZ -> SoftApConfigurationCompat.BAND_5GHZ
else -> throw IllegalArgumentException("Unknown operatingBand")
}
band = RepeaterService.operatingBand
channel = RepeaterService.operatingChannel
bssid = RepeaterService.deviceAddress
} to false
@@ -231,12 +226,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
if (RepeaterService.safeMode) {
RepeaterService.networkName = config.ssid
RepeaterService.passphrase = config.passphrase
RepeaterService.operatingBand = when (config.band) {
SoftApConfigurationCompat.BAND_ANY -> WifiP2pConfig.GROUP_OWNER_BAND_AUTO
SoftApConfigurationCompat.BAND_2GHZ -> WifiP2pConfig.GROUP_OWNER_BAND_2GHZ
SoftApConfigurationCompat.BAND_5GHZ -> WifiP2pConfig.GROUP_OWNER_BAND_5GHZ
else -> throw IllegalArgumentException("Unknown band")
}
RepeaterService.operatingBand = config.band
} else holder.config?.let { master ->
val binder = binder
if (binder?.group?.networkName != config.ssid || master.psk != config.passphrase ||