am bf4d55cb: Merge "Add connection broadcast on group creation failure" into jb-mr1-dev

* commit 'bf4d55cb65da9e6205f4d33921d7e51340f47d46':
  Add connection broadcast on group creation failure
This commit is contained in:
Irfan Sheriff
2012-09-06 17:57:57 -07:00
committed by Android Git Automerger

View File

@@ -1497,7 +1497,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
public void exit() { public void exit() {
mSavedProvDiscDevice = null; mSavedProvDiscDevice = null;
updateThisDevice(WifiP2pDevice.AVAILABLE); updateThisDevice(WifiP2pDevice.AVAILABLE);
setWifiP2pInfoOnGroupTermination(); resetWifiP2pInfo();
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null); mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null);
sendP2pConnectionChangedBroadcast(); sendP2pConnectionChangedBroadcast();
} }
@@ -1976,7 +1976,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
mWifiP2pInfo.groupOwnerAddress = NetworkUtils.numericToInetAddress(serverAddress); mWifiP2pInfo.groupOwnerAddress = NetworkUtils.numericToInetAddress(serverAddress);
} }
private void setWifiP2pInfoOnGroupTermination() { private void resetWifiP2pInfo() {
mWifiP2pInfo.groupFormed = false; mWifiP2pInfo.groupFormed = false;
mWifiP2pInfo.isGroupOwner = false; mWifiP2pInfo.isGroupOwner = false;
mWifiP2pInfo.groupOwnerAddress = null; mWifiP2pInfo.groupOwnerAddress = null;
@@ -2092,6 +2092,9 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
} }
private void handleGroupCreationFailure() { private void handleGroupCreationFailure() {
resetWifiP2pInfo();
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.FAILED, null, null);
sendP2pConnectionChangedBroadcast();
mSavedPeerConfig = null; mSavedPeerConfig = null;
/* After cancelling group formation, new connections on existing peers can fail /* After cancelling group formation, new connections on existing peers can fail
* at supplicant. Flush and restart discovery */ * at supplicant. Flush and restart discovery */