Closed Bug 1037395 Opened 10 years ago Closed 10 years ago

Overriding profile value with partner preferences on common prefs

Categories

(Firefox OS Graveyard :: Gaia::Build, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1045523

People

(Reporter: leila.hadji, Assigned: leila.hadji)

References

Details

Attachments

(1 file)

Today there are three optional files that may be provided to extend the set of default preferences for Firefox OS. These are custom-prefs.js, gps-prefs.js and payment-prefs.js. To modify any value in any of these files, vendor needs to patch the corresponding file (e.g. to modify gps preferences,  $gaia/build/config/gps-prefs.js needs to be modified), which means patching Gaia application framework of Firefox OS, introducing unnecessary cost both to development but also to performance of the routine.

To avoid that platform offers a possibility to introduce optional preference files provided by partners, e.g. OEM, (PARTNER_PREF_FILES) which are applied after the ones on the EXTENDED_PREF_FILES path. 

Unfortunately, today the user preferences from PARTNER_PREF_FILES are appended to profile/user.js, so if there is a common preference in both user.js and PARTNER_PREF_FILES they will both be applied in succession, which is not optimal. 

user.js preference should be replaced with the partner's preference value and this contribution introduces a way to replace the value from profile/user.js with the value from PARTNER_PREF_FILES.
Attachment #8454404 - Flags: review?(yurenju.mozilla)
Assignee: nobody → leila.hadji
Comment on attachment 8454404 [details] [review]
Overriding profile value with partner preferences on common prefs

Leila, thanks your patch but it's too complex if we implement it in Makefile, I suggest you move it into preferences.js, for example we can access $(PARTNER_PREF_FILES) in |writePref| and orverride default pref there.


needinfo me if you have any question.
Attachment #8454404 - Flags: review?(yurenju.mozilla)
Yuren, 
Thanks for the comment, I understand that you don't want to make the Makefile more complicated, I agree but there are two problems if I move it to preference.js:

In Makefile, first preference.js is executed and fills the user.js with pref array then $(EXTENDED_PREF_FILES) is appended to user.js and at last, $(PARTNER_PREF_FILES) is appended. 

https://mxr.mozilla.org/gaia/source/Makefile#663

1. If I add $(PARTNER_PREF_FILES) in preference.js, this is executed before  $(EXTENDED_PREF_FILES) has been added to user.js and that is not what we want, for example we have parameters in gps-prefs.js which we want to overwrite by the partner-prefs.js prefs.

2. We already have the appending to partner-prefs.js in Makefile, so either this should be removed or we will have two parts taking care of parner-prefs.js items.
Flags: needinfo?(yurenju.mozilla)
it's easy, we can migrate all snippets for preferences in Makefile to preferences.js then you can solve this bug easily in javascript.

I filed bug 1039219 for it.
Depends on: 1039219
Flags: needinfo?(yurenju.mozilla)
bug 1039219 has not been landed yet on gaia/, will continue after my vacation.
I think this is fixed in 1045523 so we can close the bug.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: