Skip to content

Commit 2bc0c5f

Browse files
committed
Handle group tear down only at group removed event
Handling group removal at disconnect causes issues where supplicant keeps the group and then the next invocation fails Bug: 7403755 Change-Id: Iea7e5ec98486607f8e2c4a55be3743e0545a9da7
1 parent cd66855 commit 2bc0c5f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

wifi/java/android/net/wifi/p2p/WifiP2pService.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,9 +1566,17 @@ public boolean processMessage(Message message) {
15661566
WifiP2pManager.ERROR);
15671567
}
15681568
break;
1569-
/* The supplicant misses the group removed event at times and just
1570-
* sends a network disconnect event */
1571-
case WifiMonitor.NETWORK_DISCONNECTION_EVENT:
1569+
/* We do not listen to NETWORK_DISCONNECTION_EVENT for group removal
1570+
* handling since supplicant actually tries to reconnect after a temporary
1571+
* disconnect until group idle time out. Eventually, a group removal event
1572+
* will come when group has been removed.
1573+
*
1574+
* When there are connectivity issues during temporary disconnect, the application
1575+
* will also just remove the group.
1576+
*
1577+
* Treating network disconnection as group removal causes race conditions since
1578+
* supplicant would still maintain the group at that stage.
1579+
*/
15721580
case WifiMonitor.P2P_GROUP_REMOVED_EVENT:
15731581
if (DBG) logd(getName() + " group removed");
15741582
handleGroupRemoved();

0 commit comments

Comments
 (0)