Bug 939046 - Part 2.b: use DISCONNECTED state instead of UNKNOWN when data is disconnected. f=edgar r=hsinyi,vicamo

Since we have removed routing stuff in register/unregisterNetworkInterface()
in Part 2.a, we should use DISCONNECTED state so that routes can be properly
removed when data call is deactivated.
This commit is contained in:
Jessica Jong 2014-05-27 02:04:00 +02:00
Родитель 5a8c4c362e
Коммит e36c5c97a7
2 изменённых файлов: 5 добавлений и 11 удалений

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

@ -965,7 +965,7 @@ XPCOMUtils.defineLazyGetter(this, "gDataConnectionManager", function () {
// for data call. We can not use network.type to tell if it's
// NETWORK_TYPE_MOBILE, since the type is removed from
// RILNetworkInterface.connectedTypes on disconnect().
if (network.state == Ci.nsINetworkInterface.NETWORK_STATE_UNKNOWN) {
if (network.state == Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED) {
let connHandler = this._connectionHandlers[this._currentDataClientId];
let radioInterface = connHandler.radioInterface;
if (connHandler.allDataDisconnected() &&
@ -1514,7 +1514,7 @@ DataConnectionHandler.prototype = {
// Process pending radio power off request after all data calls
// are disconnected.
if (datacall.state == RIL.GECKO_NETWORK_STATE_UNKNOWN &&
if (datacall.state == RIL.GECKO_NETWORK_STATE_DISCONNECTED &&
this.allDataDisconnected()) {
if (gRadioEnabledController.isDeactivatingDataCalls()) {
if (DEBUG) {
@ -4618,6 +4618,8 @@ RILNetworkInterface.prototype = {
this.prefixLengths = [];
this.dnses = [];
this.gateways = [];
this.state = RIL.GECKO_NETWORK_STATE_UNKNOWN;
}
// In case the data setting changed while the datacall was being started or

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

@ -4305,14 +4305,6 @@ RilObject.prototype = {
continue;
}
if (updatedDataCall && !updatedDataCall.ifname) {
delete this.currentDataCalls[currentDataCall.cid];
currentDataCall.state = GECKO_NETWORK_STATE_UNKNOWN;
currentDataCall.rilMessageType = "datacallstatechange";
this.sendChromeMessage(currentDataCall);
continue;
}
this._setDataCallGeckoState(updatedDataCall);
if (updatedDataCall.state != currentDataCall.state) {
if (updatedDataCall.state == GECKO_NETWORK_STATE_DISCONNECTED) {
@ -6049,7 +6041,7 @@ RilObject.prototype[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_
let datacall = this.currentDataCalls[options.cid];
delete this.currentDataCalls[options.cid];
datacall.state = GECKO_NETWORK_STATE_UNKNOWN;
datacall.state = GECKO_NETWORK_STATE_DISCONNECTED;
datacall.rilMessageType = "datacallstatechange";
this.sendChromeMessage(datacall);
};