Closed Bug 948222 Opened 11 years ago Closed 10 years ago

Operator shelf not showing up on Dual SIM phone

Categories

(Marketplace Graveyard :: Consumer Pages, defect, P1)

All
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED
2013-12-17

People

(Reporter: krupa.mozbugs, Assigned: cvan)

References

Details

Attachments

(1 file)

Fugu device (1.3)
build identifier:20131208063021

steps to reproduce:
1. Insert Movistar SIM(Spain) in slot 1 as primary SIM
2. Leave slot 2 empty
3. Restart the phone
4. Launch marketplace
5. Check the category dropdown list


expected behavior:
Operator shelf for movistar shows up

observed behavior:
Operator shelf for movistar doesn't show up

ashes: adbab

logcat shows
adb logcat | grep -E 'MCC|MNC'
E/GeckoConsole( 2744): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=ff444c0-52a65aa4:4 in s/<: [mobilenetwork][undefined][detectMobileNetwork] Using SIM MCCs: []
Krupa, I've created a new version of Carrier Info now with dual SIM support!!!!1111

https://marketplace.firefox.com/app/carrier-info

Can you please install that app and let me know what the values are? A screenshot and logs from `adb logcat | grep -E 'MCC|MNC|mozMobileConnection'` would be much appreciated! Many thanks!
Assignee: nobody → cvan
Krupa, can you fire up Carrier Info and let me know? Thanks!
Flags: needinfo?(krupa.mozbugs)
Carrier info app says

navigator.mozMobileConnection
    Connection unavailable
navigator.mozMobileConnections
1. {}
2. {}
Flags: needinfo?(krupa.mozbugs)
(In reply to krupa raj[:krupa] from comment #3)
> Carrier info app says
> 
> navigator.mozMobileConnection
>     Connection unavailable
> navigator.mozMobileConnections
> 1. {}
> 2. {}

That seems to suggest that the platform pieces are not working.

Here is the code for Carrier Info:

    https://github.com/cvan/carrierinfo/blob/master/detect.js

CCing a few folks to confirm that dual SIM support has indeed landed and is indeed working and that our usage is correct.

Krupa has a dual SIM and is using the following phone:

Fugu device (1.3)
build identifier: 20131208063021
Hsin-Yi - Is this a platform bug with the mobile connections API?
Flags: needinfo?(htsai)
FYI, I'm on marketplace prod.
(In reply to krupa raj[:krupa] from comment #6)
> FYI, I'm on marketplace prod.

That won't make a difference if we're talking about the output of `navigator.mozMobileConnections` (from Carrier Info).
(In reply to Christopher Van Wiemeersch [:cvan] from comment #7)
> (In reply to krupa raj[:krupa] from comment #6)
> > FYI, I'm on marketplace prod.
> 
> That won't make a difference if we're talking about the output of
> `navigator.mozMobileConnections` (from Carrier Info).

Hi I just looked at the code 
  https://github.com/cvan/carrierinfo/blob/master/detect.js
and realized there's a problem with usage:

We get nothing from stringify mozMobileConnections. I have no idea why and how, but the fact is we get nothing, not only for mozMobileConnections but also for other objects created by gecko. Other gaia folk told me the way they are using is null check for mozMobileConnections.
Flags: needinfo?(htsai)
Can you elaborate and/or provide examples?
(In reply to Matt Basta [:basta] from comment #9)
> Can you elaborate and/or provide examples?

Hi Matt, I am not quite sure what more information you're looking for, but what I was trying to say is
1) Getting {} by JSON.stringify(mozMobileConnections) seems nothing wrong as my comment 8.
2) The check other gaia folks use is like [1]. Please don't rely on the result of JSON.stringify.
3) I am also not sure if there's a more explicit way to printing or checking each element of mozMobileConnections from gaia side. We might need to pin some gaia folks here for better understanding. 

[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/settings.js#L851
After you've taken an index (à la https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/settings.js#L851) - I don't see anything wrong with JSON.stringify'ing the object.

When I was landing the Marketplace pieces, I couldn't find any code in gaia that actually looks at the `data` values in `navigator.mozMobileConnections`.

I see this mock `navigator.mozMobileConnections` has been added for testing:
https://github.com/mozilla-b2g/gaia/blob/master/shared/test/unit/mocks/mock_navigator_moz_mobile_connections.js

I see many instances of this snippet of code copy+pasted throughout the repo:
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/call_forwarding.js#L28-L32

But I'm still unsure of any examples of calling `navigator.mozMobileConnections` to display the connection/SIM information. If what I'm doing is wrong, can someone point me to a code snippet that can clearly print what the values are from the API?
Priority: -- → P1
(In reply to Christopher Van Wiemeersch [:cvan] from comment #11)
> After you've taken an index (à la
> https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/settings.
> js#L851) - I don't see anything wrong with JSON.stringify'ing the object.
> 
> When I was landing the Marketplace pieces, I couldn't find any code in gaia
> that actually looks at the `data` values in `navigator.mozMobileConnections`.
> 
> I see this mock `navigator.mozMobileConnections` has been added for testing:
> https://github.com/mozilla-b2g/gaia/blob/master/shared/test/unit/mocks/
> mock_navigator_moz_mobile_connections.js
> 
> I see many instances of this snippet of code copy+pasted throughout the repo:
> https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/
> call_forwarding.js#L28-L32
> 
> But I'm still unsure of any examples of calling
> `navigator.mozMobileConnections` to display the connection/SIM information.
> If what I'm doing is wrong, can someone point me to a code snippet that can
> clearly print what the values are from the API?

Hi cvan,

I talked with some gaia guys. They told me they also have no idea about how to look at the data values in 'navigator.mozMobileConnections.' As I replied before, JSON.stringify() cannot output the the values of the objects *created by gecko*, and we still don't know why.

However, if you want to look at the value of a *single* attribute, then it's okay.
For example, it's fine to print iccId by 'navigator.mozMobileConnections[0].iccId.' 

Arthur, could you please shed some light here? And please correct me if I am wrong. Thank you.
Flags: needinfo?(arthur.chen)
As Hsin-yi suggested, we can print any single attribute. To enumerate attributes and functions, we can also do the following:

for (var p in navigator.mozMobileConnections[0]) {
   dump(p + ": " + navigator.mozMobileConnections[0][p]);
}
Flags: needinfo?(arthur.chen)
I will test and post back in this bug with my findings. Thanks for your help, Hsin-Yi and Arthur. I do appreciate it.
Target Milestone: --- → 2013-12-17
Krupa, I've updated my app. Can you update your Carrier Info?

https://marketplace.firefox.com/app/carrier-info/
Blocks: 942355
Cvan - 
Latest status? Do you need additional help on this from the device side folk? 
Happy to help drum up attention.
Flags: needinfo?(cvan)
It appears that the expected format provided in bug 942355 comment 15 was wrong. I've fixed the format:

https://github.com/mozilla/fireplace/commit/ae82566
Updated prod, -dev, and stage packages.

Krupa: can you please confirm that it works now?
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(cvan) → needinfo?(krupa.mozbugs)
Resolution: --- → FIXED
Attached image carrier info
This is what I see on carrier-info app.

However, When i have a SIM1 = Movistar and SIM 2 =  ATT, operator shelf doesn't show up and the region is set to US instead of Spain.
Flags: needinfo?(krupa.mozbugs)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
krupa: what is the value of 1.lastKnownNetwork? because when I last checked on your phone 0.lastKnownNetwork=310-410 as well as 1.lastKnownNetwork=310-410 which represents an MCC/MNC pair for an ATT US SIM.
Flags: needinfo?(krupa.mozbugs)
Both 0.lastKnownNetwork and 1.lastKnownNetwork are showing up as 310-410 even though the primary SIM is a Movistar SIM. This might be because I'm on roaming and it is using ATT currently.
Flags: needinfo?(krupa.mozbugs)
(In reply to krupa raj[:krupa] from comment #20)
> Both 0.lastKnownNetwork and 1.lastKnownNetwork are showing up as 310-410
> even though the primary SIM is a Movistar SIM. This might be because I'm on
> roaming and it is using ATT currently.

I'm not sure what I can do then, if both of your SIMs are showing up as AT&T US. Is there someone on the gaia team that can clear things up?
Flags: needinfo?(htsai)
(In reply to Christopher Van Wiemeersch [:cvan] from comment #21)
> (In reply to krupa raj[:krupa] from comment #20)
> > Both 0.lastKnownNetwork and 1.lastKnownNetwork are showing up as 310-410
> > even though the primary SIM is a Movistar SIM. This might be because I'm on
> > roaming and it is using ATT currently.
> 
> I'm not sure what I can do then, if both of your SIMs are showing up as AT&T
> US. Is there someone on the gaia team that can clear things up?

Thanks for reporting this. It's a bug we need to fix. I'm going to file a new bug for that and set dependency correctly.
Flags: needinfo?(htsai)
Depends on: 952371
Blocked on bug 952371
Krupa - can you retest this?  Looks like the blocker bug is closed.
(In reply to Wil Clouser [:clouserw] from comment #24)
> Krupa - can you retest this?  Looks like the blocker bug is closed.

Krupa ^
Flags: needinfo?(krupa.mozbugs)
On my Fugu device, I see http://cl.ly/image/1S072C3f463w. On my Flame with 2.0, Carrier app keeps crashing. I am trying to find a device on which I can check this issue again.
Flags: needinfo?(krupa.mozbugs)
Closed so you can reverify, with a working device hopefully.
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: