Global SettingsThe Global Settings component provides a common API and storage for all applications and services to access user preferences (fonts, sizes, themes) and other application setting and configuration data. Global Settings are hierarchical and could be used, e.g., as the basis for OMA Device Management settings storage. The component is designed to support the security requirements of OMA Device Management. The storage for Global Settings uses the recently open-sourced libsqlfs project layered on SQLite. Global Settings provides generic, non-mobile specific, storage. The Global Settings service provides functions for storing user preferences. It provides APIs for the setting and getting of software configurations (typically key-value pairs such as "font size: 12 points"). The settings keys may form a hierarchy like a directory tree, with each key comparable a file or directory in a file system. E.g. "applications/datemanager/fontsize". Indeed, Global Settings can be implemented on top of a file system. Due to file system limitations in the mobile environment we will implement it differently. But conceptually Global Settings tree follows the logic structure of an Posix file system; each key has a value and meta data such as a user id, a group id, and an access permission. Data Model
Null ValuesWhen a new key is created, it can have no values, or just the null value. This value has the type "INVALID" and a size of zero. This is useful for creating a key and setting the value to something later. This is also required for creating a directory—which requires to create the key for the directory entry first, as described below. Value data typesGlobal Settings support the following data types for key values:
There are specific convenience APIs for reading and writing such data types except lists. List Value RepresentationDue to the complexity in creating and manipulating list values, there are no specific APIs for list values. Instead you have to create lists by yourself. Global Settings list values are to be represented in memory using the glib data structure GList, with each element represented by a GList node whose "data" member points to an AlpGlobalSettingsValue. Key pathsThe possible key names or key strings form a key space, which is similar to the space of file paths. The key strings are also called key paths. Each key path can be absolute or relative; absolute key or key paths must start with /, and relative key paths are relative to a "current directory" or a "cwd". There are APIs to get and to set the "cwd." "Directory" keysA "directory" is a key which contains other keys. A directory is like the interior nodes in the OMA-DM Tree definition. To simplify our design we disallow a directory key from having its own content. So if you add a child key to an existing key which has no value (or having the null value), that key becomes a directory and attempts to set the content for that key will fail in the future. Permissions for directories will then follow the corresponding semantics in the Unix file system.
Default valuesWe use a simple mechanism for supporting default values. For a key S, we define that it has a default value if another key named S.default exists. Then an get key operation on S will return the content of S.default if the key S does not exist. Key ConventionsKey names should follow a standard convention to allow grouping of similar attributes under the same part of the key hierarchy. We will follow the GConf conventions as closely as possible for application preferences and system settings, with consideration for device-specific standards like /dm for OMA-DM. Data SecurityThe Global Settings service is not meant for storage of security-sensitive data such as passwords or private keys. The data in the Global Settings are only protected by Unix file permissions and are not encrypted or Digital Restriction Managed! Permission ControlGlobal Settings implements the POSIX file permission (user, group and others, readable, writeable or executable) model on the keys and the key hierarchy. So a run time process has to acquire the appropriate user or group IDs to access a key the same way it access a file with the same POSIX permission bits in the host file system.
Global Settings has reserved rooms for extra attributes for keys, currently not implemented but these could be used for access control lists or some other meta data but I treat such usage as the best to be avoided; if POSIX permissions provide all that's needed it is the best as it is simple and efficient. Initial key installationWith the above convention for keys, it becomes desirable for the applications or specific device (drivers) to create its key hierarchy during the installation time (or at the point of system image creation). Once created a hierarchy may be protected from access by applications other than the designated applications.
Background ActivitiesThe Global Settings daemon will be started at system boot time. Packages will need to include their associated default preferences and these will need to be installed in the correct fashion for the underlying preferences system. This is likely to be handled by a script executed by the package manager (and/or hot sync?) after extracting the files and verifying proper permissions. Change NotificationClients that wish to be informed of changes in settings, can register a callback with the system's Notification Manager. The Global Settings daemon will send out to Notification Manager a string representing each key that it changes. Notification Manager will notify each app that has registered to be told about that key changing. (Notification Manager will notify each app that registered for that key, or a prefix of that key. E.g. an app that registered for "oma/apps" would be notified when any of the following keys changed: "oma/apps/calendar/fontsize", "oma/apps/date/background-image", or "oma/apps". Detailed information on Global Settings can be found here.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 2007, The Hiker Project. All rights reserved. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||