Supplicant sometimes reports 00:00:00:00:00:00 as group owner address causing
an NPE.

Avoid updating from peer list and let connection continue since group owner
address is not essential for data transfer to continue.

Bug: 8158711
Change-Id: I06ce88d7fb426fec4965087968f738dd2a7a7799
This commit is contained in:
Irfan Sheriff
2013-02-12 09:51:47 -08:00
parent 080df3f38f
commit 9dab7d6705

View File

@@ -1332,10 +1332,19 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
P2pStateMachine.this, mGroup.getInterface());
mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP);
WifiP2pDevice groupOwner = mGroup.getOwner();
/* update group owner details with the ones found at discovery */
groupOwner.updateSupplicantDetails(mPeers.get(groupOwner.deviceAddress));
mPeers.updateStatus(groupOwner.deviceAddress, WifiP2pDevice.CONNECTED);
sendPeersChangedBroadcast();
WifiP2pDevice peer = mPeers.get(groupOwner.deviceAddress);
if (peer != null) {
// update group owner details with peer details found at discovery
groupOwner.updateSupplicantDetails(peer);
mPeers.updateStatus(groupOwner.deviceAddress, WifiP2pDevice.CONNECTED);
sendPeersChangedBroadcast();
} else {
// A supplicant bug can lead to reporting an invalid
// group owner address (all zeroes) at times. Avoid a
// crash, but continue group creation since it is not
// essential.
logw("Unknown group owner " + groupOwner);
}
}
transitionTo(mGroupCreatedState);
break;