Bug 1087153 - Only attempt to close p2p supplicant connection before KK. r=vchang.

Since we would only use single connection to communicate with wpa_supplicant
on different interface (wlan0/p2p0) since KK, there's no need to close
supplicant connection in the p2p state machine.
This commit is contained in:
Henry Chang 2014-10-27 10:09:51 +08:00
parent 4b4ed39372
commit aa21c0103d

View File

@ -1330,7 +1330,7 @@ function P2pStateMachine(aP2pCommand, aNetUtil) {
debug('Stop DHCP server result: ' + success);
aP2pCommand.p2pDisable(function(success) {
debug('P2P function disabled');
aP2pCommand.closeSupplicantConnection(function (status) {
closeSupplicantConnectionIfNeeded(function() {
debug('Supplicant connection closed');
gNetworkService.disableInterface(P2P_INTERFACE_NAME, function (success){
debug('Disabled interface: ' + P2P_INTERFACE_NAME);
@ -1340,6 +1340,15 @@ function P2pStateMachine(aP2pCommand, aNetUtil) {
});
});
});
function closeSupplicantConnectionIfNeeded(callback) {
// No need to connect to supplicant on KK. Call back directly.
if (aP2pCommand.getSdkVersion() >= 19) {
callback();
return;
}
aP2pCommand.closeSupplicantConnection(callback);
}
},
handleEvent: function(aEvent) {