Add a missing wifi p2p discovery changed broadcast

When we disable wifi while wifi p2p peer searching is in progress, we don't get
a WIFI_P2P_DISCOVERY_CHANGED_ACTION broadcast saying that discovery is stopped.
Since this broadcast is sticky, applications will still get the previous one
saying discovery is started even if wifi p2p has been disabled. Adding a
sendP2pDiscoveryChangedBroadcast when exiting P2pEnabledState fixes this problem,
and it won't be a duplicate as sendP2pDiscoveryChangedBroadcast checks for that.

Bug: 11151666
Change-Id: I62de8f3d17d80f151403b91cf5c62866d931c01b
This commit is contained in:
Yuhao Zheng
2013-10-09 11:53:51 -07:00
parent a45251080c
commit 8b033d37ca

View File

@@ -1080,6 +1080,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
@Override
public void exit() {
sendP2pDiscoveryChangedBroadcast(false);
sendP2pStateChangedBroadcast(false);
mNetworkInfo.setIsAvailable(false);
}