Skip to content

Commit

Permalink
Bug 890463 - Follow up of Use MMIResult for get IMEI - default case. …
Browse files Browse the repository at this point in the history
…r=etienne
  • Loading branch information
ferjm committed Jul 11, 2013
1 parent 4f9eff4 commit 5841c7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions apps/communications/dialer/js/mmi.js
Expand Up @@ -3,7 +3,7 @@
var MmiManager = {

COMMS_APP_ORIGIN: document.location.protocol + '//' +
document.location.host,
document.location.host,
_: null,
_conn: null,
ready: false,
Expand Down Expand Up @@ -39,12 +39,15 @@ var MmiManager = {
this.init();
}

if (this._conn) {
var request = this._pendingRequest = this._conn.sendMMI(message);
request.onsuccess = this.notifySuccess.bind(this);
request.onerror = this.notifyError.bind(this);
this.openUI();
}
LazyL10n.get((function localized(_) {
this._ = _;
if (this._conn) {
var request = this._pendingRequest = this._conn.sendMMI(message);
request.onsuccess = this.notifySuccess.bind(this);
request.onerror = this.notifyError.bind(this);
this.openUI();
}
}).bind(this));
},

notifySuccess: function mm_notifySuccess(evt) {
Expand Down Expand Up @@ -188,8 +191,11 @@ var MmiManager = {
default:
// This would allow carriers and others to implement custom MMI codes
// with title and statusMessage only.
message.result = mmiResult.statusMessage ?
mmiResult.statusMessage : null;
if (mmiResult.statusMessage) {
message.result = this._(mmiResult.statusMessage) ?
this._(mmiResult.statusMessage) :
mmiResult.statusMessage;
}
break;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/communications/dialer/test/unit/mmi_test.js
Expand Up @@ -60,7 +60,7 @@ suite('dialer/mmi', function() {

test('Check empty request result', function(done) {
setTimeout(function() {
assert.isNull(MmiManager._ui._messageReceived);
assert.isUndefined(MmiManager._ui._messageReceived);
done();
}, TINY_TIMEOUT);
});
Expand Down

0 comments on commit 5841c7d

Please sign in to comment.