From 0befeb29bcdf05b913a332edb4f222e11b4817ac Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Wed, 3 Oct 2012 15:53:45 -0700 Subject: Clear interface address and reset connections With the broadcom architecture, the p2p interface on a group was dynamic that would just go away. Clearing addresses was thus not important before. It is good to clear up the addresses and reset connections when the group is removed. Bug: 7282358 Change-Id: Ia1a94fce90f86b54abcc2d1f78a33524ef8045fa --- wifi/java/android/net/wifi/p2p/WifiP2pService.java | 8 +++++++- 1 file changed, 7 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 ef57e63..ca329e6 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -1662,7 +1662,6 @@ public class WifiP2pService extends IWifiP2pManager.Stub { private void stopDhcpServer(String intf) { try { mNwService.stopTethering(); - mNwService.clearInterfaceAddresses(intf); } catch (Exception e) { loge("Error stopping Dhcp server" + e); return; @@ -2166,6 +2165,13 @@ public class WifiP2pService extends IWifiP2pManager.Stub { mDhcpStateMachine = null; } + try { + mNwService.clearInterfaceAddresses(mGroup.getInterface()); + } catch (Exception e) { + loge("Failed to clear addresses " + e); + } + NetworkUtils.resetConnections(mGroup.getInterface(), NetworkUtils.RESET_ALL_ADDRESSES); + mGroup = null; mWifiNative.p2pFlush(); mServiceDiscReqId = null; -- cgit v1.1