Add comment

This commit is contained in:
Mygod
2018-10-08 15:40:25 +08:00
parent 3339f17f87
commit 423c6074f9

View File

@@ -206,12 +206,16 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere
*/ */
private fun onP2pConnectionChanged(info: WifiP2pInfo, net: NetworkInfo?, group: WifiP2pGroup) { private fun onP2pConnectionChanged(info: WifiP2pInfo, net: NetworkInfo?, group: WifiP2pGroup) {
debugLog(TAG, "P2P connection changed: $info\n$net\n$group") debugLog(TAG, "P2P connection changed: $info\n$net\n$group")
if (!info.groupFormed || !info.isGroupOwner || !group.isGroupOwner) { when {
if (routingManager != null) clean() // P2P shutdown !info.groupFormed || !info.isGroupOwner || !group.isGroupOwner -> {
} else if (routingManager != null) { if (routingManager != null) clean() // P2P shutdown, else other groups changing before start, ignore
}
routingManager != null -> {
this.group = group this.group = group
showNotification(group) showNotification(group)
} else doStart(group) }
else -> doStart(group)
}
} }
/** /**
* startService Step 3 * startService Step 3