On 23/05/13 09:08, Gene Lian wrote:
>> 1. Settings API is a privileged API, which means it cannot be exposed
>> to the normal web content. For example, the |time.timezone| setting
>> could be one of the overuse-case because the non-privileged apps
>> might also want to set the time zone and receive the time zone
>> changed event whenever the system time zone or DST info is updated.
IMO, the Settings API should have finer permissions, depending on the
setting you want to access and what you want to do. Reading some stuff
could be more open than others and writing could be even more restricted.
>> 2. It's not very clear to me what the main scope of the Settings API
>> is. Should it be everything related to the system settings? Or only
>> the setting entries in the Settings App? Or any values we like to
>> synchronize among apps (processes)?
This is something we had a hard time to define and I'm not sure we ever
did. Are we expecting an RSS app to store in the Settings API its
settings? I think we don't. However, I do not think it should be limited
to the Settings App but if something is used in the Settings API and
isn't used in the Settings App, we should at least think why it is in
the Settings API and why not in the Settings App.
Regarding values we want to synchronise between applications, I believe
it would depend on the value and I would refer to what I said above: Is
that a setting we want to show in the Settings App? If not, why? If we
use this as a convenient way for our developers to create a channel
between two apps, this is clearly wrong.
>> 3. If we have a better purpose-specific API to use, should we put
>> that in the Settings API? For example, recently we're discussing
>> about where to put the *default SIM info* (i.e. service ID) because
>> we're hoping to support the Multi-SIM features and the system might
>> need to know a default SIM to make calls or do messaging... etc.
>> Since we've already had Telephony API to make calls, should we
>> extend that API to set/get the default SIM? Or create another new
>> entry again in the Settings API and hook everything up to that
>> setting?
Regarding Multi-SIM, I believe that some information should be saved as
settings because they might reflect user input and could be used by any
other application in the system. For example, the preferred SIM card,
and probably some other settings.
>> 4. As a Gecko developer, I cannot see a very explicit list of the
>> current setting entries in the codes. They are being created,
>> written, listened and scattered around everywhere. Do we have a more
>> formal place or document to manage all of them?
I wonder if having a whitelist of setting could solve that problem? It
depends if we expect third party applications to create new settings? I
would tend to say that this shouldn't happen and ideally we should know
which settings are out there which means that we should be able to
reject any setting creation that isn't expected.
> 5. In our current codes, all the processes are allowed to modify the settings values through the Settings API, which means the Gecko end can also modify the settings and the Gaia end will get settings changed events, or vice versa. Is that really what we want? Some Gaia folks complain their settings are magically changed but no apps are triggering that, because it's actually changed by Gecko. It's currently happening in the RIL, wifi, system time and lots of system settings.
I do not see why Gecko modifying the setting is a bad thing.
Applications that expect to be the only one to change a setting have a bug.
Thank you for bringing this issue Gene.
Cheers,
--
Mounir