summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wifi/java/android/net/wifi/p2p/WifiP2pService.java12
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 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();