Bug 855643 - B2G RIL: actively update networkSelectionMode at the first time querying. r=allstars.chh

This commit is contained in:
Hsin-Yi Tsai 2013-03-29 10:56:07 +08:00
parent b021f4b4f9
commit 33c2d01791
3 changed files with 11 additions and 3 deletions

View File

@ -310,6 +310,7 @@ CellBroadcastEtwsInfo.prototype = {
function RILContentHelper() {
this.rilContext = {
cardState: RIL.GECKO_CARDSTATE_UNKNOWN,
networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
iccInfo: new MobileICCInfo(),
voiceConnectionInfo: new MobileConnectionInfo(),
dataConnectionInfo: new MobileConnectionInfo()
@ -382,8 +383,6 @@ RILContentHelper.prototype = {
// nsIRILContentHelper
networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
rilContext: null,
getRilContext: function getRilContext() {
@ -400,6 +399,7 @@ RILContentHelper.prototype = {
return;
}
this.rilContext.cardState = rilContext.cardState;
this.rilContext.networkSelectionMode = rilContext.networkSelectionMode;
this.updateInfo(rilContext.iccInfo, this.rilContext.iccInfo);
this.updateConnectionInfo(rilContext.voice, this.rilContext.voiceConnectionInfo);
this.updateConnectionInfo(rilContext.data, this.rilContext.dataConnectionInfo);
@ -423,6 +423,10 @@ RILContentHelper.prototype = {
return this.getRilContext().cardState;
},
get networkSelectionMode() {
return this.getRilContext().networkSelectionMode;
},
/**
* The network that is currently trying to be selected (or "automatic").
* This helps ensure that only one network is selected at a time.

View File

@ -226,6 +226,7 @@ function RadioInterfaceLayer() {
this.rilContext = {
radioState: RIL.GECKO_RADIOSTATE_UNAVAILABLE,
cardState: RIL.GECKO_CARDSTATE_UNKNOWN,
networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
iccInfo: null,
imsi: null,
@ -1441,6 +1442,7 @@ RadioInterfaceLayer.prototype = {
*/
updateNetworkSelectionMode: function updateNetworkSelectionMode(message) {
debug("updateNetworkSelectionMode: " + JSON.stringify(message));
this.rilContext.networkSelectionMode = message.mode;
this._sendMobileConnectionMessage("RIL:NetworkSelectionModeChanged", message);
},

View File

@ -77,7 +77,7 @@ interface nsIVoicemailInfo : nsISupports
readonly attribute DOMString displayName;
};
[scriptable, uuid(a09c42c3-1063-42f6-8022-268c6a0fe5e8)]
[scriptable, uuid(f7ff9856-5c55-4ba2-9b64-bfc0ace169e7)]
interface nsIRilContext : nsISupports
{
readonly attribute DOMString radioState;
@ -86,6 +86,8 @@ interface nsIRilContext : nsISupports
readonly attribute DOMString imsi;
readonly attribute DOMString networkSelectionMode;
readonly attribute nsIDOMMozMobileICCInfo iccInfo;
readonly attribute nsIDOMMozMobileConnectionInfo voice;