public class ConfigurationManager
extends java.lang.Object
ConfigurationManager gives the developer the ability to browse and set the configuration properties of the device. The device, as a managed device, exposes properties organized in a tree. Each property has a unique identifier used to uniquely identify the property.
ConfigurationManager is the sdk access point to the whole of properties that describes and allows the configuration of the device.PropertyID.PropertyGroupID..The ConfigurationManager offers methods:
A Property offers methods to get/set the value.
When the value of a property is modified it is not directly applied to the device.
The change is only kept in the sdk local image of the configuration that’s the tree of properties.
To actually apply the change to the device the ConfigurationManager commit() method must be called.
A group PropertyGroup offers methods:
| Constructor and Description |
|---|
ConfigurationManager(android.content.Context context)
This is the constructor of ConfigurationManager.
|
| Modifier and Type | Method and Description |
|---|---|
int |
commit()
Applies all the modified values since the last
commit() to the device
and also commits them to the persistent storage. |
Property |
getPropertyById(int id)
Returns the
Property whose identifier has the given integer value PropertyID. |
Property |
getPropertyByName(java.lang.String name)
Gets the
Property whose identifier has the integer value defined by the given constant PropertyID. |
PropertyGroup |
getPropertyGroupById(int id)
Gets the
PropertyGroup whose identifier has the given integer value PropertyGroupID. |
PropertyGroup |
getPropertyGroupByName(java.lang.String name)
Gets the
PropertyGroup whose identifier has the integer value defined by the given string PropertyGroupID. |
PropertyGroup |
getTreeRoot()
Returns the
PropertyGroup root of the tree of Propertys of the configuration. |
int |
registerListener(ConfigurationChangeListener listener)
Register the
ConfigurationChangeListener. |
int |
unregisterListener(ConfigurationChangeListener listener)
Unegister the
ConfigurationChangeListener. |
public ConfigurationManager(android.content.Context context)
context - Context context of the caller applicationConfigException - in case of error.public int registerListener(ConfigurationChangeListener listener)
ConfigurationChangeListener.listener - ConfigurationChangeListener listener used to be notified of a change of the configurationConfigException.SUCCESS in case of success, otherwise a possible error
code, matching one of the ConfigException error constants.public int unregisterListener(ConfigurationChangeListener listener)
ConfigurationChangeListener.listener - ConfigurationChangeListener listener to be notified of a change of the configurationConfigException.SUCCESS in case of success, otherwise a possible error
code, matching one of the ConfigException error constants.public PropertyGroup getTreeRoot()
PropertyGroup root of the tree of Propertys of the configuration.PropertyGroup representing the root of the configuration tree.public Property getPropertyById(int id)
Property whose identifier has the given integer value PropertyID.
If a property with the given id is not found NULL is returned.
If the returned property is not supported, get and set on the property will fail.id - int unique identifier of the requested propertyProperty.public Property getPropertyByName(java.lang.String name)
Property whose identifier has the integer value defined by the given constant PropertyID.
If a property with the given name is not found NULL is returned.
If the returned property is not supported, get and set on the property will fail.name - String defining string of the unique identifier of the requested propertyProperty.public PropertyGroup getPropertyGroupById(int id)
PropertyGroup whose identifier has the given integer value PropertyGroupID.
If a propertyGroup with the given id is not found NULL is returned.id - int integer value of the identifier of the requested groupPropertyGroup.public PropertyGroup getPropertyGroupByName(java.lang.String name)
PropertyGroup whose identifier has the integer value defined by the given string PropertyGroupID.
If a propertyGroup with the given name is not found NULL is returned.name - String name of the requested groupPropertyGroup.public int commit()
commit() to the device
and also commits them to the persistent storage.
All the properties committed in this way will maintain the set value between reboots.
It works in best effort. If the application of some properties failed, the list of their identifiers
is returned through the exception ConfigException.bad_id_buffer.ConfigException.SUCCESS in case of success, otherwise a possible error
code, matching one of the ConfigException error constants.ConfigException - in case of error, when exceptions are enabled through the ErrorManager singleton.