Bug 951958 - B2G RIL: set/get preferred network type error message is not set accordingly. r=hsinyi

This commit is contained in:
Jessica Jong 2013-12-19 11:07:14 -05:00
parent 086840ca14
commit 6d2d4fa547

View File

@ -5880,21 +5880,30 @@ RIL[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function REQUEST_SET_PREFERRED_NETWORK
return;
}
options.success = (options.rilRequestError == ERROR_SUCCESS);
if (options.rilRequestError) {
options.success = false;
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
} else {
options.success = true;
}
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_PREFERRED_NETWORK_TYPE(length, options) {
let networkType;
if (!options.rilRequestError) {
networkType = RIL_PREFERRED_NETWORK_TYPE_TO_GECKO.indexOf(GECKO_PREFERRED_NETWORK_TYPE_DEFAULT);
let responseLen = Buf.readInt32(); // Number of INT32 responsed.
if (responseLen) {
this.preferredNetworkType = networkType = Buf.readInt32();
}
options.networkType = networkType;
if (options.rilRequestError) {
options.success = false;
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
return;
}
options.success = (options.rilRequestError == ERROR_SUCCESS);
let networkType = RIL_PREFERRED_NETWORK_TYPE_TO_GECKO.indexOf(GECKO_PREFERRED_NETWORK_TYPE_DEFAULT);
let responseLen = Buf.readInt32(); // Number of INT32 responsed.
if (responseLen) {
this.preferredNetworkType = networkType = Buf.readInt32();
}
options.networkType = networkType;
options.success = true;
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_NEIGHBORING_CELL_IDS] = null;