Backed out changeset d050c422919a (bug 997584) since should wait for gaia blocker landed first.

This commit is contained in:
Hsin-Yi Tsai 2014-04-22 18:46:59 +08:00
parent f5f618809f
commit 3c781dd404
3 changed files with 36 additions and 15 deletions

View File

@ -1393,13 +1393,6 @@ RILContentHelper.prototype = {
let request = Services.DOMRequest.createRequest(window);
let requestId = this.getRequestId(request);
let radioState = this.rilContexts[clientId].radioState;
if (radioState !== RIL.GECKO_DETAILED_RADIOSTATE_ENABLED) {
this.dispatchFireRequestError(requestId,
RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return request;
}
cpmm.sendAsyncMessage("RIL:GetCallingLineIdRestriction", {
clientId: clientId,
data: {
@ -1411,6 +1404,7 @@ RILContentHelper.prototype = {
},
setCallingLineIdRestriction: function(clientId, window, clirMode) {
if (window == null) {
throw Components.Exception("Can't get window object",
Cr.NS_ERROR_UNEXPECTED);
@ -1418,13 +1412,6 @@ RILContentHelper.prototype = {
let request = Services.DOMRequest.createRequest(window);
let requestId = this.getRequestId(request);
let radioState = this.rilContexts[clientId].radioState;
if (radioState !== RIL.GECKO_DETAILED_RADIOSTATE_ENABLED) {
this.dispatchFireRequestError(requestId,
RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return request;
}
cpmm.sendAsyncMessage("RIL:SetCallingLineIdRestriction", {
clientId: clientId,
data: {

View File

@ -92,6 +92,7 @@ const kSettingsTimezoneAutoUpdateAvailable = "time.timezone.automatic-update.ava
const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
const kPrefCellBroadcastDisabled = "ril.cellbroadcast.disabled";
const kPrefClirModePreference = "ril.clirMode";
const kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces";
const DOM_MOBILE_MESSAGE_DELIVERY_RECEIVED = "received";
@ -1614,6 +1615,7 @@ WorkerMessenger.prototype = {
let options = {
debug: DEBUG,
cellBroadcastDisabled: false,
clirMode: RIL.CLIR_DEFAULT,
quirks: {
callstateExtraUint32:
libcutils.property_get("ro.moz.ril.callstate_extra_int", "false") === "true",
@ -1641,6 +1643,10 @@ WorkerMessenger.prototype = {
Services.prefs.getBoolPref(kPrefCellBroadcastDisabled);
} catch(e) {}
try {
options.clirMode = Services.prefs.getIntPref(kPrefClirModePreference);
} catch(e) {}
this.send(null, "setInitialOptions", options);
},
@ -3483,11 +3489,23 @@ RadioInterface.prototype = {
this.clientId, message);
},
_updateCallingLineIdRestrictionPref: function(mode) {
try {
Services.prefs.setIntPref(kPrefClirModePreference, mode);
Services.prefs.savePrefFile(null);
if (DEBUG) {
this.debug(kPrefClirModePreference + " pref is now " + mode);
}
} catch (e) {}
},
sendMMI: function(target, message) {
if (DEBUG) this.debug("SendMMI " + JSON.stringify(message));
this.workerMessenger.send("sendMMI", message, (function(response) {
if (response.isSetCallForward) {
this._sendCfStateChanged(response);
} else if (response.isSetCLIR && response.success) {
this._updateCallingLineIdRestrictionPref(response.clirMode);
}
target.sendAsyncMessage("RIL:SendMMI", {
@ -3516,6 +3534,9 @@ RadioInterface.prototype = {
this.debug("setCallingLineIdRestriction: " + JSON.stringify(message));
}
this.workerMessenger.send("setCLIR", message, (function(response) {
if (response.success) {
this._updateCallingLineIdRestrictionPref(response.clirMode);
}
target.sendAsyncMessage("RIL:SetCallingLineIdRestriction", {
clientId: this.clientId,
data: response

View File

@ -53,6 +53,7 @@ if (!this.debug) {
}
let RIL_CELLBROADCAST_DISABLED;
let RIL_CLIR_MODE;
let RIL_EMERGENCY_NUMBERS;
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
@ -222,6 +223,7 @@ function RilObject(aContext) {
// Init properties that are only initialized once.
this.v5Legacy = RILQUIRKS_V5_LEGACY;
this.cellBroadcastDisabled = RIL_CELLBROADCAST_DISABLED;
this.clirMode = RIL_CLIR_MODE;
}
RilObject.prototype = {
context: null,
@ -264,6 +266,11 @@ RilObject.prototype = {
*/
cellBroadcastDisabled: false,
/**
* Global CLIR mode settings.
*/
clirMode: CLIR_DEFAULT,
/**
* Parsed Cell Broadcast search lists.
* cellBroadcastConfigs.MMI should be preserved over rild reset.
@ -1104,10 +1111,13 @@ RilObject.prototype = {
* nsIDOMMozMobileConnection interface.
*/
setCLIR: function(options) {
if (options) {
this.clirMode = options.clirMode;
}
let Buf = this.context.Buf;
Buf.newParcel(REQUEST_SET_CLIR, options);
Buf.writeInt32(1);
Buf.writeInt32(options.clirMode);
Buf.writeInt32(this.clirMode);
Buf.sendParcel();
},
@ -2454,6 +2464,7 @@ RilObject.prototype = {
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED, MMI_KS_SC_CLIR);
return;
}
options.isSetCLIR = true;
this.setCLIR(options);
return;
@ -6403,6 +6414,7 @@ RilObject.prototype[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLIC
this.getBasebandVersion();
this.updateCellBroadcastConfig();
this.setPreferredNetworkType();
this.setCLIR();
if (RILQUIRKS_DATA_REGISTRATION_ON_DEMAND && this._attachDataRegistration) {
this.setDataRegistration({attach: true});
}
@ -14656,6 +14668,7 @@ let ContextPool = {
DEBUG = DEBUG_WORKER || aOptions.debug;
RIL_EMERGENCY_NUMBERS = aOptions.rilEmergencyNumbers;
RIL_CELLBROADCAST_DISABLED = aOptions.cellBroadcastDisabled;
RIL_CLIR_MODE = aOptions.clirMode;
let quirks = aOptions.quirks;
RILQUIRKS_CALLSTATE_EXTRA_UINT32 = quirks.callstateExtraUint32;