Closed Bug 1060173 Opened 8 years ago Closed 7 years ago

[PP] Initialize the settings


(Firefox OS Graveyard :: Gaia, defect)

Gonk (Firefox OS)
Not set



feature-b2g 2.2+


(Reporter: marta, Assigned: agnieszka.baranowska)



(Keywords: privacy)


(1 file)

Initialize the settings to defaults and store them in settingsDB
Summary: PP: Initialize the settings → [PP] Initialize the settings
Keywords: privacy
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → All
QA Whiteboard: STATUS: ?
Priority: -- → P2
QA Whiteboard: STATUS: ? → STATUS: not started
SettingsDB is the same as device's settings.
The Settings API is a way to access, change, and monitor changes to any settings.

Example to access settings:
var lock = navigator.mozSettings.createLock();
var setting = lock.get('wifi.enabled');
setting.onsuccess = function () {
  console.log('wifi.enabled: ' + setting.result);
setting.onerror = function () {
  console.warn('An error occured: ' + setting.error);

Example to change settings:
var lock = navigator.mozSettings.createLock();
var result = lock.set({
  'wifi.enabled': true
result.onsuccess = function () {
  console.log("the settings has been changed");
result.onerror = function () {
  console.log("An error occure, the settings remain unchanged");

Marta, please confirm (to have 100% certainty that we all say about the same).
Initialization of settings to defaults should run once, when user run application for the first time. As so far, we don't see need to initialize settings to defaults again. Initialization should be executed by invoking of JavaScript function (JavaScript file with this function should be part of privacy-panel app).

Marta, please confirm.
the settings should be preserved between resets of the app and the phone. This bug is to make sure that we have all of the elements declared in such a way that the appropriate fields are added to the settingsDB during build of the system. You are right - you should set it the same way I showed you at the begging. Nothing changes here. This patch should create the fields in settingsDB during the build.
Assignee: marta → agnieszka.baranowska
Priority: P2 → P3
QA Whiteboard: STATUS: not started → STATUS: ready for review
Priority: P3 → --
Blocks: 1068017
Blocks: 1069915
Blocks: 1071042
Closed: 7 years ago
Resolution: --- → FIXED
feature-b2g: --- → 2.2+
You need to log in before you can comment on or make changes to this bug.