Closed Bug 962912 Opened 10 years ago Closed 10 years ago

Custom APN fail to apply if default APN does not exist

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

x86
Linux
defect
Not set
normal

Tracking

(blocking-b2g:1.3+, b2g-v1.3 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed)

RESOLVED FIXED
1.3 C3/1.4 S3(31jan)
blocking-b2g 1.3+
Tracking Status
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: pgravel, Assigned: jaoo)

Details

(Whiteboard: [caf priority: p3][cr 596106])

Attachments

(1 file, 1 obsolete file)

If there is no default APN for a sim card, custom APN settings fail to apply. This issue was seen when using a sim card that was not recognized by the apn database.

This is due to a bad assumption in the buildAndStoreApnSettings function in apps/settings/carrier.js
When applying new APN settings the code tries to merge the new settings with the existing APNs. However, if no APN exist for that card then the for loop never gets executed and the new apnToBeMerged data never gets applied.

Can be solved by adding a check before the for loop:

> if (apnsForIccCard.length == 0) {
>   apnToBeMerged.types = [type];
>   newApnsForIccCard.push(apnToBeMerged);
> } else {
>   for (var apnIndex = 0; apnIndex < apnsForIccCard.length; apnIndex++) {
>      ...
>   }
> }
blocking-b2g: 1.3? → 1.3+
Jose, would you be able to fix this bug?
Flags: needinfo?(josea.olivera)
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #1)
> Jose, would you be able to fix this bug?

Yes, it under my radar. I'll take once I finish the other 1.3+ I have. (I expect to fix this issue early next week).
Flags: needinfo?(josea.olivera)
Flags: needinfo?(josea.olivera)
Assignee: nobody → josea.olivera
Flags: needinfo?(josea.olivera)
I'll try to do my best and fix this bug before 01/31 but as I commented I'll take once I finish the other 1.3+ I have.
Could you give a try and check whether the issue is gone please? Thanks!
Flags: needinfo?(pgravel)
Verified the patch fixes the issue. Thanks for the quick turnaround!
Flags: needinfo?(pgravel)
Comment on attachment 8365922 [details] [review]
Pointer to Github PR https://github.com/mozilla-b2g/gaia/pull/15726

Fabien, after latest changes in cellular and data settings it seems we did not handle and store the custom APNs properly. This patch fix the issue and It has been also verified by the reporter. Could you take a look at it please? Thanks.
Attachment #8365922 - Flags: review?(kaze)
Comment on attachment 8365922 [details] [review]
Pointer to Github PR https://github.com/mozilla-b2g/gaia/pull/15726

Your patch makes sense, thanks for the quick fix.

Let’s keep an eye on this fix, please: as I’m still waiting for my DSDS device, I can’t test this in a real dual-SIM situation.
Attachment #8365922 - Flags: review?(kaze) → review+
Thanks Fabien! Landed in Gaia master branch at https://github.com/mozilla-b2g/gaia/commit/40d05ad9377cc176e9cd097082ef78a73688e4b1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
Uplifted 40d05ad9377cc176e9cd097082ef78a73688e4b1 to:
v1.3: 1b56ca5e1b7e001fd9aa5cded2b48da36cd38084
Whiteboard: [cr 596106]
Flags: in-moztrap?
Flags: in-moztrap? → in-moztrap-
Whiteboard: [cr 596106] → [caf priority: p3][cr 596106]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: