Closed
Bug 819560
Opened 12 years ago
Closed 12 years ago
RIL: remember the last mcc code
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: gwagner, Assigned: gwagner)
References
Details
Attachments
(1 file, 3 obsolete files)
3.48 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
The current version falls back to Brasil as the default country if we don't have a SIM card or the RIL is not initialized. We should remember the last mcc code in the library.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → anygregor
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #689942 -
Flags: review?(bent.mozilla)
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: --- → ?
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #689942 -
Attachment is obsolete: true
Attachment #689942 -
Flags: review?(bent.mozilla)
Attachment #689945 -
Flags: review?(bent.mozilla)
Comment on attachment 689945 [details] [diff] [review]
patch
Review of attachment 689945 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/phonenumberutils/PhoneNumberUtils.jsm
@@ +40,5 @@
> mcc = ril.voiceConnectionInfo.network.mcc;
>
> // Get SIM mcc or set it to mcc for Brasil
> if (!mcc)
> + mcc = ril.iccInfo.mcc || Services.prefs.getIntPref("ril.lastmcc");
getIntPref will throw if the pref doesn't exist.
@@ +43,5 @@
> if (!mcc)
> + mcc = ril.iccInfo.mcc || Services.prefs.getIntPref("ril.lastmcc");
> +
> + if (!mcc) {
> + dump("WARNING: Using the default country code for normalizing telephone numbers!\n");
Let's also add another warning if we use the pref version.
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #689945 -
Attachment is obsolete: true
Attachment #689945 -
Flags: review?(bent.mozilla)
Updated•12 years ago
|
blocking-basecamp: ? → +
Assignee | ||
Comment 5•12 years ago
|
||
I think we should move this to RIL and maybe add it to nsIDOMMozMobileICCInfo.
something like
ril.voiceConnectionInfo.network.previousMcc
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #689960 -
Attachment is obsolete: true
Attachment #690586 -
Flags: review?(jonas)
Assignee | ||
Updated•12 years ago
|
Depends on: 820135
Summary: PhonenumberJS: remember the last mcc code → RIL: remember the last mcc code
Comment on attachment 690586 [details] [diff] [review]
patch
Review of attachment 690586 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with those things fixed.
::: dom/network/interfaces/nsIDOMMobileConnection.idl
@@ +431,5 @@
>
> /**
> + * Mobile Country Code (MCC) of previous subscriber's home network.
> + */
> + readonly attribute unsigned short previousMcc;
I'd call this lastKnownMcc or something. Right now it sounds like it's the previous value that the mcc has had, but in reality it can often be the same value as the mcc.
::: dom/system/gonk/RILContentHelper.js
@@ +360,5 @@
> updateICCInfo: function updateICCInfo(srcInfo, destInfo) {
> for (let key in srcInfo) {
> destInfo[key] = srcInfo[key];
> + if (key === 'mcc') {
> + Services.prefs.setIntPref("ril.previousMcc", srcInfo[key]);
Shouldn't you also set the previousMcc property here?
Attachment #690586 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment 10•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•