Fix NPE
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user