Closed Bug 1158710 Opened 10 years ago Closed 10 years ago

Don't emulate mozSettings entries every time the phone boots

Categories

(Firefox OS Graveyard :: Performance, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: timdream, Assigned: timdream)

References

Details

Attachments

(1 obsolete file)

https://hg.mozilla.org/mozilla-central/annotate/37d60e3b8be6/dom/settings/SettingsDB.jsm#l70 Apparently we load settings.json and update the default value of the database EVERY TIME the phone boots. Gonna try mstone and buildID check just like AppsUtils.jsm do.
Attached patch Patch v1.0 (obsolete) — Splinter Review
This patch introduces two prefs just AppsUtils.jsm to denote whether or not we have updated the database. I simply copy the isFirstRun() function there. This is obviously not the best approach but it's the "done" approach. I would imagine the safer way (to against power loss during upgrading db) would be save these two values into the same database directly (w/ the same transaction), but I don't want to spend too much time on this -- bug 1112092 is more valuable than this one. AppUtils.isFirstRun() is not tested -- I presume this is too small to test too.
Attachment #8597854 - Flags: review?(anygregor)
Will broadcast at dev-b2g/dev-gaia once this landed, since this patch implies settings.json changes (w/ |make install-gaia| will not be picked up unless there is a accompany buildID change.
Wait -- upgradeSchema() only hits when SETTINGSDB_VERSION changes...
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Attachment #8597854 - Attachment is obsolete: true
Attachment #8597854 - Flags: review?(anygregor)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: