Fix persistent group on Android 11

Also only request persistent group when necessary.
This commit is contained in:
Mygod
2020-07-02 06:26:55 +08:00
parent a5adff4b65
commit d462b3ac07
6 changed files with 67 additions and 87 deletions

View File

@@ -202,8 +202,8 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
bssid = RepeaterService.deviceAddress
} to false
}
} else {
val group = binder?.group
} else binder?.let { binder ->
val group = binder.group ?: binder.fetchPersistentGroup().let { binder.group }
if (group != null) return SoftApConfigurationCompat.empty().run {
ssid = group.networkName
securityType = SoftApConfiguration.SECURITY_TYPE_WPA2_PSK // is not actually used