Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19066 from tdz/bug-1007657
Browse files Browse the repository at this point in the history
Bug 1007657 - Support string constants in MozIccManager. r=timdream
  • Loading branch information
BavarianTomcat committed May 13, 2014
2 parents b4525bb + 63bb4c3 commit e6094f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/system/js/icc.js
Expand Up @@ -137,7 +137,13 @@ var icc = {
return DUMP('FTU is running, delaying STK...');
}

var cmdId = '0x' + message.command.typeOfCommand.toString(16);
/* TODO: cleanup branching after bug 819831 landed */
var cmdId;
if (typeof message.command.typeOfCommand === 'string') {
cmdId = message.command.typeOfCommand;
} else {
cmdId = '0x' + message.command.typeOfCommand.toString(16);
}
if (icc_worker[cmdId]) {
return icc_worker[cmdId](message);
}
Expand Down
4 changes: 4 additions & 0 deletions apps/system/test/unit/icc_worker_test.js
Expand Up @@ -101,6 +101,10 @@ suite('STK (icc_worker) >', function() {

function launchStkCommand(cmd) {
function stkCmd(CMD) {
/* TODO: cleanup this function after bug 819831 landed */
if (typeof CMD === 'string') {
return CMD;
}
return '0x' + CMD.toString(16);
}
icc_worker[stkCmd(cmd.command.typeOfCommand)](cmd);
Expand Down

0 comments on commit e6094f3

Please sign in to comment.