Closed
Bug 1042745
Opened 11 years ago
Closed 9 years ago
Expose network enable/disable for specific apps to Gaia
Categories
(Firefox OS Graveyard :: Gaia::Cost Control, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
2.1 S7 (24Oct)
People
(Reporter: marshall, Assigned: marshall)
References
Details
(Keywords: feature, Whiteboard: [NaBfT])
Attachments
(3 files, 1 obsolete file)
|
1.27 KB,
patch
|
ehsan.akhgari
:
review-
|
Details | Diff | Splinter Review |
|
13.60 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.19 KB,
patch
|
valentin
:
feedback+
|
Details | Diff | Splinter Review |
To enable basic control of data usage per app, we need to expose an API from Gecko that allows the settings app to toggle network connectivity for a specific app.
We'll need the necko support in Bug 786419 to land first before we can expose this as a WebAPI
Comment 1•11 years ago
|
||
Are we just exposing something to the settings app?
Comment 2•11 years ago
|
||
Please post something to dev-webapi when you know more about the details here, but I think this should be a straightforward addition to the mozApps API.
| Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Andrew Overholt [:overholt] from comment #1)
> Are we just exposing something to the settings app?
The bug wording was a little hasty, it turns out most of this will be used from settings within costcontrol.
Updated•11 years ago
|
Target Milestone: --- → 2.1 S3 (29aug)
Comment 4•11 years ago
|
||
Please note that ioservice.setAppOffline(appId, Ci.nsIAppOfflineInfo.OFFLINE) cannot be called from the content process - it would return NS_ERROR_FAILURE.
The mozApps API should send the command to the parent process, and run it there.
| Assignee | ||
Comment 5•11 years ago
|
||
This is just the first implementation and API, looking for a little feedback.
I'm in the process of writing mochitests that cover the new APIs.
Attachment #8483739 -
Flags: feedback?(valentin.gosu)
Attachment #8483739 -
Flags: feedback?(ehsan.akhgari)
| Assignee | ||
Comment 6•11 years ago
|
||
I forgot to mention, this is based on Val's current series of patches in Bug 786419
Updated•11 years ago
|
Assignee: nobody → marshall
feature-b2g: --- → 2.2?
Target Milestone: 2.1 S3 (29aug) → 2.1 S4 (12sep)
Comment 7•11 years ago
|
||
Comment on attachment 8483739 [details] [diff] [review]
enableMobileData - v1
Review of attachment 8483739 [details] [diff] [review]:
-----------------------------------------------------------------
The IDL changes look good! Note that you'd need to get a DOM peer review on those bits.
Attachment #8483739 -
Flags: feedback?(ehsan.akhgari) → feedback+
Comment 8•11 years ago
|
||
Comment on attachment 8483739 [details] [diff] [review]
enableMobileData - v1
Looks good.
We might want to consider if at some point in the future, we might want to set an app offline, even on Wifi. But even if that's the case, we'd probably have another interface that does that.
Attachment #8483739 -
Flags: feedback?(valentin.gosu) → feedback+
Comment 9•11 years ago
|
||
Marshall,
How far are we to get this wrapped up? Can you work with the necko team and get an ETA for the dependency and closure of this feature?
Thanks
Hema
Flags: needinfo?(marshall)
Comment 10•11 years ago
|
||
The necko bits are close to landing. We're waiting on Ben Turner to review a final patch.
| Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(marshall)
Comment 11•11 years ago
|
||
(In reply to Valentin Gosu [:valentin] from comment #10)
> The necko bits are close to landing. We're waiting on Ben Turner to review a
> final patch.
Thanks Val for the update! We would like to wrap this up in this sprint, its been open for a while now.
Thanks!
Hema
Comment 12•11 years ago
|
||
The patch just got an r-.
I'm looking into fixing the issue really quickly, or considering landing the patch without the ServiceWorker bits, as the implementation has taken way more than expected.
Comment 13•11 years ago
|
||
(In reply to Valentin Gosu [:valentin] from comment #12)
> The patch just got an r-.
> I'm looking into fixing the issue really quickly, or considering landing the
> patch without the ServiceWorker bits, as the implementation has taken way
> more than expected.
Val, any update? We have been holding up work on this bug (chained dependency) because of dependent bug: https://bugzilla.mozilla.org/show_bug.cgi?id=786419 -- its been several weeks. Can we please get a definitive ETA on when we you can wrap up the dependency, so we can get a closure on overall feature (https://bugzilla.mozilla.org/show_bug.cgi?id=1035553)
Flags: needinfo?(valentin.gosu)
Flags: needinfo?(jduell.mcbugs)
Comment 14•11 years ago
|
||
I just got a final review, and pushed the changes to inbound. Assuming it sticks, we can close the bug in the next few days. Sorry it took so long. It was fairly complicated and we uncovered a few bugs after we pushed it the first time.
Flags: needinfo?(valentin.gosu)
Comment 15•11 years ago
|
||
(In reply to Valentin Gosu [:valentin] from comment #14)
> I just got a final review, and pushed the changes to inbound. Assuming it
> sticks, we can close the bug in the next few days. Sorry it took so long. It
> was fairly complicated and we uncovered a few bugs after we pushed it the
> first time.
thanks so much for the update!
Updated•11 years ago
|
Target Milestone: 2.1 S4 (12sep) → 2.1 S7 (Oct24)
Updated•11 years ago
|
Flags: needinfo?(jduell.mcbugs)
Comment 16•11 years ago
|
||
If we want to be able to block the Browser app specifically (and/or Everything.me apps), then we need to figure out a story as to how to distinguish them (since they all show up right now as {appID=[System app ID, i.e. 22], inbrowser=true}. There's been talk of using the manifest for this but no conclusion yet (see bug 1060108 and bug 1070944).
Depends on: 1060108
I'd like to enable apps to have at least the following policies:
* No internet connectivity
* Full internet connectivity
* Wifi only (i.e. no mobile data)
* No background data
* Wifi only when in background (i.e. no mobile data when in background).
"background" here is defined as "not foreground app". This is something that currently only the system app knows, but I think we'll need to start tracking that in Gecko as well. Likely by having the system app tell Gecko which app/apps are currently "in foreground".
Comment 18•11 years ago
|
||
gecko knows which app is in the background or foreground, since we rely on that to set process priority for instance.
Comment 19•11 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #17)
> I'd like to enable apps to have at least the following policies:
>
> * No internet connectivity
> * Full internet connectivity
> * Wifi only (i.e. no mobile data)
> * No background data
> * Wifi only when in background (i.e. no mobile data when in background).
The first 3 are supported by the API implemented in Bug 786419. To get the other ones, we could either have gaia set the apps offline/wifi-only when they go to the background, or consider filing another bug to add those states to nsIAppOfflineInfo.
Either of those are fine. My thinking was definitely that Gaia can take responsibility for handling the background/foreground transition.
Mainly I was concerned that if we expose App.mobileDataEnabled, then it seems weird that it would fluctuate back and forth as an app transitions between forground and background.
Updated•11 years ago
|
Whiteboard: [NaBfT]
Comment 21•11 years ago
|
||
If I understood correctly, this API is intended to let the user go in the Settings, and choose from here which applications should have network enabled or disabled.
Would there be a way for the application itself to set it? (probably with a user confirmation)
I would like, from within an application (it's a privileged one), to let the user enable/disable any network access for this app.
If it's not possible, would there be a way for the app to simply know its own status (network enabled or disabled)? And a way to redirect the user to the corresponding Settings page, so that he might change this status?
Comment 22•11 years ago
|
||
(In reply to Mossroy from comment #21)
>
> If it's not possible, would there be a way for the app to simply know its
> own status (network enabled or disabled)? And a way to redirect the user to
> the corresponding Settings page, so that he might change this status?
Not sure about the previous questions, but the app can always check navigator.onLine to see if it has connectivity. Indeed, it might be more useful to show a "This app has restricted web access" instead of the regular "You are offline" message.
Updated•11 years ago
|
feature-b2g: 2.2? → 2.2+
Comment 23•11 years ago
|
||
hey Marshall, Valentin, we'd like to know the status for this bug. Alternatively, we (the gaia team) could maybe help wrapping this up if all dependency landed. I worked in Webapps some time ago :)
Assignee: marshall → valentin.gosu
Flags: needinfo?(valentin.gosu)
Flags: needinfo?(marshall)
Comment 24•11 years ago
|
||
Hi Julien, the necko API is in place, and bug 1060108 isn't specifically blocking this one.
I don't see any problem in landing this as soon as possible.
Flags: needinfo?(valentin.gosu)
Comment 25•11 years ago
|
||
Valentin, that sounds really good. Can you then provide us a date this will be landed so we can track to it? Much appreciated.
Comment 26•11 years ago
|
||
I think Marshall should be able to provide an ETA for this.
| Assignee | ||
Comment 27•11 years ago
|
||
I'm working on finishing up the current rev of this patch and having it up for review late tonight, and hope to have it wrapped up early next week
Flags: needinfo?(marshall)
Updated•11 years ago
|
QA Contact: jlorenzo
| Assignee | ||
Comment 28•11 years ago
|
||
Attachment #8483739 -
Attachment is obsolete: true
Attachment #8531763 -
Flags: review?(ehsan.akhgari)
| Assignee | ||
Comment 29•11 years ago
|
||
Attachment #8531765 -
Flags: review?(fabrice)
Attachment #8531765 -
Flags: feedback?(valentin.gosu)
| Assignee | ||
Comment 30•11 years ago
|
||
Attachment #8531767 -
Flags: review?(fabrice)
Attachment #8531767 -
Flags: feedback?(valentin.gosu)
Attachment #8531767 -
Flags: feedback?(jdarcangelo)
Comment 31•11 years ago
|
||
Comment on attachment 8531763 [details] [diff] [review]
Part 1: Apps.webidl changes
Review of attachment 8531763 [details] [diff] [review]:
-----------------------------------------------------------------
When we added the "enabled" attribute, we did it slightly differently:
readonly attribute boolean enabled;
void setEnabled(DOMApplication app, boolean state);
attribute EventHandler onenabledstatechange;
The nice thing with this approach is that if appA (let's say settings) is changing the state of appB, any other app with access to mozApps.mgmt will be notified of the status change, while you would have to poll with your current design. So for instance the homescreen could listen to this event and tweak the icon based on this new state.
Comment 32•11 years ago
|
||
(In reply to Fabrice Desré [:fabrice] from comment #31)
> Comment on attachment 8531763 [details] [diff] [review]
> Part 1: Apps.webidl changes
>
> Review of attachment 8531763 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> When we added the "enabled" attribute, we did it slightly differently:
>
> readonly attribute boolean enabled;
> void setEnabled(DOMApplication app, boolean state);
> attribute EventHandler onenabledstatechange;
>
> The nice thing with this approach is that if appA (let's say settings) is
> changing the state of appB, any other app with access to mozApps.mgmt will
> be notified of the status change, while you would have to poll with your
> current design. So for instance the homescreen could listen to this event
> and tweak the icon based on this new state.
This would be desirable for the data-restricted error page as well, in case a user has an app with the error page visible in the background, we can automatically refresh it (or rather, remove the error page and refresh it when it gets foregrounded).
Comment 33•11 years ago
|
||
Comment on attachment 8531763 [details] [diff] [review]
Part 1: Apps.webidl changes
Review of attachment 8531763 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/webidl/Apps.webidl
@@ +98,5 @@
> Promise<DOMApplication> import(Blob blob);
> Promise<any> extractManifest(Blob blob);
>
> void setEnabled(DOMApplication app, boolean state);
> + DOMRequest setMobileDataEnabled(DOMApplication app, boolean state);
What Fabrice said. Also, I think enableMobileData/disableMobileData methods are better as they make things more explicit at the callsite.
Attachment #8531763 -
Flags: review?(ehsan.akhgari) → review-
Updated•11 years ago
|
Attachment #8531765 -
Flags: review?(fabrice)
Updated•11 years ago
|
Attachment #8531767 -
Flags: review?(fabrice)
Comment 34•11 years ago
|
||
[Tracking Requested - why for this release]:
feature-b2g: 2.2+ → ---
tracking-b2g:
--- → ?
Updated•10 years ago
|
Attachment #8531765 -
Flags: feedback?(valentin.gosu)
Updated•10 years ago
|
Attachment #8531767 -
Flags: feedback?(valentin.gosu) → feedback+
Updated•10 years ago
|
Assignee: valentin.gosu → marshall
Updated•10 years ago
|
tracking-b2g:
backlog → ---
Keywords: feature
Comment 35•9 years ago
|
||
Bulk-clearing old NI? requests. If this still needs my attention, please re-flag me. Thanks.
Updated•9 years ago
|
Attachment #8531767 -
Flags: feedback?(jdarcangelo)
Comment 36•9 years ago
|
||
Closing bug as b2g code is getting removed (bug 1306391).
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•