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) {
debugLog(TAG, "P2P connection changed: $info\n$net\n$group")
if (!info.groupFormed || !info.isGroupOwner || !group.isGroupOwner) {
if (routingManager != null) clean() // P2P shutdown
} else if (routingManager != null) {
when {
!info.groupFormed || !info.isGroupOwner || !group.isGroupOwner -> {
if (routingManager != null) clean() // P2P shutdown, else other groups changing before start, ignore
}
routingManager != null -> {
this.group = group
showNotification(group)
} else doStart(group)
}
else -> doStart(group)
}
}
/**
* startService Step 3