Wi-Fi hotspot does not work when SIM 2 is data source

VERIFIED FIXED in Firefox OS v2.0

Status

Firefox OS
RIL
P1
normal
VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: vt, Assigned: jessica)

Tracking

(Blocks: 1 bug, {regression})

unspecified
2.0 S4 (20june)
x86
Mac OS X
regression
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.0+, b2g-v1.4 unaffected, b2g-v2.0 verified, b2g-v2.0M verified, b2g-v2.1 verified)

Details

(Whiteboard: [p=2])

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

3 years ago
# Build Information

Device: Flame
Gaia      3f3963fe6e165c0a7afc6222e1137d0862c70b30
Gecko     https://hg.mozilla.org/mozilla-central/rev/62d33e3ba514
BuildID   20140606160206
Version   32.0a1
ro.build.version.incremental=eng.cltbld.20140606.192117
ro.build.date=Fri Jun  6 19:21:29 EDT 2014

# Description

When using multiple SIM cards and the chosen data connection is SIM 2, the WiFi hotspot does not work.

# Steps to Reproduce

1) Open SIM manager settings
2) Select SIM 2 for Data
3) Go to internet sharing settings
4) Enable Wi-Fi hotspot

# Expected Results

WiFi hotspot is enabled and SIM 2 is used for the data connection. If there is indeed an error, I expect some error message telling me what the problem is.

# Actual Results

The Wi-Fi hotspot is not enabled and the switch flips back to off.

# Other Notes

I tested this with using SIM 1 as my data connection and it worked.

SIM 1: AT&T
SIM 2: T-Mobile

Logcat output: https://pastebin.mozilla.org/5367941

# Reproduction Frequency

Always
QA Wanted to check 1.4.
Component: Gaia::Settings → RIL
Keywords: qawanted
(Assignee)

Comment 2

3 years ago
I can reproduce it on my Flame.
I think it is caused by not able to find the external interface for tethering. Will take a look at this.
(Assignee)

Comment 3

3 years ago
The root cause is because when wifi tethering is enabled, it will look for a NETWORK_TYPE_MOBILE network interface to be the external iface [1], getNetworkInterface() [2] returns the first NETWORK_TYPE_MOBILE found, which leads to this issue when the default data is on SIM 2.

While debugging, I found that NetworkManager's gDataDefaultServiceId [3] always return 0, no matter what the data default service id is.

Will upload a patch to address these issues.

[1] http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkManager.js#1047
[2] http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkManager.js#761
[3] http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkManager.js#1299
Assignee: nobody → jjong
Bug does NOT repro on the latest build of Flame 1.4, with 2 SIM cards. Turning all settings to use SIM2 and enabling Wifi Hotspot works as expected. It never turned off by itself.

Environmental Variables:
Device: Flame 1.4
Build ID: 20140609000201
Gaia: 8b239e41bbd85aa7b6a2c5d388e775ba7de6fb2b
Gecko: e3f85877db29
Version: 30.0 (1.4) 
Firmware Version: v10G-2
status-b2g-v1.4: --- → unaffected
Keywords: qawanted
QA Contact: croesch

Updated

3 years ago
Keywords: regression, regressionwindow-wanted
(Assignee)

Comment 5

3 years ago
Created attachment 8437497 [details] [diff] [review]
Part 1: get default service id for data call from settings db.

We should read default service id for data call from settings db and not from preferences.
Attachment #8437497 - Flags: review?(htsai)
(Assignee)

Comment 6

3 years ago
Created attachment 8437500 [details] [diff] [review]
Part 2: add serviceId parameter in getNetworkInterface() function.
Attachment #8437500 - Flags: review?(htsai)
Comment on attachment 8437497 [details] [diff] [review]
Part 1: get default service id for data call from settings db.

Review of attachment 8437497 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/NetworkManager.js
@@ +150,5 @@
>  
>    // Possible usb tethering interfaces for different gonk platform.
>    this.possibleInterface = POSSIBLE_USB_INTERFACE_NAME.split(",");
>  
> +  this._dataDefaultServiceId = 0;

We need |settingsLock.get(SETTINGS_DATA_DEFAULT_SERVICE_ID, this)| instead.
Attachment #8437497 - Flags: review?(htsai)
Comment on attachment 8437500 [details] [diff] [review]
Part 2: add serviceId parameter in getNetworkInterface() function.

