Closed Bug 911684 Opened 11 years ago Closed 11 years ago

[FTU] hide SIM contact import when not support telephony

Categories

(Firefox OS Graveyard :: Gaia::First Time Experience, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gasolin, Assigned: gasolin)

References

Details

(Whiteboard: [Flatfish only])

Attachments

(2 files)

hide SIM contact import when device not support telephony
Blocks: flatfish
blocking-b2g: --- → koi?
Assignee: nobody → gasolin
hide sim import section by reusing 'this.mobConn' to detect if window.navigator.mozMobileConnection not exist
Attachment #798685 - Flags: review?(fbsc)
blocking-b2g: koi? → koi+
Taking a look to the patch! :)
Comment on attachment 798685 [details]
pull request redirect to github

Small comment to address. Please add a test for the fix! Feedback+ and waiting your changes for making the final review with changes required (patch works great btw :)).
Please ask me to review when you will be ready! Thanks! Gracias ;)
Attachment #798685 - Flags: review?(fbsc) → feedback+
Comment on attachment 798685 [details]
pull request redirect to github

I've add testcase for no telephony case.
Please kindly review it again, thanks
Attachment #798685 - Flags: review?(fbsc)
Hi, anything I can help for this issue?
Flags: needinfo?(fbsc)
Im taking a look right now! :)
Flags: needinfo?(fbsc)
Hi Fred,
I've sent you a small fix to the tests (it's not related with your patch, but I think is needed for checking that new tests are testing our real HTML :) ). Link here https://github.com/gasolin/gaia/pull/2 . Could you take a look? Thanks!!
Flags: needinfo?(gasolin)
looks good, merge to this PR. thanks!
Flags: needinfo?(gasolin)
Fred, one doubt. When you mean that 'mozMobileConnection' is not available, you mean that we have a device without SIM? How can I test the patch? Thanks!
Flags: needinfo?(gasolin)
(assume you are in oslo) please go to george to test on tablet (which without SIM)
Flags: needinfo?(gasolin)
Hi Fred,
I believe you already tried on another tablet.
However, it seems not work on the device I have, mozMobileConnection still exist in navigator.

Hi Viral,
will window.navigator.mozMobileConnection still exist on tablet device? Currently, we use it to disable some communication function in gaia. I think we should perhaps remove it if the device doesn't support it..
Flags: needinfo?(vwang)
(In reply to George Duan [:gduan] from comment #11)
> will window.navigator.mozMobileConnection still exist on tablet device?
> Currently, we use it to disable some communication function in gaia. I think
> we should perhaps remove it if the device doesn't support it..

So far we still use window.navigator.mozMobileConnection in tablet but it will not work in flatfish. 
I'm thinking we should have some generic control in gaia to define what function we should support, otherwise different functions will use their own way to check the function is needed or not.
Flags: needinfo?(vwang)
(add tim in loop)

Viral, do you mean we still HAVE `window.navigator.mozMobileConnection` API in flatfish but that API is not work? What default return value will be?


per discussion with tim, it's more reasonable to not provide such API(window.navigator.mozMobileConnection/mozTelephony) if telephony is not support. Then developer could use feature detection approach as they do in general web.
Flags: needinfo?(vwang)
after some diving to customization code, I found we can disable dom api by add partner-prefs.js in gaia customization.

ex:

prefs.push(['dom.navigator-property.disable.mozMobileConnection', true]);

@yuren, is it right?
Flags: needinfo?(yurenju.mozilla)
I didn't use this feature but looks it will be included into user.js if exists in distribution directory.
Flags: needinfo?(yurenju.mozilla)
just test user_pref('dom.navigator-property.disable.mozMobileConnection', true/false); on real device, seems not work though. 

If we decide to use this approach, we still need gecko expose such user_pref.
Blocks: 911676
Hi Vicamo,

Per offline dicussion, please kindly open a new bug as comment 16 , we need to be able to set dom.navigator-property.disable.mozMobileConnection in user_pref.

Thanks.
Flags: needinfo?(vyang)
Comment on attachment 798685 [details]
pull request redirect to github

Im gonna remove the review because this needs some Gecko work yet. Let me know when this is ready for testing and I'll come back to review it! Thanks :)
Attachment #798685 - Flags: review?(fbsc)
We didn't do the real-device test but rely on an un-sync assumption.

Thanks Borja to bring it on to the table.
(In reply to Fred Lin [:gasolin] from comment #13)
> (add tim in loop)
> 
> Viral, do you mean we still HAVE `window.navigator.mozMobileConnection` API
> in flatfish but that API is not work? What default return value will be?

Sorry for confusing here, what I mean API is not work is that we don't need those the telephony function in flatfish. So the information like 'no sim card' is no need on our usage.
Flags: needinfo?(vwang)
Depends on: 920551
Flags: needinfo?(vyang)
No longer blocks: 911676
Whiteboard: [Flatfish only]
Depends on: 928643
No longer depends on: 920551
test on real device and works well
Comment on attachment 798685 [details]
pull request redirect to github

We've finally have a device that disabled mozConnection API, the patch works well on it
Attachment #798685 - Flags: review?(borja.bugzilla)
Flatfish has been moved to 1.4, so moving to 1.4?
blocking-b2g: koi+ → 1.4?
Hi Fred! Could :alive take a look to the device with this patch? Im gonna add a 'feedback?' flag, so if he confirm that the behavior is the right one in the Tablet (I have no device for testing :( ) I'll review the patch again! Thanks!
Comment on attachment 798685 [details]
pull request redirect to github

Hi Alive! Could you take a look to this patch tested in the real device? I would like to ensure that it's working on the device, but I have not a real one! Could you feedback+ if it's working? Thanks!
Attachment #798685 - Flags: feedback?(alive)
Comment on attachment 798685 [details]
pull request redirect to github

f+ from seeing fred's device.
Attachment #798685 - Flags: feedback?(alive) → feedback+
I've rewrote some unit test and reuse the shared/load_body_html_helper, so FTU test not need to use mock_html_import anymore, but use the real index.html to construct DOM.
Blocks: 942681
Great job Fred! It's working perfectly on the device! R+ from my side.
blocking-b2g: 1.4? → ---
Attachment #798685 - Flags: review?(borja.bugzilla) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 943758
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: