Closed Bug 868902 Opened 11 years ago Closed 11 years ago

[Buri]data connection and hotspot still enabled without SIM

Categories

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

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sync-1, Assigned: johnhu)

Details

(Whiteboard: [mentorinfo][mentor=evelyn])

Attachments

(1 file)

SW126
 AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.085
 Firefox os  v1.0.1
 Mozilla build ID:20130422230201
 
 +++ This bug was initially created as a clone of Bug #448587 +++
 
 DEFECT DESCRIPTION:
  data connection and WiFi hotspot still enabled without SIM
 
  REPRODUCING PROCEDURES:
  1. switch on with SIM card
  2. settings->Cellular & Data->enable "data connection"
  3. settings->Internet sharing->enable "Wi-Fi hotspot"
  4. power off and remove SIM
  5. switch on without SIM card
  6. internet sharing icon showed on title bar->KO1
  7. enter settings, shows "No SIM card" under "Cellular & Data", enter   "Cellular & Data", "data connection" still enabled.->KO2
  8. settings->Internet sharing, "Wi-Fi hotspot" still enabled -> KO3     
 
  EXPECTED BEHAVIOUR:
  for KO1 -- don't show internet sharing icon if no SIM card
  for KO2, KO3 -- must be disabled without SIM card
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
 
  REPRODUCING RATE:
 
  For FT PR, Please list reference mobile's behavior:
 
 ++++++++++ end of initial bug #448587 description ++++++++++
 
 
 
 CONTACT INFO (Name,Phone number):
 
  DEFECT DESCRIPTION:
 
  REPRODUCING PROCEDURES:
 
  EXPECTED BEHAVIOUR:
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
 
  REPRODUCING RATE:
 
  For FT PR, Please list reference mobile's behavior:
To solve this, shall we just disable the Cellular and Data, Call Settings, Sim security panal or add a listener to mozMobileConnection.cardstate, when the cardstate is 'null', 'unknown' or 'absent', we disabled all the settings related to simcard??????
Flags: needinfo?(swu)
We want to disable them temporarily, and back to previous settings when SIM card available again, right?

The situation is similar to airplane mode, and the latter approach (listen to mozMobileConnection.cardstate) seems fine to me.

How do you think, Evelyn?
Flags: needinfo?(swu) → needinfo?(ehung)
Assignee: nobody → johu
Yes, we should do that. Arthur or I can mentor someone to fix this.
Assignee: johu → nobody
Flags: needinfo?(ehung)
Whiteboard: [mentorinfo][mentor=evelyn]
This bug seems not just a UI behavior. It needs to check the simcard state while booting up and changes the wrong settings of non-simcard state. Am I right???

And, in the same case, do we need to disable these settings UI in settings App, such as, all settings under Cellular & Data, and Internet Sharing ??
Flags: needinfo?(ehung)
(In reply to John Hu [:johnhu] from comment #4)
> This bug seems not just a UI behavior. It needs to check the simcard state
> while booting up and changes the wrong settings of non-simcard state. Am I
> right???
Yes, grep 'mozMobileConnection.cardstate' to know its usage.

> And, in the same case, do we need to disable these settings UI in settings
> App, such as, all settings under Cellular & Data, and Internet Sharing ??
I think so.. but may need UX confirm.
Flags: needinfo?(ehung)
UX guys:

If our phone doesn't have simcard which means we don't have the ability to do cellular, data connection, or internet sharing through, do we just disable the top-most setting menu items, such as Call Settings, Cellular & Data, and Internet sharing??? Or we need to disable the sub menu items under those top-most menu items??
Flags: needinfo?(firefoxos-ux-bugzilla)
Assignee: nobody → johu
No longer depends on: 869873
Depends on: 869873
Jose, 

The KO2 and KO3 look like a dup of bug 869873. But the KO1 seems need the change the behavior of system boot up.
(In reply to John Hu [:johnhu] from comment #6)
> UX guys:
> 
> If our phone doesn't have simcard which means we don't have the ability to
> do cellular, data connection, or internet sharing through, do we just
> disable the top-most setting menu items, such as Call Settings, Cellular &
> Data, and Internet sharing??? Or we need to disable the sub menu items under
> those top-most menu items??

Hi John,
IMHO, for the internet sharing, we shouldn't just disable it when no sim card. Because we can also use the usb tethering share our wifi connection without sim card.
And in the airplane mode, it's ok just disable the internet sharing.
What do think?
Flags: needinfo?(johu)
We can turn on WiFi manually when in airplane mode. I would suggest leave the internet sharing item enabled.
Hi Xiao Kang and Arthur, 

Thanks for your information. I am not sure if we have the ability to share wifi connection through usb to pc. As a normal android usage, USB Tethering is for sharing 3G data connection to PC with USB connected, and wifi sharing is for sharing 3G data connection to others with wifi. 

If we have the ability to bridge wifi connection to USB or vice versa, I accept your suggestions.
Flags: needinfo?(johu)
Yes, we have USB tethering with external Wifi connection.
Flags: needinfo?(firefoxos-ux-bugzilla)
Assigning to Casey from general UX identity for input on whether or not to disable, per suggestions above.
Flags: needinfo?(kyee)
(In reply to John Hu [:johnhu] from comment #6)
> UX guys:
> 
> If our phone doesn't have simcard which means we don't have the ability to
> do cellular, data connection, or internet sharing through, do we just
> disable the top-most setting menu items, such as Call Settings, Cellular &
> Data, and Internet sharing??? Or we need to disable the sub menu items under
> those top-most menu items??

I think we should keep the current behavior and grey out the options that are not available without SIM.  

As pointed out elsewhere in this bug, Internet sharing should still be available in a no SIM case since user can USB tether Wifi internet. 

The internet sharing preferences ideally should be on a per-SIM basis.   I think that if a user shares the internet connection with SIM 1, it doesn't necessarily mean that swapping out to SIM 2 they would want to share the internet connection.   Swapping back to SIM 1, the internet connection sharing should be re-enabled.
Flags: needinfo?(kyee)
So, in this case, the KO1 in bug description doesn't exist:

for KO1 -- don't show internet sharing icon if no SIM card. 

And we can view this bug as a duplication of bug 869873.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
No longer depends on: 869873
(In reply to John Hu [:johnhu] from comment #15)
> So, in this case, the KO1 in bug description doesn't exist:
> 
> for KO1 -- don't show internet sharing icon if no SIM card. 
> 
> And we can view this bug as a duplication of bug 869873.
> 
> *** This bug has been marked as a duplicate of bug 869873 ***

Dear John,
Another side of KO1 is that we show the internet sharing icon in the status bar while the device didn't sharing internet connection.

And for the K03, IMHO, we should disable wifi hotspot and usb tethering when the device don't have any data connection(wifi or 3g). But at present, we enable wifi hotspot with sim card, then power off device, remove sim card, power on the device, the wifi hotspot still enabled as before.

So this bug is not duplicate of bug 869873, and we should fix the KO1 and KO3.
Flags: needinfo?(johu)
I don't think KO3 to be turned off is needed. Because it still works, while internet(through wifi or usb) gets back.

As to KO1, if we think "internet sharing icon" is the status of "sharing", it should be removed while sharing is not possible. And if we think "internet sharing icon" is the status of setting which means "you already turn on internet sharing" and not always means "your internet is sharing", it should not be removed. 

That's the reason I think this is a duplicated one.
Flags: needinfo?(johu)
(In reply to John Hu [:johnhu] from comment #17)
> I don't think KO3 to be turned off is needed. Because it still works, while
> internet(through wifi or usb) gets back.
can you have a look at bug 868913

> As to KO1, if we think "internet sharing icon" is the status of "sharing",
> it should be removed while sharing is not possible. And if we think
> "internet sharing icon" is the status of setting which means "you already
> turn on internet sharing" and not always means "your internet is sharing",
> it should not be removed. 
just like the wifi, if we just enable wifi but not connect to an AP, the status bar will not show the icon of wifi.
only after we connected to an AP, the wifi icon will show.
so if we don't have any data connection to sharing, we shouldn't show 'internet sharing icon' in the status bar.
Flags: needinfo?(johu)
xiao kang, 

I understand what you think about KO1. After some investigation, the original implementation of internet sharing icon shows the icon while user just enabled the wifi or usb tethering, not meaning the internet is sharing. So, we need to ask UX for correct behavior.

About KO3, it is possible to turn wifi and usb tethering off while booting without any internet access. But wifi or 3G may be back few seconds later after the device booted. In this kind of situation, the original sharing may be turned off. This is so the one need to ask UX for correct behavior.

Before changing to duplicate, I had wrote a patch for this bug. It does the things similar to your description of KO3, turning off every sharing while no simcard there. It is very clear to know it can't get internet access through 3g, and any sharing about 3g should be disabled. But after knowing ffos supports wifi to usb or usb to wifi sharing, it seems useless to turning off anything of it. Because we can't clearly understand when user connects wifi or usb to internet for sharing.
Status: RESOLVED → REOPENED
Flags: needinfo?(johu) → needinfo?(firefoxos-ux-bugzilla)
Resolution: DUPLICATE → ---
Assigning to Casey again since he's familiar with this issue.
Flags: needinfo?(firefoxos-ux-bugzilla) → needinfo?(kyee)
(In reply to John Hu [:johnhu] from comment #19)
> xiao kang, 
> 
> I understand what you think about KO1. After some investigation, the
> original implementation of internet sharing icon shows the icon while user
> just enabled the wifi or usb tethering, not meaning the internet is sharing.
> So, we need to ask UX for correct behavior.

Well, the feature is labeled as "Internet sharing" because that is the most typical use of this feature.  I don't think that an average user would know what "tethering" is so we opted to use language which was easier to understand.

If the user isn't actually connected to the internet, we should still show the icon in the status bar since sharing is active and working.   

I realize that this isn't exactly accurate to the labeled description but it's close enough.


> 
> About KO3, it is possible to turn wifi and usb tethering off while booting
> without any internet access. But wifi or 3G may be back few seconds later
> after the device booted. In this kind of situation, the original sharing may
> be turned off. This is so the one need to ask UX for correct behavior.

I'm sorry, I don't understand what the question is.  Can you re-state in other words?  Also, what is K01 and K02?

> 
> Before changing to duplicate, I had wrote a patch for this bug. It does the
> things similar to your description of KO3, turning off every sharing while
> no simcard there. It is very clear to know it can't get internet access
> through 3g, and any sharing about 3g should be disabled. But after knowing
> ffos supports wifi to usb or usb to wifi sharing, it seems useless to
> turning off anything of it. Because we can't clearly understand when user
> connects wifi or usb to internet for sharing.

I think that it should be tied to a hardware configuration as I have suggested earlier in the thread:

No SIM - Sharing On.
Sim 1 - Sharing On.
Sim 2 - Sharing Off.

If a user starts the phone with No SIM and turns sharing On.   The next restart with No SIM, the phone should have sharing On.

If a user starts the phone with No SIM and swaps in Sim 2, The next restart should have sharing turned Off (since it was previously disabled when SIM 2 was in the phone)

If a user starts the phone with No SIM and swaps in Sim 1, The next restart should have sharing turned On (since it was previously enabled when SIM 1 was in the phone)
Flags: needinfo?(kyee)
Thanks casey, 

With the opinion of Vincent who implements USB tethering, the wifi hotspot should be disabled under no sim state. Because it is only tied with 3G. But USB tethering can works without simcard.

So, I will turn off wifi hotspot while device entering no sim state, and turn on while sim is inserted. And I will trying to find a way to keep sim id for tying USB tethering setting with different sim.
Attached file The patch for this bug
To add the code for checking internet sharing while system startup.

Implementation is based on:
1. force wifi hotspot always off while no simcard, from vincent.
2. saves wifi hotspot or usb tethering state with simcard id (iccid) or without simcard, from casey.
3. restore wifi hotspot while known simcard is inserted, from casey.
4. restore usb tethering with known simcard or without simcard, from casey.
Attachment #755267 - Flags: review?(arthur.chen)
Comment on attachment 755267 [details]
The patch for this bug

John, thank you for the patch. Since the file will be added in the system app, I would like alive take a look at it also. And please check my comments in github.
Attachment #755267 - Flags: review?(alive)
Thanks Arthur. I already change the code according your opinions.

Alive, please review this patch, thanks in advance.
Comment on attachment 755267 [details]
The patch for this bug

See github comment.

Fix the observer add/remove or explain it -- I don't think you need to dynamically add/remove the observer here. You are system app so you should know everything except for who set the value -- but that doesn't matter.

And, since this is a new module in system app, 
please try to write an unit test for it.
See https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Gaia_unit_tests
The examples are under apps/system/test/unit.
Attachment #755267 - Flags: review?(arthur.chen)
Attachment #755267 - Flags: review?(alive)
Comment on attachment 755267 [details]
The patch for this bug

Alive, 

Thanks for your opinions, I already changed the patch as following:
1. just observe once, no add/remove
2. finish the unit test for internet_sharing.js
Attachment #755267 - Flags: review?(alive)
Comment from Mozilla:Alive, 
 
 Thanks for your opinions, I already changed the patch as following:
 1. just observe once, no add/remove
 2. finish the unit test for internet_sharing.js
Comment on attachment 755267 [details]
The patch for this bug

Great, r=me, thanks.
Attachment #755267 - Flags: review?(alive) → review+
Comment from Mozilla:Great, r=me, thanks.
Comment on attachment 755267 [details]
The patch for this bug

John, I set a r- here because my review flag was cleared by alive. Please check github for my comment and request a review once you fix it, thanks!
Attachment #755267 - Flags: review-
Comment from Mozilla:John, I set a r- here because my review flag was cleared by alive. Please check github for my comment and request a review once you fix it, thanks!
Comment on attachment 755267 [details]
The patch for this bug

Thanks. I already change the patch....
Attachment #755267 - Flags: review- → review?(arthur.chen)
Comment from Mozilla:Thanks. I already change the patch....
Comment on attachment 755267 [details]
The patch for this bug

Looks good. Thanks for the patch. r=me.
Attachment #755267 - Flags: review?(arthur.chen) → review+
Comment from Mozilla:Looks good. Thanks for the patch. r=me.
Comment on attachment 755267 [details]
The patch for this bug

alive, 

To prevent I make patch wrong, please review it again.

I had change the following thing:
1. move the requireApp after the replacement of mock objects.
2. remove additional init call.
Attachment #755267 - Flags: review+ → review?(alive)
This bug contains unit tests. But travis is currently unavailable. This bug will not land until travis is back and it shows ok with unit tests.
Comment on attachment 755267 [details]
The patch for this bug

r+ for green status of travis.
Attachment #755267 - Flags: review?(alive) → review+
merged to master:

https://github.com/mozilla-b2g/gaia/commit/59a4c314aa51814b75a83436ff6d3c4d46b17a5c
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Flags: in-moztrap?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: