java.lang.Object |
↳ |
android.provider.Settings.NameValueTable |
|
↳ |
lineageos.providers.LineageSettings.Global |
Class Overview
Global settings, containing miscellaneous Lineage global preferences. This
table holds simple name/value pairs. There are convenience
functions for accessing individual settings entries.
Summary
[Expand]
Inherited Constants |
From class
android.provider.Settings.NameValueTable
|
From interface
android.provider.BaseColumns
|
Public Methods |
static
float
|
getFloat(ContentResolver cr, String name, float def)
Convenience function for retrieving a single settings value
as a floating point number.
|
static
float
|
getFloat(ContentResolver cr, String name)
Convenience function for retrieving a single system settings value
as a float.
|
static
int
|
getInt(ContentResolver cr, String name)
Convenience function for retrieving a single settings value
as an integer.
|
static
int
|
getInt(ContentResolver cr, String name, int def)
Convenience function for retrieving a single settings value
as an integer.
|
static
long
|
getLong(ContentResolver cr, String name)
Convenience function for retrieving a single settings value
as a long .
|
static
long
|
getLong(ContentResolver cr, String name, long def)
Convenience function for retrieving a single settings value
as a long .
|
static
String
|
getString(ContentResolver resolver, String name)
Look up a name in the database.
|
static
Uri
|
getUriFor(String name)
Construct the content URI for a particular name/value pair, useful for monitoring changes
with a ContentObserver.
|
static
boolean
|
putFloat(ContentResolver cr, String name, float value)
Convenience function for updating a single settings value as a
floating point number.
|
static
boolean
|
putInt(ContentResolver cr, String name, int value)
Convenience function for updating a single settings value as an
integer.
|
static
boolean
|
putLong(ContentResolver cr, String name, long value)
Convenience function for updating a single settings value as a long
integer.
|
static
boolean
|
putString(ContentResolver resolver, String name, String value)
Store a name/value pair into the database.
|
[Expand]
Inherited Methods |
From class
android.provider.Settings.NameValueTable
static
Uri
|
getUriFor(Uri arg0, String arg1)
|
static
boolean
|
putString(ContentResolver arg0, Uri arg1, String arg2, String arg3)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
public
static
final
String
SYS_PROP_LINEAGE_SETTING_VERSION
Constant Value:
"sys.lineage_settings_global_version"
public
static
final
String
WEATHER_TEMPERATURE_UNIT
Global temperature unit in which the weather data will be reported
Valid values are:
CELSIUS
FAHRENHEIT
Constant Value:
"weather_temperature_unit"
Fields
public
static
final
Uri
CONTENT_URI
Public Constructors
public
LineageSettings.Global
()
Public Methods
public
static
float
getFloat
(ContentResolver cr, String name, float def)
Convenience function for retrieving a single settings value
as a floating point number. Note that internally setting values are
always stored as strings; this function converts the string to an
float for you. The default value will be returned if the setting
is not defined or not a valid float.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
float : Value to return if the setting is not defined. |
Returns |
float |
The setting's current value, or 'def' if it is not defined
or not a valid float.
|
public
static
float
getFloat
(ContentResolver cr, String name)
Convenience function for retrieving a single system settings value
as a float. Note that internally setting values are always
stored as strings; this function converts the string to a float
for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws LineageSettings.LineageSettingNotFoundException
.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns |
float |
The setting's current value.
|
public
static
int
getInt
(ContentResolver cr, String name)
Convenience function for retrieving a single settings value
as an integer. Note that internally setting values are always
stored as strings; this function converts the string to an integer
for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws LineageSettings.LineageSettingNotFoundException
.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns |
int |
The setting's current value.
|
public
static
int
getInt
(ContentResolver cr, String name, int def)
Convenience function for retrieving a single settings value
as an integer. Note that internally setting values are always
stored as strings; this function converts the string to an integer
for you. The default value will be returned if the setting is
not defined or not an integer.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
int : Value to return if the setting is not defined. |
Returns |
int |
The setting's current value, or 'def' if it is not defined
or not a valid integer.
|
public
static
long
getLong
(ContentResolver cr, String name)
Convenience function for retrieving a single settings value
as a long
. Note that internally setting values are always
stored as strings; this function converts the string to a long
for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws LineageSettings.LineageSettingNotFoundException
.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns |
long |
The setting's current value. |
public
static
long
getLong
(ContentResolver cr, String name, long def)
Convenience function for retrieving a single settings value
as a long
. Note that internally setting values are always
stored as strings; this function converts the string to a long
for you. The default value will be returned if the setting is
not defined or not a long
.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
long : Value to return if the setting is not defined. |
Returns |
long |
The setting's current value, or 'def' if it is not defined
or not a valid long .
|
public
static
String
getString
(ContentResolver resolver, String name)
Look up a name in the database.
Parameters |
resolver |
ContentResolver : to access the database with |
name |
String : to look up in the table |
Returns |
String |
the corresponding value, or null if not present
|
public
static
Uri
getUriFor
(String name)
Construct the content URI for a particular name/value pair, useful for monitoring changes
with a ContentObserver.
Parameters |
name |
String : to look up in the table |
Returns |
Uri |
the corresponding content URI
|
public
static
boolean
putFloat
(ContentResolver cr, String name, float value)
Convenience function for updating a single settings value as a
floating point number. This will either create a new entry in the
table if the given name does not exist, or modify the value of the
existing row with that name. Note that internally setting values
are always stored as strings, so this function converts the given
value to a string before storing it.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
float : The new value for the setting. |
Returns |
boolean |
true if the value was set, false on database errors
|
public
static
boolean
putInt
(ContentResolver cr, String name, int value)
Convenience function for updating a single settings value as an
integer. This will either create a new entry in the table if the
given name does not exist, or modify the value of the existing row
with that name. Note that internally setting values are always
stored as strings, so this function converts the given value to a
string before storing it.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
int : The new value for the setting. |
Returns |
boolean |
true if the value was set, false on database errors
|
public
static
boolean
putLong
(ContentResolver cr, String name, long value)
Convenience function for updating a single settings value as a long
integer. This will either create a new entry in the table if the
given name does not exist, or modify the value of the existing row
with that name. Note that internally setting values are always
stored as strings, so this function converts the given value to a
string before storing it.
Parameters |
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
long : The new value for the setting. |
Returns |
boolean |
true if the value was set, false on database errors
|
public
static
boolean
putString
(ContentResolver resolver, String name, String value)
Store a name/value pair into the database.
Parameters |
resolver |
ContentResolver : to access the database with |
name |
String : to store |
value |
String : to associate with the name |
Returns |
boolean |
true if the value was set, false on database errors
|