Closed Bug 827764 Opened 11 years ago Closed 11 years ago

[Settings] Date&Time: "Set automatically" is not working as expected without NITZ

Categories

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

x86_64
Windows 7
defect
Not set
normal

Tracking

(blocking-b2g:tef+, blocking-basecamp:-, b2g18+ fixed, b2g18-v1.0.0 fixed)

VERIFIED FIXED
blocking-b2g tef+
blocking-basecamp -
Tracking Status
b2g18 + fixed
b2g18-v1.0.0 --- fixed

People

(Reporter: carlosmartinez, Assigned: kaze)

References

Details

(Whiteboard: [triaged:1/15])

Attachments

(1 file)

Tested in unagi with Gecko-e39daf3.Gaia-e24d066.

STR:
1-Open settings app
2-Go to personalization -> Date&Time
3-Uncheck configure automatically
4-Select a different timezone and verify that time is changed
5-Check again configure automatically

Expected result --> Time should change again to the one provided by the carrier

Actual result --> Time is not changing at all
blocking-basecamp: --- → ?
It's obviously not ideal, but we won't hold the release for this issue. Would take a patch for it.
blocking-basecamp: ? → -
tracking-b2g18: --- → +
To note, this affects the order of SMS messages : see https://bugzilla.mozilla.org/show_bug.cgi?id=827725#c5

I had to set the android device not to set the time automatically in order to make this bug occur.  My b2g devices were both set to setting the time automatically.  The misconception in bug 827725 would not have occurred if the time was set correctly when time setting is set to automatic.
blocking-b2g: --- → tef?
Assignee: nobody → kaze
blocking-b2g: tef? → tef+
Whiteboard: [triaged:1/15]
kaze - do you have an estimate of when this tef+ issue will be resolved?
Alex: working on it, thanks for the heads-up.
Works for me: when I get back to automatic time, the time is properly updated. My carrier is Free Mobile.

Carlos: are you sure your carrier supports NITZ?
(In reply to Fabien Cazenave [:kaze] from comment #5)
> Works for me: when I get back to automatic time, the time is properly
> updated. My carrier is Free Mobile.
> 
> Carlos: are you sure your carrier supports NITZ?

Seems like Movistar Spain is not supporting NITZ. I don´t know if there´s any kind of alternative solution for this, for the carriers not supporting NITZ, is there?
As NITZ is not supported by all carriers, do we need to show a message prompt for user feedback ?
Flags: needinfo?(jcarpenter)
Flags: needinfo?(dcoloma)
The problem is that IIRC there is no way to check if NITZ is working or not (from a network point of view).

The only target market for V1 in which that is happening is Spain. 

Just thinking aloud, Kaze, could we hide the "automatic" option in case a Movistar SIM Card Spain is inserted...
Flags: needinfo?(dcoloma) → needinfo?(kaze)
I think we should keep this bug focused on the actual problem.

If there's a workaround for v1, I'd rather get that off into a different bug. But I think shira is too close to fool ourselves that we've got this covered with a hack for one spanish sim card.
Currently, the Gecko doesn't expose any info of whether the NITZ is available or not to the Gaia end. How the NITZ mechanism works in Gecko is listening to the "time.nitz.automatic-update.enabled" setting (true/false) and do the following branches:

- If enabled, then check if the NITZ info is available.
  - If NITZ is available, then
    - reset the clock time and fire a "moztimechange" event and
    - reset the timezone by the "time.timezone" setting and fire both "settingchanged"/"moztimechange" events.
  - If NITZ is not available, then nothing to do [1].
- If disabled, then nothing to do [1].

[1] keep current the time/timezone as it is.
(In reply to Daniel Coloma:dcoloma from comment #8)
> The problem is that IIRC there is no way to check if NITZ is working or not
> (from a network point of view).
> 
> The only target market for V1 in which that is happening is Spain. 
> 
> Just thinking aloud, Kaze, could we hide the "automatic" option in case a
> Movistar SIM Card Spain is inserted...

If the active carrier does not support NITZ, and the system knows that (whether by auto-detection, or an internally managed list of non-supporting carriers) two UX options are:

1. Hide the setting and only display manual configuration controls 
2. Show the setting, but gray it out and display a brief explanatory below. eg: "[CarrierName] does not support automatic time zone detection".

With that caveat that I have not had time to think through all the edge cases, either option would be acceptable from UX stand point.
Flags: needinfo?(jcarpenter)
(re-comment for comment #12 to make it more readable)

Currently, the Gecko doesn't expose any info of whether the NITZ is available or not to the Gaia end. How the NITZ mechanism works in Gecko is listening to the "time.nitz.automatic-update.enabled" setting (true/false) and do the following branches:

- If enabled, then check if the NITZ info is available.
    - If NITZ is available, then
        - reset the clock time [1] and
        - reset the time zone by changing the "time.timezone" setting [2].
    - If NITZ is not available, then nothing to do [3].
- If disabled, then nothing to do [3].

[1] fire a "moztimechange" event to the content.
[2] fire both "settingchanged" and "moztimechange" events to the content.
[3] keep the current time/timezone as it is.
Just to make it clear: this bug is caused by the lack of NITZ support. I thought that the targeted network supports NITZ, so should we really set tef+ on this bug?

(In reply to Daniel Coloma:dcoloma from comment #8)
> Kaze, could we hide the "automatic" option in case a
> Movistar SIM Card Spain is inserted...

Agreed, we should implement one of Josh’s proposals… as soon as we have some platform support to know if NITZ is available or not.
Flags: needinfo?(kaze)
Summary: [SETTINGS][PERSONALIZATION] Date&Time: Set automatically is not working as expected → [Settings] Date&Time: "Set automatically" is not working as expected without NITZ
(In reply to Fabien Cazenave [:kaze] from comment #15)
> Just to make it clear: this bug is caused by the lack of NITZ support. I
> thought that the targeted network supports NITZ, so should we really set
> tef+ on this bug?

Movistar Spain does not support NITZ and hence comment 8 :(
Depends on: 833060
Triage wanted to emphasize that this is a blocker because we're assuming the negative user experience of the time being incorrect.
Attached file link to pull request
https://github.com/mozilla-b2g/gaia/pull/7808

If the `time.nitz.available' setting is false, the “Set automatically” button is hidden and set to false.

This requires a very recent b2g18 Gecko, as bug 833060 landed a few hours ago. However this didn’t work with my carrier (Free mobile, France)… and that’s a back-end issue. :-/

Please let me know if it works for other carriers.
Attachment #706466 - Flags: review?(alive)
Comment on attachment 706466 [details]
link to pull request

r=me.

I have to say I don't think gecko using settings to communicate with gaia is an ideal way. Anyone have settings permission could change the value of `time.nitz.avaiable`. But we have no other way except system message or new API and this is blocking v1 so.
Attachment #706466 - Flags: review?(alive) → review+
https://github.com/mozilla-b2g/gaia/commit/f366f2e0241610cc84850212358e31d815508564

I agree communicating through settings is sub-optimal, but as you mentioned this is a short-term decision. :-(
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
(In reply to Fabien Cazenave [:kaze] from comment #18)
> This requires a very recent b2g18 Gecko, as bug 833060 landed a few hours
> ago. However this didn’t work with my carrier (Free mobile, France)… and
> that’s a back-end issue. :-/
> 
> Please let me know if it works for other carriers.

Please see bug 833060, comment #18. It works for Chungwa carrier in Taiwan. That is, the setting "time.nitz.available" can successfully return true to you. If you remove the SIM card before booting, then the "time.nitz.available" will tell you a false value. I have difficulty reproducing this symptom. Could anyone please give it a try if you have the SIM card supporting NITZ (or not) on hand?
(In reply to Gene Lian [:gene] from comment #21)
> (In reply to Fabien Cazenave [:kaze] from comment #18)
> > This requires a very recent b2g18 Gecko, as bug 833060 landed a few hours
> > ago. However this didn’t work with my carrier (Free mobile, France)… and
> > that’s a back-end issue. :-/
> > 
> > Please let me know if it works for other carriers.
> 
> Please see bug 833060, comment #18. It works for Chungwa carrier in Taiwan.
> That is, the setting "time.nitz.available" can successfully return true to
> you. If you remove the SIM card before booting, then the
> "time.nitz.available" will tell you a false value. I have difficulty
> reproducing this symptom. Could anyone please give it a try if you have the
> SIM card supporting NITZ (or not) on hand?

I´ve tried this with a VIVO SIM (with NITZ support) and a Movistar SIM (without NITZ support), and I see the same, automatic time setting is available for both.

I´m testing in an unagi with Gecko-cfad7c9.Gaia-6c53dfd.
(In reply to Carlos Martínez Toral [:carlosmartinez] from comment #22)
> I´ve tried this with a VIVO SIM (with NITZ support) and a Movistar SIM
> (without NITZ support), and I see the same, automatic time setting is
> available for both.

Thanks for testing this! It's a bit weird for the Movistar SIM (without NITZ support). What happened if you further enable the "Set automatically"? Would the time be automatically adjusted to the correct time?
(In reply to Carlos Martínez Toral [:carlosmartinez] from comment #22)
> I´ve tried this with a VIVO SIM (with NITZ support) and a Movistar SIM
> (without NITZ support), and I see the same, automatic time setting is
> available for both.

I'm pretty sure the only chance to set "time.nitz.available" to true in Gecko is getting a NITZ info from the carrier supporting NITZ. I still don't understand why it's possible to receive a NITZ from the Movistar SIM (without NITZ support).

> I´m testing in an unagi with Gecko-cfad7c9.Gaia-6c53dfd.
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
Sorry I don't know how to check the version numbers here. Where do they come from? I *guess* maybe this version set doesn't include Kaze's patch for solving this bug, which means you will always see the "Set automatically" present on the UI. However, it won't work for Movistar SIM when you further enable it (the time won't be automatically adjusted).

Carlos, may I have your double check to see if this version set already includes Kaze's patch? If yes, then I'm highly suspecting you might probably get the SIM cards wrong or maybe Movistar SIM actually supports NITZ. I could be wrong. Please correct me. :)
Flags: needinfo?(carlos.martinez)
(In reply to Gene Lian [:gene] from comment #24)
> (In reply to Carlos Martínez Toral [:carlosmartinez] from comment #22)
> > I´ve tried this with a VIVO SIM (with NITZ support) and a Movistar SIM
> > (without NITZ support), and I see the same, automatic time setting is
> > available for both.
> 
> I'm pretty sure the only chance to set "time.nitz.available" to true in
> Gecko is getting a NITZ info from the carrier supporting NITZ. I still don't
> understand why it's possible to receive a NITZ from the Movistar SIM
> (without NITZ support).
> 
> > I´m testing in an unagi with Gecko-cfad7c9.Gaia-6c53dfd.
>                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
> Sorry I don't know how to check the version numbers here. Where do they come
> from? I *guess* maybe this version set doesn't include Kaze's patch for
> solving this bug, which means you will always see the "Set automatically"
> present on the UI. However, it won't work for Movistar SIM when you further
> enable it (the time won't be automatically adjusted).
> 
> Carlos, may I have your double check to see if this version set already
> includes Kaze's patch? If yes, then I'm highly suspecting you might probably
> get the SIM cards wrong or maybe Movistar SIM actually supports NITZ. I
> could be wrong. Please correct me. :)

Seems like the version I´m testing on in my last comment doesn´t have the patch, because I have retested with 20130129120050 build and is working fine. I don´t have the option to set time automatically with a Movistar SIM.
Flags: needinfo?(carlos.martinez)
(In reply to Carlos Martínez Toral [:carlosmartinez] from comment #25)
> Seems like the version I´m testing on in my last comment doesn´t have the
> patch, because I have retested with 20130129120050 build and is working
> fine. I don´t have the option to set time automatically with a Movistar SIM.

Sweet! Thanks for the double check! It explains the unexpected phenomenon at comment #22 and this function seems working well now. :D

Then we still have only one problem left at bug 833060, comment #18. Kaze, may I have your feedback when you have time? Sorry there's no way for me to test the Free mobile by myself in Taiwan. Need your help.
jhford - can you confirm that this was uplifted to the v1.0.0 branch and is on v1-train as well?
Please see comment #27.
Flags: needinfo?(jhford)
Yes, this was landed by kaze on v1-train and v1.0.0:

v1-train: abe658a2365eb9df2bcdab363e8f8bb9b5d29d7b
v1.0.0: f0c24380a19d5135d533c21617a572f49ae1f489
Flags: needinfo?(jhford)
This issue is not reproducing on Unagi,
Build ID: 20130215070202
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/a9e4f8912607
Gaia : 21ba59d933c66024cb351c2379315301d5352e0c
Kernal: Dec 5th Kernel
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: