Closed
Bug 712778
Opened 13 years ago
Closed 11 years ago
[b2g] Add a temporary mozSettings API to b2g/
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: vingtetun, Assigned: vingtetun)
References
Details
Attachments
(1 file, 1 obsolete file)
13.70 KB,
patch
|
Details | Diff | Splinter Review |
Until we have a real mozSettings API we need a way to read/write some settings on b2g/. This will let us communicate between the homescreen and the settings apps.
The patch add navigator.mozSettings with the interface describe at https://wiki.mozilla.org/WebAPI/SettingsAPI.
The first setting added by this patch is the 'lockscreen' settings. It permit to enabled/disabled the lockscreen.
The next setting I want to add, is a setting to active/unactive mozVibrate when we hit a keyboard key.
For the future I wonder if we want to keep this code (and fix it) and assume Javascript will be able to customize every device parts?
Attachment #583633 -
Flags: feedback?(jones.chris.g)
Comment 1•13 years ago
|
||
Comment on attachment 583633 [details] [diff] [review]
Patch
Review of attachment 583633 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/components/Settings.idl
@@ +33,5 @@
> + * the terms of any one of the MPL, the GPL or the LGPL.+
> + *
> + * ***** END LICENSE BLOCK ***** */
> +
> +#include "domstubs.idl"
#include "nsISupports.idl" should be enough I believe.
@@ +38,5 @@
> +#include "nsIDOMEventTarget.idl"
> +interface nsIDOMEventListener;
> +
> +[scriptable, function, uuid(145beb30-2c1a-11e1-897f-3782443b81b7)]
> +interface nsIDOMSettingsMessage: nsISupports
nsIDOMMozSettingsMessage
@@ +45,5 @@
> + readonly attribute DOMString value;
> +};
> +
> +[scriptable, uuid(67c95886-2bff-11e1-a32a-7f05d9257d68)]
> +interface nsIDOMSettingsRequest: nsIDOMEventTarget
nsIDOMMozSettingsRequest
@@ +60,5 @@
> + attribute nsIDOMEventListener onerror;
> +};
> +
> +[scriptable, uuid(4710f8b0-2bf0-11e1-8987-f382ed00ffcc)]
> +interface nsIDOMSettings: nsISupports
nsIDOMMozSettings
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #584027 -
Flags: review?(jones.chris.g)
Assignee | ||
Updated•13 years ago
|
Attachment #583633 -
Flags: feedback?(jones.chris.g)
Assignee | ||
Updated•13 years ago
|
Attachment #583633 -
Attachment is obsolete: true
Comment on attachment 584027 [details] [diff] [review]
Patch v0.2
The actual code here looks ok but I'm not sure how it helps us move forward. The DOM settings api being proposed is going to have to effect system services, like settings.gps.enabled = true needs to turn on gps. So the settings here need to trigger code to run.
This patch looks like a stripped-down IDB impl. What if we had the homescreen keep an IDB for your uses here and allowed the settings app to use a proto-intents API (built on postmessage) to frob those settings?
Clearing review request pending answers.
Attachment #584027 -
Flags: review?(jones.chris.g)
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Chris Jones [:cjones] [:warhammer] from comment #3)
> Comment on attachment 584027 [details] [diff] [review]
> Patch v0.2
>
> The actual code here looks ok but I'm not sure how it helps us move forward.
> The DOM settings api being proposed is going to have to effect system
> services, like settings.gps.enabled = true needs to turn on gps. So the
> settings here need to trigger code to run.
Yep. That's something I have tried to ask in #c0: Will it be enough DOM APIs to let JavaScript manipulate every parts of the device.
>
> This patch looks like a stripped-down IDB impl. What if we had the
> homescreen keep an IDB for your uses here and allowed the settings app to
> use a proto-intents API (built on postmessage) to frob those settings?
>
I will do that.
Comment 5•13 years ago
|
||
(In reply to Vivien Nicolas (:vingtetun) from comment #4)
> (In reply to Chris Jones [:cjones] [:warhammer] from comment #3)
> > The actual code here looks ok but I'm not sure how it helps us move forward.
> > The DOM settings api being proposed is going to have to effect system
> > services, like settings.gps.enabled = true needs to turn on gps. So the
> > settings here need to trigger code to run.
>
> Yep. That's something I have tried to ask in #c0: Will it be enough DOM APIs
> to let JavaScript manipulate every parts of the device.
I would also need some kind of global listener in mozSettings to run something like "start loading IME db when the keyboard layout is turned on for the first time"
Yep, the API will offer a way to add read-only listeners. See the recent discussion on dev-webapi.
Assignee | ||
Comment 7•11 years ago
|
||
We finally ends up with a mozSettings API written in JS :)
Since this has been done a long time ago I believe that this bug can be closed WONTFIX now.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•