RIL: remember the last mcc code

RESOLVED FIXED in Firefox 19

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

unspecified
mozilla20
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(blocking-basecamp:+, firefox19 fixed, firefox20 fixed, b2g18 fixed)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

6 years ago
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

6 years ago
Assignee: nobody → anygregor
(Assignee)

Comment 1

6 years ago
Created attachment 689942 [details] [diff] [review]
patch
Attachment #689942 - Flags: review?(bent.mozilla)
(Assignee)

Updated

6 years ago
blocking-basecamp: --- → ?
(Assignee)

Comment 2

6 years ago
Created attachment 689945 [details] [diff] [review]
patch
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

6 years ago
Created attachment 689960 [details] [diff] [review]
patch
Attachment #689945 - Attachment is obsolete: true
Attachment #689945 - Flags: review?(bent.mozilla)

Updated

6 years ago
blocking-basecamp: ? → +
(Assignee)

Comment 5

6 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

6 years ago
Created attachment 690586 [details] [diff] [review]
patch
Attachment #689960 - Attachment is obsolete: true
Attachment #690586 - Flags: review?(jonas)
(Assignee)

Updated

6 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+

Comment 9

6 years ago
https://hg.mozilla.org/mozilla-central/rev/22c6700c8794
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
https://hg.mozilla.org/releases/mozilla-aurora/rev/5d10c266fa86
https://hg.mozilla.org/releases/mozilla-b2g18/rev/91bf204e2f3f
status-b2g18: --- → fixed
status-firefox19: --- → fixed
status-firefox20: --- → fixed
You need to log in before you can comment on or make changes to this bug.