[Costcontrol] Costcontrol Widget is not showing proper message under airplane mode scenario without simcard

RESOLVED FIXED in Firefox OS v2.0

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: vsireesha246, Assigned: mai)

Tracking

({regression})

unspecified
2.0 S6 (18july)
ARM
Gonk (Firefox OS)
regression

Firefox Tracking Flags

(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed)

Details

(Whiteboard: [LibGLA,TD68578,WW, A])

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

4 years ago
Costcontrol Widget is not showing proper message under airplane mode scenario in V1.4 version.

STR:

1.In V1.4 branch apply the patch https://github.com/mozilla-b2g/gaia/pull/21330
(This patch is related to Bug-960500 for Version 1.4)
2.After make..trun on/off the airplane mode without FTE configuration in costcontrol app.
3.The Costcontrol widget will not shown sometime the proper message or sometimes it will not refresh.(Close and reopen the utility tray the widget message will be refreshed)

The same bug is not present in Master.

So for V1.4 version is there any other dependent patch for this bug?

Platform version:30.0
Build Identifier:20140702181851
(Reporter)

Comment 1

4 years ago
Mai as discussed in IRC would you please help on this.
Flags: needinfo?(mri)
(Reporter)

Updated

4 years ago
Whiteboard: [LibGLA,TD68578,WW, A]
(Reporter)

Comment 2

4 years ago
Wayne Would you please help on this.
Flags: needinfo?(wchang)
:mai would be the best person to follow up here.

I assume Master/2.0 are both working correctly?
Flags: needinfo?(wchang) → needinfo?(vsireesha246)
(Reporter)

Comment 4

4 years ago
Hi Wayne,

In Master/2.0 the behavior of utility tray is different than V1.4.
Once we turn on/off the airplane mode in Master/2.0 the utility tray hides or closes automatically.
Is it correct behavior of utility tray?because this i observed recently.
So once utility tray hides, again opens it, the widget message refreshed.( like we close and open in V1.4)

But as per my opinion in Master/2.0 some cases are failing like
1.Insert no SIM in device
2.Turn ON/OFF the airplane mode
3.Check the widget message..its showing wrong

All these issues i discussed yesterday with Mai in IRC.

Thanks You Wayne..
Flags: needinfo?(vsireesha246)
(Reporter)

Comment 5

4 years ago
Created attachment 8450791 [details] [diff] [review]
Bug_1034421.patch

Hi Mai,

Would you please review this patch.
I added some other condition on top of you patch(https://github.com/mozilla-b2g/gaia/pull/21330)

I tested in V1.4 branch and all conditions are working fine.

If your ok with this patch i will create PR for it.

Thanks..
Sireesha
Attachment #8450791 - Flags: review?(mri)
(Assignee)

Comment 6

4 years ago
Comment on attachment 8450791 [details] [diff] [review]
Bug_1034421.patch

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

Great work, but I think it's not the correct solution.

::: apps/costcontrol/js/widget.js
@@ +467,5 @@
> +              }
> +            );
> +            showSimError('airplane-mode');
> +          }
> +        } else if (state === 'disabled') {

This part will not work fine with DS device. When the airplanemode is disabled you have to reload the icc (the setting of data traffic can be changed when the airplanemode is enabled). 
Common.loadDataSIMIccId(function _onDisabledAirplaneMode() {
  if (initialized) {
    checkCardState(Common.dataSimIccId);
    updateUI();
  } else {
    checkSIMStatus();
  }
},function _errorNoSim() { showSimError('no-sim2');} );


Moreover, I was concern by the possibility of a rece condition between the code execute by the events iccdetectec and statechange (when the state is disabled).


Maybe the solution has to be focus on change the message showed by the widget when the airplanemode is disabled. Something like:
} else if (state === 'disabled') {
  updateSimErrorMessage('no-sim2');
}
Attachment #8450791 - Flags: review?(mri)
(Assignee)

Updated

4 years ago
Flags: needinfo?(mri)
(Assignee)

Comment 7

4 years ago
On master branch it's not posible testing the patch because the utility tray is closed when the airplanemode button is pressed. And I can't see any error on the logcat report.
(Reporter)

Comment 8

4 years ago
Created attachment 8450909 [details] [diff] [review]
Bug_1034421_Modified.patch

Hi Mai,

I modified the patch for V1.4 as per your first comments.
Like split the function as mentioned in your second comment will not work in all conditions i feel.

So,please check it and let me know your review comments and i don't have DS device.

Thanks..
Sireesha
Attachment #8450791 - Attachment is obsolete: true
Attachment #8450909 - Flags: review?(mri)
(Assignee)

Updated

4 years ago
Attachment #8450909 - Flags: review?(mri)
(Assignee)

Comment 9

4 years ago
Created attachment 8452236 [details] [review]
Patch for v1.4 to Sireesha

This patch combine a rebase for v1.4 of the patch 960500 + the patch for this bug. It's only for testing purposes
(Assignee)

Comment 10

4 years ago
Created attachment 8452238 [details] [review]
Patch For Master branch

This patch resolves the following problem on master branch.

Scenario:
Device without SIMCard

STR:

1. Enable airplanemode
2. Disable ariplanemode
3. Slide down the utility tray.

Expected:
Message: No simcard

Current:
Message: Airplanemode enabled.

This occurs because the widget is waiting for the icc detected event to refresh its ui.

Regards
Attachment #8452238 - Flags: review?(salva)
(Assignee)

Updated

4 years ago
Assignee: nobody → mri
(Reporter)

Comment 11

4 years ago
Along with the Mai fix for V1.4 (https://bugzilla.mozilla.org/show_bug.cgi?id=1034421#c9) the have the below queries.

1.When 'iccdetected' event is not fired in case of airplane mode is turn ON state to turn off state is changed.
2.In airplane mode case also i am getting cardState is 'ready' value.
3.What happens in IccManager interface if airplane mode ON/OFF case to ICCID?
4.How can we distinguish between airplane mode active state and 'No sim" case if airplane mode is active.
Flags: needinfo?(alberto.crespellperez)
(Reporter)

Updated

4 years ago
Flags: needinfo?(htsai)

Comment 12

4 years ago
Clearing ni because htsai can answer better than me.
Flags: needinfo?(alberto.crespellperez)
(In reply to vsireesha246 from comment #11)
> Along with the Mai fix for V1.4
> (https://bugzilla.mozilla.org/show_bug.cgi?id=1034421#c9) the have the below
> queries.
> 

Please do not bind the airplane mode status with icc status since these two stand for different things. That said, for some hardware design, the power of icc remains on even if radio is off. In this case, the platform can detect the sim card. But there is still another hardware design, i.e. the power of icc is turned of along with the radio.

If app wants to know the existence of a sim card, IccManager or mobileConnection.iccId is the right API. If app wants to know the radio state, mobileConnection.radioState should be referred.

> 1.When 'iccdetected' event is not fired in case of airplane mode is turn ON
> state to turn off state is changed.

As I tried to explain above, 'iccdetected' is fired when the platform detects a new card, not because of radio being turned on. 

> 2.In airplane mode case also i am getting cardState is 'ready' value.

It's possible due to the vendor hardware design!

> 3.What happens in IccManager interface if airplane mode ON/OFF case to ICCID?

Same as Q1 ?

> 4.How can we distinguish between airplane mode active state and 'No sim"
> case if airplane mode is active.

Use |navigator.mobileConnections[x].iccId| or |navigator.iccManager| to know if a card is detected.
Use |navigator.mobileConnections[x].radioState| to know if airplane mode is on or off.

Hope it's clear!
Flags: needinfo?(htsai)
(Assignee)

Comment 14

4 years ago
Hi,
we need to use the event iccdetected after the airplanemode is disabled because on some device after the airplanemodechangestate event is fired, the ril is too slowly awakening and the IccManager or mobileConnection apis are not ready if we access to then in that moment. 

We need ensure the icc exists before relaunched the costcontrol app, if we cannot use this event, how can detect the moment that both apis are ready?

Regards
Flags: needinfo?(htsai)
(In reply to marina rodríguez [:mai] from comment #14)
> Hi,
> we need to use the event iccdetected after the airplanemode is disabled
> because on some device after the airplanemodechangestate event is fired, the
> ril is too slowly awakening and the IccManager or mobileConnection apis are
> not ready if we access to then in that moment. 
> 
> We need ensure the icc exists before relaunched the costcontrol app, if we
> cannot use this event, how can detect the moment that both apis are ready?
> 
> Regards

Already talked on IRC. Clearing NI!
Flag me if you still have questions :)
Flags: needinfo?(htsai)
Comment on attachment 8452238 [details] [review]
Patch For Master branch

Ok, no blocking comments on GitHub. Thank you Mai!
Attachment #8452238 - Flags: review?(salva) → review+
(Reporter)

Comment 17

4 years ago
As per htsai comment#13 the behaviour of 'iccdetected' event firing from Gecko is only when ever the new ICC detected.

So the existing code is not working for all devices.
So we need to change the gaia costcontrol code in case of airplane mode state as device independent.

As per Mai IRC chat app need to listen for 'iccchange' event instead of 'iccdetected'.
But we need to consider Multi-SIM case also.
(Reporter)

Comment 18

4 years ago
Created attachment 8453620 [details] [diff] [review]
Bug_1034421_iccdetected.patch
Attachment #8450909 - Attachment is obsolete: true
Attachment #8453620 - Flags: review?(mri)
(Reporter)

Comment 19

4 years ago
Mai would you please apply attached Bug_1034421_iccdetected.patch on top of your patch.

This patch will solve the problem of 'iccdetected' event firing is not happen case.
and also solves the race conditions if any.I just add few conditions,which will work without any side effects.
Please check this patch on DS devices and let me know the status.

Thanks..
Sireesha



(In reply to marina rodríguez [:mai] from comment #9)
> Created attachment 8452236 [details] [review]
> Patch for v1.4 to Sireesha
> 
> This patch combine a rebase for v1.4 of the patch 960500 + the patch for
> this bug. It's only for testing purposes
(Reporter)

Updated

4 years ago
Attachment #8453620 - Flags: superreview?(salva)
(Assignee)

Comment 20

4 years ago
Master: fe313d0dc6b51aafc8d971021535707f8155f8fc
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
Duplicate of this bug: 1036295
(Assignee)

Updated

4 years ago
Summary: [Costcontrol] Costcontrol Widget is not showing proper message under airplane mode scenario in V1.4 → [Costcontrol] Costcontrol Widget is not showing proper message under airplane mode scenario without simcard
(Assignee)

Updated

4 years ago
Attachment #8453620 - Flags: superreview?(salva)
Attachment #8453620 - Flags: review?(mri)
(Reporter)

Updated

4 years ago
Whiteboard: [LibGLA,TD68578,WW, A] → [LibGLA,TD68578,WW,A]
(Reporter)

Updated

4 years ago
Whiteboard: [LibGLA,TD68578,WW,A] → [LibGLA,TD68578,WW, A]
(Assignee)

Comment 22

4 years ago
Comment on attachment 8452238 [details] [review]
Patch For Master branch

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.
The app didn't consider this scenario. Then when the airplanemode is disabled without simcard the message of airplanemode disabled is not changed to no simcard after the airplanemode is disabled
[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): 960500
[User impact] if declined: Show the message airplanemode enabled when the airplaneme is disabled (only happens without simcard)
[Testing completed]: yes
[Risk to taking this patch] (and alternatives if risky): Low risk
[String changes made]:
Attachment #8452238 - Flags: approval-gaia-v2.0?(release-mgmt)
(In reply to marina rodríguez [:mai] from comment #22)
> Comment on attachment 8452238 [details] [review]
> Patch For Master branch
> 
> NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to
> better understand the B2G approval process and landings.
> The app didn't consider this scenario. Then when the airplanemode is
> disabled without simcard the message of airplanemode disabled is not changed
> to no simcard after the airplanemode is disabled
> [Approval Request Comment]
> [Bug caused by] (feature/regressing bug #): 960500
> [User impact] if declined: Show the message airplanemode enabled when the
> airplaneme is disabled (only happens without simcard)
> [Testing completed]: yes
> [Risk to taking this patch] (and alternatives if risky): Low risk
> [String changes made]:

Marking this as a regression as this is a fallout from 960500 and instead making this a blocker.
Keywords: regression

Updated

4 years ago
blocking-b2g: --- → 2.0+
Comment on attachment 8452238 [details] [review]
Patch For Master branch

Clearing the approval request here as the blocking 2.0+ should take care of uplifting this.
Attachment #8452238 - Flags: approval-gaia-v2.0?(release-mgmt)
v2.0: https://github.com/mozilla-b2g/gaia/commit/5a3b33de5adee0bcb59ef92f6e3d67741636f99f
status-b2g-v2.0: --- → fixed
status-b2g-v2.1: --- → fixed
Target Milestone: --- → 2.0 S6 (18july)
You need to log in before you can comment on or make changes to this bug.