diff options
-rw-r--r-- | wifi/java/android/net/wifi/p2p/WifiP2pService.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java index 5f1e6bb..ba8ffec 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -1467,6 +1467,12 @@ public class WifiP2pService extends IWifiP2pManager.Stub { if (mGroup.isGroupOwner()) { setWifiP2pInfoOnGroupFormation(SERVER_ADDRESS); } + + // In case of a negotiation group, connection changed is sent + // after a client joins. For autonomous, send now + if (mAutonomousGroup) { + sendP2pConnectionChangedBroadcast(); + } } @Override @@ -1481,7 +1487,11 @@ public class WifiP2pService extends IWifiP2pManager.Stub { deviceAddress.equals(mSavedProvDiscDevice.deviceAddress)) { mSavedProvDiscDevice = null; } - mGroup.addClient(mPeers.get(deviceAddress)); + if (mPeers.get(deviceAddress) != null) { + mGroup.addClient(mPeers.get(deviceAddress)); + } else { + mGroup.addClient(deviceAddress); + } mPeers.updateStatus(deviceAddress, WifiP2pDevice.CONNECTED); if (DBG) logd(getName() + " ap sta connected"); sendP2pPeersChangedBroadcast(); |