mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-23 13:04:28 +00:00
Bug 1167132 - Part 7: [NetworkManager] Move network information into a separate interface (MobileConnection). r=echen
This commit is contained in:
parent
6c109160ec
commit
a6382e8e7e
@ -708,10 +708,10 @@ MobileConnectionProvider.prototype = {
|
||||
updateDataInfo: function(aNewInfo, aBatch = false) {
|
||||
// For the data connection, the `connected` flag indicates whether
|
||||
// there's an active data call. We get correct `connected` state here.
|
||||
let active = gNetworkManager.active;
|
||||
let active = gNetworkManager.activeNetworkInfo;
|
||||
aNewInfo.connected = false;
|
||||
if (active &&
|
||||
active.type === Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE &&
|
||||
active.type === Ci.nsINetworkInfo.NETWORK_TYPE_MOBILE &&
|
||||
active.serviceId === this._clientId) {
|
||||
aNewInfo.connected = true;
|
||||
}
|
||||
@ -1599,11 +1599,10 @@ MobileConnectionService.prototype = {
|
||||
}
|
||||
break;
|
||||
case NS_DATA_CALL_ERROR_TOPIC_ID:
|
||||
let network = aSubject;
|
||||
try {
|
||||
if (network instanceof Ci.nsIRilNetworkInterface) {
|
||||
let rilNetwork = network.QueryInterface(Ci.nsIRilNetworkInterface);
|
||||
this.notifyDataError(rilNetwork.serviceId, rilNetwork);
|
||||
if (aSubject instanceof Ci.nsIRilNetworkInfo) {
|
||||
let rilInfo = aSubject.QueryInterface(Ci.nsIRilNetworkInfo);
|
||||
this.notifyDataError(rilInfo.serviceId, aData);
|
||||
}
|
||||
} catch (e) {}
|
||||
break;
|
||||
|
@ -838,23 +838,14 @@ DataCallHandler.prototype = {
|
||||
/**
|
||||
* Notify about data call setup error, called from DataCall.
|
||||
*/
|
||||
notifyDataCallError: function(aMessage) {
|
||||
notifyDataCallError: function(aDataCall, aErrorMsg) {
|
||||
// Notify data call error only for data APN
|
||||
let networkInterface = this.dataNetworkInterfaces.get(NETWORK_TYPE_MOBILE);
|
||||
if (networkInterface && networkInterface.enabled) {
|
||||
let dataCall = networkInterface.dataCall;
|
||||
// If there is a cid, compare cid; otherwise it is probably an error on
|
||||
// data call setup.
|
||||
if (aMessage.cid !== undefined) {
|
||||
if (aMessage.linkInfo.cid == dataCall.linkInfo.cid) {
|
||||
Services.obs.notifyObservers(networkInterface, TOPIC_DATA_CALL_ERROR,
|
||||
null);
|
||||
}
|
||||
} else {
|
||||
if (this._compareDataCallOptions(dataCall, aMessage)) {
|
||||
Services.obs.notifyObservers(networkInterface, TOPIC_DATA_CALL_ERROR,
|
||||
null);
|
||||
}
|
||||
if (this._compareDataCallOptions(dataCall, aDataCall)) {
|
||||
Services.obs.notifyObservers(networkInterface.info,
|
||||
TOPIC_DATA_CALL_ERROR, aErrorMsg);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1067,7 +1058,7 @@ DataCall.prototype = {
|
||||
}
|
||||
|
||||
// Let DataCallHandler notify MobileConnectionService
|
||||
this.dataCallHandler.notifyDataCallError(this);
|
||||
this.dataCallHandler.notifyDataCallError(this, errorMsg);
|
||||
|
||||
// For suggestedRetryTime, the value of INT32_MAX(0x7fffffff) means no retry.
|
||||
if (aDataCall.suggestedRetryTime === INT32_MAX ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user