Review of attachment 8437500 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/NetworkManager.js
@@ +770,4 @@
>      for each (let network in this.networkInterfaces) {
>        if (network.type == type) {
> +#ifdef MOZ_B2G_RIL
> +        if (serviceId != undefined && this.isNetworkTypeMobile(network.type) &&

Since serviceId is required for MOZ_B2G_RIL, I'd like to check |serviceId != undefined| at the beginning of this function. In this way, when serviceId is undefined, we don't need to visit every network in this.networkInterfaces.
Attachment #8437500 - Flags: review?(htsai)
(Assignee)

Comment 9

3 years ago
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #7)
> Comment on attachment 8437497 [details] [diff] [review]
> Part 1: get default service id for data call from settings db.
> 
> Review of attachment 8437497 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/system/gonk/NetworkManager.js
> @@ +150,5 @@
> >  
> >    // Possible usb tethering interfaces for different gonk platform.
> >    this.possibleInterface = POSSIBLE_USB_INTERFACE_NAME.split(",");
> >  
> > +  this._dataDefaultServiceId = 0;
> 
> We need |settingsLock.get(SETTINGS_DATA_DEFAULT_SERVICE_ID, this)| instead.

Oh yes, I forgot to retrieve the value on init, I will add it on the next patch. Thanks.
Comment on attachment 8437500 [details] [diff] [review]
Part 2: add serviceId parameter in getNetworkInterface() function.

Review of attachment 8437500 [details] [diff] [review]:
-----------------------------------------------------------------

ohohoh, ignore my previous comment. :)
Attachment #8437500 - Flags: review+

Updated

3 years ago
Keywords: regressionwindow-wanted

Updated

3 years ago
blocking-b2g: 2.0? → 2.0+
status-b2g-v2.0: --- → fixed
status-b2g-v2.1: --- → fixed
(Assignee)

Comment 11

3 years ago
Created attachment 8438193 [details] [diff] [review]
[final] Part 1: get default service id for data call from settings db.

Changes since v1:
- Address review comment 7: read the value of 'ril.data.defaultServiceId' on init
- Add r=hsinyi
Attachment #8437497 - Attachment is obsolete: true
Attachment #8438193 - Flags: review?(htsai)
Comment on attachment 8438193 [details] [diff] [review]
[final] Part 1: get default service id for data call from settings db.

Review of attachment 8438193 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thank you!
Attachment #8438193 - Flags: review?(htsai) → review+
(Assignee)

Comment 13

3 years ago
Created attachment 8438299 [details] [diff] [review]
[final] Part 2: add serviceId parameter in getNetworkInterface() function.

Add r=hsinyi
Attachment #8437500 - Attachment is obsolete: true
Attachment #8438299 - Flags: review+
(Assignee)

Comment 14

3 years ago
Comment on attachment 8438193 [details] [diff] [review]
[final] Part 1: get default service id for data call from settings db.

Thank you, Hsinyi. :)
Attachment #8438193 - Attachment description: Part 1: get default service id for data call from settings db, v2. → [final] Part 1: get default service id for data call from settings db.
(Assignee)

Comment 15

3 years ago
https://tbpl.mozilla.org/?tree=Try&rev=167c135c351a

try green!
Keywords: checkin-needed
Whiteboard: [p=2]
Target Milestone: --- → 2.0 S4 (20june)
https://hg.mozilla.org/integration/b2g-inbound/rev/8547c30fd27d
https://hg.mozilla.org/integration/b2g-inbound/rev/0e1805a0025e
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8547c30fd27d
https://hg.mozilla.org/mozilla-central/rev/0e1805a0025e
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Do not find patches in 2.0 branch.
status-b2g-v2.0: fixed → affected
status-b2g-v2.0M: --- → affected
Correct, the branch date was 9-June. This missed uplifting at the time due to the erroneous status flag setting. At this point, the patches will need approval for uplift.
Flags: needinfo?(jjong)
(Assignee)

Comment 20

3 years ago
I will provide patches for v2.0 and ask approval for uplift. Keeping NI for tracking.
(Assignee)

Comment 21

3 years ago
Comment on attachment 8438193 [details] [diff] [review]
[final] Part 1: get default service id for data call from settings db.

Review of attachment 8438193 [details] [diff] [review]:
-----------------------------------------------------------------

Patches can be applied cleanly on v2.0 branch, so I think extra patches for v2.0 are not needed.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 939046
User impact if declined: wifi-hotspot does not work when SIM 2 is data source
Testing completed: tested manually on the device
Risk to taking this patch (and alternatives if risky): low, it has been on master branch for a long time
Attachment #8438193 - Flags: approval-mozilla-b2g32?
(Assignee)

Comment 22

3 years ago
Comment on attachment 8438299 [details] [diff] [review]
[final] Part 2: add serviceId parameter in getNetworkInterface() function.

Patches can be applied cleanly on v2.0 branch, so I think extra patches for v2.0 are not needed.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 939046
User impact if declined: wifi-hotspot does not work when SIM 2 is data source
Testing completed: tested manually on the device
Risk to taking this patch (and alternatives if risky): low, it has been on master branch for a long time
String or UUID changes made by this patch: no
Attachment #8438299 - Flags: approval-mozilla-b2g32?
Flags: needinfo?(jjong)
(Assignee)

Comment 23

3 years ago
(In reply to Jessica Jong [:jjong] [:jessica] from comment #21)
> Comment on attachment 8438193 [details] [diff] [review]
> [final] Part 1: get default service id for data call from settings db.
> 
> Review of attachment 8438193 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Patches can be applied cleanly on v2.0 branch, so I think extra patches for
> v2.0 are not needed.
> 
> [Approval Request Comment]
> Bug caused by (feature/regressing bug #): 939046
> User impact if declined: wifi-hotspot does not work when SIM 2 is data source
> Testing completed: tested manually on the device
> Risk to taking this patch (and alternatives if risky): low, it has been on
> master branch for a long time

String or UUID changes made by this patch: no
(Assignee)

Comment 24

3 years ago
try results on v2.0 branch:
https://tbpl.mozilla.org/?tree=Try&rev=b35a4c48a5b8
Blocks: 1069163

Updated

3 years ago
Attachment #8438193 - Flags: approval-mozilla-b2g32? → approval-mozilla-b2g32+

Updated

3 years ago
Attachment #8438299 - Flags: approval-mozilla-b2g32? → approval-mozilla-b2g32+

Comment 25

3 years ago
Hi Jessica:
 Could you please help provide 2.0m patch for us to do the uplift?

Thanks!!
Shawn
Flags: needinfo?(jjong)

Comment 26

3 years ago
Hi Seinlin:
 Please make sure uplift can be done once 2.0m patch is ready (comment 25).
Flags: needinfo?(kli)
Shawn, patches will be landed into 2.0, and I will merge them into 2.0m from 2.0.
Flags: needinfo?(kli)
https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/39a82218c159
https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/6c29b2fb7771
status-b2g-v2.0: affected → fixed
Flags: needinfo?(jjong)
http://hg.mozilla.org/releases/mozilla-b2g32_v2_0m/rev/39a82218c159
http://hg.mozilla.org/releases/mozilla-b2g32_v2_0m/rev/6c29b2fb7771
status-b2g-v2.0M: affected → fixed

Updated

3 years ago
Duplicate of this bug: 1069163

Updated

3 years ago
Blocks: 1080337, 1054172

Updated

3 years ago
QA Contact: croesch

Comment 31

3 years ago
Hi Hubert,
According to https://bugzilla.mozilla.org/show_bug.cgi?id=1069163#c7. The problem seems can still be observed in Woodduck.
I wonder is this caused by single SIM build from TCL?
Flags: needinfo?(hlu)
We have verified this issue on Woodduck 2.0, Flame 2.0 and 2.1. And we can't reproduced this issue on Woodduck 2.0, Flame 2.0 and 2.1.

Slot 1:CMCC, Slot 2:CU

Woodduck version:
Gaia-Rev        60146ec47cd38a8be8ed22e0116902eceb9ac067
Gecko-Rev       cdfbe9866cf0b71b33454926638ce0cd8bb1fb00
Build-ID        20141117050313
Version         32.0
Device-Name     soul35
FW-Release      4.4.2
FW-Incremental  1416171914
FW-Date         Mon Nov 17 05:05:37 CST 2014

Flame 2.0 version:
Gaia-Rev        086a668942292168f312b3bb53e275fa0886fab1
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/a57b299c5cf2
Build-ID        20141117000200
Version         32.0
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20141117.035534
FW-Date         Mon Nov 17 03:55:45 EST 2014
Bootloader      L1TC00011880

Flame 2.1 version:
Gaia-Rev        569a299ca446f714cd98d5881cc058fd6f6e257b
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/d188e92aa5a6
Build-ID        20141113001200
Version         34.0
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20141113.081909
FW-Date         Thu Nov 13 08:19:20 EST 2014
Bootloader      L1TC00011880
status-b2g-v2.0: fixed → verified
status-b2g-v2.0M: fixed → verified
status-b2g-v2.1: fixed → verified

Updated

3 years ago
Status: RESOLVED → VERIFIED
Flags: needinfo?(hlu)

Updated

3 years ago
Blocks: 1107999

Updated

3 years ago
Priority: -- → P1

Updated

3 years ago
No longer blocks: 1107999
You need to log in before you can comment on or make changes to this bug.