зеркало из https://github.com/mozilla/pjs.git
Bug 733266 - B2G SMS DB: Use MSISDN from RIL as own phone number. [r=philikon] DONTBUILD because NPOTB
This commit is contained in:
Родитель
12492eeaeb
Коммит
69b9ec3855
|
@ -318,7 +318,7 @@ SmsDatabaseService.prototype = {
|
|||
saveReceivedMessage: function saveReceivedMessage(sender, body, date) {
|
||||
let message = {delivery: DELIVERY_RECEIVED,
|
||||
sender: sender,
|
||||
receiver: null, //TODO see bug 733266
|
||||
receiver: this.mRIL.radioState.msisdn,
|
||||
body: body,
|
||||
timestamp: date};
|
||||
return this.saveMessage(message);
|
||||
|
@ -326,7 +326,7 @@ SmsDatabaseService.prototype = {
|
|||
|
||||
saveSentMessage: function saveSentMessage(receiver, body, date) {
|
||||
let message = {delivery: DELIVERY_SENT,
|
||||
sender: null, //TODO see bug 733266
|
||||
sender: this.mRIL.radioState.msisdn,
|
||||
receiver: receiver,
|
||||
body: body,
|
||||
timestamp: date};
|
||||
|
@ -603,6 +603,12 @@ SmsDatabaseService.prototype = {
|
|||
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyGetter(SmsDatabaseService.prototype, "mRIL", function () {
|
||||
return Cc["@mozilla.org/telephony/system-worker-manager;1"]
|
||||
.getService(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIRadioInterfaceLayer);
|
||||
});
|
||||
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsDatabaseService]);
|
||||
|
||||
function debug() {
|
||||
|
|
|
@ -150,6 +150,7 @@ function RadioInterfaceLayer() {
|
|||
bars: null,
|
||||
operator: null,
|
||||
type: null,
|
||||
msisdn: null,
|
||||
};
|
||||
}
|
||||
RadioInterfaceLayer.prototype = {
|
||||
|
@ -278,6 +279,9 @@ RadioInterfaceLayer.prototype = {
|
|||
+ " timestamp=" + message.localTimeStampInMS);
|
||||
}
|
||||
break;
|
||||
case "siminfo":
|
||||
this.radioState.msisdn = message.msisdn;
|
||||
break;
|
||||
default:
|
||||
throw new Error("Don't know about this message type: " + message.type);
|
||||
}
|
||||
|
|
|
@ -1268,7 +1268,8 @@ let RIL = {
|
|||
// Ignore 2 bytes prefix, which is 4 chars
|
||||
let number = GsmPDUHelper.readStringAsBCD().toString().substr(4);
|
||||
if (DEBUG) debug("MSISDN: " + number);
|
||||
this.MSISDN = number;
|
||||
this.MSISDN = number || null;
|
||||
this.sendDOMMessage({type: "siminfo", msisdn: this.MSISDN});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче