From 61e42262000549b78843f0959043fec8367ed189 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Fri, 19 Oct 2012 12:03:47 -0700 Subject: Fix group join CTS test Bug: 7379336 Change-Id: I20ead7e8c0d855be523bdfd8d9cb9eaa4b8fcac1 --- wifi/java/android/net/wifi/p2p/WifiP2pService.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'wifi') diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java index 7f32431..f0aef92 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -1465,6 +1465,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 @@ -1479,7 +1485,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(); -- cgit v1.1