Bug 1091454 - Part 1.2: Reuse MozStkTextMessage as the container of Text/Icon to be displayed for SET_UP_CALL/LAUNCH_BROWSER. r=hsinyi r=echen

This commit is contained in:
Bevis Tseng 2014-11-06 14:30:01 +08:00
Родитель f83b042945
Коммит 84b8635283
2 изменённых файлов: 54 добавлений и 25 удалений

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

@ -10963,6 +10963,8 @@ StkCommandParamsFactoryObject.prototype = {
processSetupCall: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let call = {};
let confirmMessage = {};
let callMessage = {};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_ADDRESS,
@ -10971,39 +10973,57 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_DURATION
]);
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
call.confirmMessage = ctlv.value.identifier;
}
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
call.callMessage = ctlv.value.identifier;
}
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ADDRESS);
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ADDRESS);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
command: cmdDetails,
resultCode: STK_RESULT_REQUIRED_VALUES_MISSING});
throw new Error("Stk Set Up Call: Required value missing : Adress");
throw new Error("Stk Set Up Call: Required value missing : Address");
}
call.address = ctlv.value.number;
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
confirmMessage.text = ctlv.value.identifier;
call.confirmMessage = confirmMessage;
}
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
callMessage.text = ctlv.value.identifier;
call.callMessage = callMessage;
}
// see 3GPP TS 31.111 section 6.4.13
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DURATION);
if (ctlv) {
call.duration = ctlv.value;
}
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
call,
onComplete);
let iconIdCtlvs = selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null;
this.loadIcons(iconIdCtlvs, (aIcons) => {
if (aIcons) {
confirmMessage.icons = aIcons[0];
confirmMessage.iconSelfExplanatory =
(iconIdCtlvs[0].value.qualifier == 0) ? true: false;
call.confirmMessage = confirmMessage;
if (aIcons.length > 1) {
callMessage.icons = aIcons[1];
callMessage.iconSelfExplanatory =
(iconIdCtlvs[1].value.qualifier == 0) ? true: false;
call.callMessage = callMessage;
}
}
onComplete(call);
});
},
processLaunchBrowser: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let browser = {};
let confirmMessage = {};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_URL,
@ -11020,16 +11040,25 @@ StkCommandParamsFactoryObject.prototype = {
}
browser.url = ctlv.value.url;
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
browser.confirmMessage = ctlv.value.identifier;
}
browser.mode = cmdDetails.commandQualifier & 0x03;
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
browser,
onComplete);
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
confirmMessage.text = ctlv.value.identifier;
browser.confirmMessage = confirmMessage;
}
let iconIdCtlvs = selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null;
this.loadIcons(iconIdCtlvs, (aIcons) => {
if (aIcons) {
confirmMessage.icons = aIcons[0];
confirmMessage.iconSelfExplanatory =
(iconIdCtlvs[0].value.qualifier == 0) ? true: false;
browser.confirmMessage = confirmMessage;
}
onComplete(browser);
});
},
processPlayTone: function(cmdDetails, ctlvs, onComplete) {

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

@ -280,7 +280,7 @@ dictionary MozStkInput : MozStkIconContainer
boolean isHelpAvailable;
};
dictionary MozStkBrowserSetting : MozStkIconContainer
dictionary MozStkBrowserSetting
{
/**
* Confirm message to launch browser.
@ -300,7 +300,7 @@ dictionary MozStkBrowserSetting : MozStkIconContainer
unsigned short mode;
};
dictionary MozStkSetUpCall : MozStkIconContainer
dictionary MozStkSetUpCall
{
/**
* The Dialling number.