Closed Bug 1035553 Opened 10 years ago Closed 8 years ago

[User Story] Restricting mobile data usage on a per-app basis

Categories

(Firefox OS Graveyard :: Gaia::Cost Control, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog)

RESOLVED INVALID
2.1 S7 (24Oct)
tracking-b2g backlog

People

(Reporter: vtsatskin, Unassigned)

References

()

Details

(Keywords: feature, Whiteboard: [ucid:SMRTDATA-2-1][NaBfT])

User Story

As a cost-conscious phone user, I want to be able to restrict specific apps from using mobile data entirely so that I can control which apps I spend my data on.

Acceptance Criteria:
1. Applications with their data usage restricted should not be able to use mobile data.
2. Applications which are set from restricted to not restricted should be able to use mobile data.
3. Per-app restricting of data use should be device specific and not tied to a particular SIM.
4. The toggle to restrict data use in the UI should match up to the actual state of the restriction.
5. UX interaction and visual design matches UX spec: https://people.mozilla.org/~vtsatskin/specs/SmartData/

Attachments

(2 files, 2 obsolete files)

      No description provided.
feature-b2g: --- → 2.1
Whiteboard: [tako]
QA Whiteboard: [2.1-feature-qa+]
Flags: in-moztrap?
QA Whiteboard: [2.1-feature-qa+]
Whiteboard: [tako] → [tako][2.1-feature-qa+]
Assignee: nobody → marshall
Target Milestone: --- → 2.1 S3 (29aug)
Depends on: 786419
Re-assigning to myself.
Assignee: marshall → jdarcangelo
I know its late in the game here, but can we go consider going further than just restricting "mobile data" and make it possible to restrict wifi as well as mobile data? This would be a powerful security control but I don't know how much extra work this would be. 

Actually even from a cost perspective, omitting control of wifi limits the intended use case: just because you are using wifi, doesn't mean that data is free/cheap. In my own use case, I use a pocket wifi 3g access point since mobile data is relatively expensive. I've have had to stop using it with my tablet as it regular chews up all my data if I forget to disable tablet wifi.
Attached file pull-request (master) (obsolete) —
Marshall: I'm flagging you for review. If you're not the appropriate reviewer, could you please re-assign?

Amy: Could you review just the "app detail" screen? (when you tap an app in the list on the main screen, the detail screen appears for that specific app).

Thanks!
Attachment #8481426 - Flags: ui-review?(amlee)
Attachment #8481426 - Flags: review?(marshall)
Comment on attachment 8481426 [details] [review]
pull-request (master)

Re-assigning r? to :salva, flagging feedback? from :marshall_law
Attachment #8481426 - Flags: review?(salva)
Attachment #8481426 - Flags: review?(marshall)
Attachment #8481426 - Flags: feedback?(marshall)
Comment on attachment 8481426 [details] [review]
pull-request (master)

Hi Justin, 

I've attached a screen of my edits. Please let me know if you have any questions. 

Thanks!
Attachment #8481426 - Flags: ui-review?(amlee) → ui-review-
Attached image App_Usage_Edits.png
Edits for app usage screen
Comment on attachment 8481426 [details] [review]
pull-request (master)

Amy: I made the tweaks you mentioned. Could you please re-review? Thanks!
Attachment #8481426 - Flags: ui-review- → ui-review?(amlee)
Comment on attachment 8481426 [details] [review]
pull-request (master)

Looks great! Thanks
Attachment #8481426 - Flags: ui-review?(amlee) → ui-review+
Attachment #8481426 - Flags: review?(21)
Justin, as Salva is on PTO, you can ask Marina (:mai) for the review
Flags: needinfo?(jdarcangelo)
Attachment #8481426 - Flags: review?(mri)
Flags: needinfo?(jdarcangelo)
I've been ask to give feedback, but couldn't merge the patch, also do I need a special version of gecko to run this? I'm seeing things like: |navigator.mozApps.mgmt.enableMobileData| that are not familiar to me
Just realised that feature will be provided by bug 1042745 that is not landed or have patch yet.
There's no way this to be part of 2.1, nominating for 2.2
feature-b2g: 2.1 → 2.2?
(In reply to Francisco Jordano [:arcturus] [:francisco] from comment #11)
> Just realised that feature will be provided by bug 1042745 that is not
> landed or have patch yet.

You can run this, however, you will see a JS error when toggling the on/off switch in the app until the patch lands with the API updates.
if there are omissions that cause an error then this should not land in 2.1. also this is not part of the items we discussed to land as part tako and 2.1.
Whiteboard: [tako][2.1-feature-qa+] → [2.1-feature-qa+]
Flags: in-moztrap?
Whiteboard: [2.1-feature-qa+]
Justin, 
would you mind rebasing the patch onto latest master? 
Thanks!
Flags: needinfo?(jdarcangelo)
Attachment #8481426 - Flags: review?(salva)
Attachment #8481426 - Flags: review?(21)
Target Milestone: 2.1 S3 (29aug) → 2.1 S4 (12sep)
(In reply to Marina Rodríguez [:mai] from comment #15)
> Justin, 
> would you mind rebasing the patch onto latest master? 
> Thanks!

Done!
Flags: needinfo?(jdarcangelo)
Comment on attachment 8481426 [details] [review]
pull-request (master)

Sorry for delay, I think we need another round, address the comments on GitHub. 

Thanks for your work ! ;)
Attachment #8481426 - Flags: review?(mri) → review-
Blocks: 1063834
Comment on attachment 8481426 [details] [review]
pull-request (master)

Updated PR to address comments from first review.
Attachment #8481426 - Flags: review- → review?(mri)
added some more comments

Thanks for this good work !
Hi Salva, 

Justin and me have a question about the new screeen. 
It's about the amount of data showed and the reset period (the options is monthly, weekly and never). IMHO the amount of data must be always visible. 

WDYT?
Regards
Flags: needinfo?(salva)
Katie, according to [1] we change the label A to point monthly or weekly usage but what about `never` case? What if the user has chosen no period? I think we should simply display the total amount spent data.

What do you think?

[1] http://val.ninja/SmartData/specs.html#application-data-control
Flags: needinfo?(salva) → needinfo?(kcaldwell)
(In reply to Marina Rodríguez [:mai] from comment #19)
> added some more comments
> 
> Thanks for this good work !

No problem! I've updated the PR to address your remaining comments. The only item that remains unaddressed is the issue about the label for the "never" period that we're waiting for UX input on.
(In reply to Salvador de la Puente González [:salva] from comment #21)
> Katie, according to [1] we change the label A to point monthly or weekly
> usage but what about `never` case? What if the user has chosen no period? I
> think we should simply display the total amount spent data.
> 
> What do you think?
> 
> [1] http://val.ninja/SmartData/specs.html#application-data-control

Hi Salva, I agree, the label should display total amount of data used, but it would also be beneficial to include the amount of time the data usage has been tracked for. Ex: "3.1 GB of data has been used since June 06, 2014." This, in addition to the visualization (chart) below provides the user a stronger sense of their time/data usage relationship.
Flags: needinfo?(kcaldwell)
 Justin, 
would you mind rebasing the patch onto latest master? 
Thanks!
Flags: needinfo?(jdarcangelo)
(In reply to Marina Rodríguez [:mai] from comment #24)
>  Justin, 
> would you mind rebasing the patch onto latest master? 
> Thanks!

Done!
Flags: needinfo?(jdarcangelo)
Marina,
I moved those constants to reside *inside* the ChartUtils module. Can you take another look and see if what I did looks correct? Thanks!

-Justin
Flags: needinfo?(mri)
Marina,
I've updated the PR to address the case of showing the start date text for the "never" period as described in Comment 23.
Comment on attachment 8481426 [details] [review]
pull-request (master)

Hi Justin,
 I've reviewed the code and I think you've made a great job. I put only a nit on the pr, but to get the r+ you must add some test, please.
Flags: needinfo?(mri)
Hi Salva, 
I was thinking that this patch must be splitted in two, Justin has made a great job, but the behaviour of the switch could not be tested until some blockers bugs will be resolved. Currently, when you active the switch the console shows the following error:

E/Usage   ( 2425): [JavaScript Error: "TypeError: navigator.mozApps.mgmt.disableMobileData is not a function" {file: "app://costcontrol.gaiamobile.org/js/views/appdetail.js" line: 112}]
E/Usage   ( 2425): [JavaScript Error: "TypeError: navigator.mozApps.mgmt.enableMobileData is not a function" {file: "app://costcontrol.gaiamobile.org/js/views/appdetail.js" line: 110}]

WDYT about splitting this bug in two:
  One with the new functionality (the app detail view) without the Data control section.
  Other with only the data control section.

IMHO, I'm not sure if have sense allow to the user disable the data mobile use in all app. (e.g, when is allowed on the browser and disbled on system app). 

This way, we can land the first bug, because this functionallity doesn't have blockers.

Regards
Flags: needinfo?(salva)
(In reply to Marina Rodríguez [:mai] from comment #29)
> Hi Salva, 
> I was thinking that this patch must be splitted in two, Justin has made a
> great job, but the behaviour of the switch could not be tested until some
> blockers bugs will be resolved. Currently, when you active the switch the
> console shows the following error:
> 
> E/Usage   ( 2425): [JavaScript Error: "TypeError:
> navigator.mozApps.mgmt.disableMobileData is not a function" {file:
> "app://costcontrol.gaiamobile.org/js/views/appdetail.js" line: 112}]
> E/Usage   ( 2425): [JavaScript Error: "TypeError:
> navigator.mozApps.mgmt.enableMobileData is not a function" {file:
> "app://costcontrol.gaiamobile.org/js/views/appdetail.js" line: 110}]
> 
> WDYT about splitting this bug in two:
>   One with the new functionality (the app detail view) without the Data
> control section.
>   Other with only the data control section.
> 
> IMHO, I'm not sure if have sense allow to the user disable the data mobile
> use in all app. (e.g, when is allowed on the browser and disbled on system
> app). 
> 
> This way, we can land the first bug, because this functionallity doesn't
> have blockers.
> 
> Regards

This makes sense to me. As an alternative, I can also add a build-time flag to turn the toggle switch feature on/off to prevent us from waiting on the dependency.
(In reply to Marina Rodríguez [:mai] from comment #29)
> 
> WDYT about splitting this bug in two:
>   One with the new functionality (the app detail view) without the Data
> control section.
>   Other with only the data control section.

Makes sense. Let's split it in two.

> IMHO, I'm not sure if have sense allow to the user disable the data mobile
> use in all app. (e.g, when is allowed on the browser and disbled on system
> app). 

Indeed, there are some sceneries that worth to be considered specifically, let's file a bug.

> 
> This way, we can land the first bug, because this functionallity doesn't
> have blockers.

Perfect.
Flags: needinfo?(salva)
Created Bug 1077546 to track the addition of the "app detail" view. Moving the patch over to the new bug. I'll then add a much smaller patch to this bug that simply adds the toggle switch.
Target Milestone: 2.1 S4 (12sep) → 2.1 S7 (Oct24)
User Story: (updated)
Attached file pull-request (master) (obsolete) —
Re-submitted PR on top of the bug1077546 patch to separate the app detail view from the controls for enabling/disabling data as discussed in Comment 31 and Comment 32. Carrying ui-review+ over from previous PR.
Attachment #8481426 - Attachment is obsolete: true
Attachment #8481426 - Flags: review?(mri)
Attachment #8481426 - Flags: feedback?(marshall)
Attachment #8508758 - Flags: ui-review+
Attachment #8508758 - Flags: review?(mri)
Blocks: 1089983
Keywords: feature
Whiteboard: [ucid:SMRTDATA-2-1]
Whiteboard: [ucid:SMRTDATA-2-1] → [ucid:SMRTDATA-2-1][NaBfT]
Are there any discussions to include wifi data blocking? Paul already raised this in comment 2.
Flags: needinfo?(jdarcangelo)
Nevermind. It seems like this is offline mode we have in Firefox, according to bug 786419 and bug 1042745.
Flags: needinfo?(jdarcangelo)
blocking-b2g: --- → backlog
feature-b2g: 2.2? → 2.2+
QA Contact: jlorenzo
I'm taking this, but just to rebase and land Justin's patch.
Assignee: jdarcangelo → chrislord.net
Status: NEW → ASSIGNED
Rebase.
Attachment #8508758 - Attachment is obsolete: true
Attachment #8508758 - Flags: review?(marina.rodriguez.iglesias)
Attachment #8529046 - Flags: ui-review+
Attachment #8529046 - Flags: review?(marina.rodriguez.iglesias)
[Tracking Requested - why for this release]:
feature-b2g: 2.2+ → ---
tracking-b2g: --- → ?
Assignee: chrislord.net → nobody
Status: ASSIGNED → NEW
blocking-b2g: backlog → ---
Attachment #8529046 - Flags: review?(marina.rodrigueziglesias)
Closing bug as b2g code is getting removed (bug 1306391).
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: