Fix deprecations

This commit is contained in:
Mygod
2020-08-18 05:02:09 +08:00
parent 8a1df227c1
commit 35055bc074
10 changed files with 33 additions and 34 deletions

View File

@@ -143,7 +143,7 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene
// WifiP2pServiceImpl only removes self address
Build.VERSION.SDK_INT >= 29 && address == MacAddressCompat.ANY_ADDRESS || address == ownerAddress
}
val main = ownedGroups.minBy { it.networkId }
val main = ownedGroups.minByOrNull { it.networkId }
// do not replace current group if it's better
if (binder.group?.passphrase == null) binder.group = main
return if (main != null) ownedGroups.filter { it.networkId != main.networkId } else emptyList()