FSO: settings and profiles

Guillaume Chereau charlie at openmoko.org
Fri Aug 8 07:09:53 CEST 2008

Matt Joyce wrote:
> On Fri, Aug 8, 2008 at 8:36 AM, Fredrik Wendt <fredrik at wendt.se> wrote:
>>> And there is a profile switcher planned I hope?
>> I just can't let go of the idea of having several profiles activated at
>> the same time, so I'll spam you all once more (last time, I promise).
I will once again explain my current goal for the framework profile 
First : I gave up my original idea of having a single activated profile. 
So don't worry. We DO have several activated profiles.

I will implement it this way (thanks to several advices from various 
people, can't remember the names to give credit) :

* There is a list of activated profiles, e.g : [Home, Silent, Default]
* When the preferences service try to get a parameter, if the parameter 
is profile dependent, it will first look for the profile at the top of 
the list. If the profile doesn't define the value, then we look in the 
next profile on the list and so on... This way we can have as many 
activated profiles as we want, and we can deal with conflicts between 
* The framework preferences service will have a SetProfile(profile) 
method, this method creates a new profiles list like the following one  
: [profile,  Default], so it emulate a "single profile" mode
* It will also have Append, Push, Pop, Remove, etc methods, so that we 
have full control over the profile list.

* The events service can -among other things- modify the profiles list 
when specific events occur. e.g :
   - ON Noisy THEN AppendProfile(Noisy)
   - ON Quiet THEN RemoveProfile(Noisy)
   The rules are triggered in the order they appear in the conf file ( 
for info about the actual format of the file, see [0] )

- charlie


More information about the community mailing list