Skip to content

Commit bf4d55c

Browse files
isheriffAndroid (Google) Code Review
authored andcommitted
Merge "Add connection broadcast on group creation failure" into jb-mr1-dev
2 parents 65476e6 + 0a66763 commit bf4d55c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

wifi/java/android/net/wifi/p2p/WifiP2pService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ public boolean processMessage(Message message) {
14971497
public void exit() {
14981498
mSavedProvDiscDevice = null;
14991499
updateThisDevice(WifiP2pDevice.AVAILABLE);
1500-
setWifiP2pInfoOnGroupTermination();
1500+
resetWifiP2pInfo();
15011501
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null);
15021502
sendP2pConnectionChangedBroadcast();
15031503
}
@@ -1976,7 +1976,7 @@ private void setWifiP2pInfoOnGroupFormation(String serverAddress) {
19761976
mWifiP2pInfo.groupOwnerAddress = NetworkUtils.numericToInetAddress(serverAddress);
19771977
}
19781978

1979-
private void setWifiP2pInfoOnGroupTermination() {
1979+
private void resetWifiP2pInfo() {
19801980
mWifiP2pInfo.groupFormed = false;
19811981
mWifiP2pInfo.isGroupOwner = false;
19821982
mWifiP2pInfo.groupOwnerAddress = null;
@@ -2092,6 +2092,9 @@ private void updateThisDevice(int status) {
20922092
}
20932093

20942094
private void handleGroupCreationFailure() {
2095+
resetWifiP2pInfo();
2096+
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.FAILED, null, null);
2097+
sendP2pConnectionChangedBroadcast();
20952098
mSavedPeerConfig = null;
20962099
/* After cancelling group formation, new connections on existing peers can fail
20972100
* at supplicant. Flush and restart discovery */

0 commit comments

Comments
 (0)