Bug 936763 - B2G MMS: the connected/disconnected network can come from 3G not MMS, which throws exceptions when accessing MMS proxy settings. r=vicamo

This commit is contained in:
Vicamo Yang 2013-11-11 12:41:03 +08:00
Родитель b9dbc81590
Коммит 8099ca4c54
1 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -407,16 +407,25 @@ MmsConnection.prototype = {
return;
}
this.connected =
// We only need to capture the state change of MMS network. Using
// |network.state| isn't reliable due to the possibilty of shared APN.
let connected =
this.radioInterface.getDataCallStateByType("mms") ==
Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED;
// Return if the MMS network state doesn't change, where the network
// state change can come from other non-MMS networks.
if (connected == this.connected) {
return;
}
this.connected = connected;
if (!this.connected) {
return;
}
// Set up the MMS APN setting based on the network, which is going to
// be used for the HTTP requests later.
// Set up the MMS APN setting based on the connected MMS network,
// which is going to be used for the HTTP requests later.
this.setApnSetting(network);
if (DEBUG) debug("Got the MMS network connected! Resend the buffered " +