public static final class

LineageSettings.Global

extends Settings.NameValueTable
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

Constants
String SYS_PROP_LINEAGE_SETTING_VERSION
String WEATHER_TEMPERATURE_UNIT Global temperature unit in which the weather data will be reported Valid values are:

CELSIUS

FAHRENHEIT

[Expand]
Inherited Constants
From class android.provider.Settings.NameValueTable
From interface android.provider.BaseColumns
Fields
public static final Uri CONTENT_URI
Public Constructors
LineageSettings.Global()
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
From class java.lang.Object

Constants

public static final String SYS_PROP_LINEAGE_SETTING_VERSION

added in API level 8

Constant Value: "sys.lineage_settings_global_version"

public static final String WEATHER_TEMPERATURE_UNIT

added in API level 8

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

added in API level 8

Public Constructors

public LineageSettings.Global ()

added in API level 8

Public Methods

public static float getFloat (ContentResolver cr, String name, float def)

added in API level 8

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)

added in API level 8

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.
Throws
LineageSettings.LineageSettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not a float.

public static int getInt (ContentResolver cr, String name)

added in API level 8

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.
Throws
LineageSettings.LineageSettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.

public static int getInt (ContentResolver cr, String name, int def)

added in API level 8

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)

added in API level 8

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.
Throws
LineageSettings.LineageSettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.

public static long getLong (ContentResolver cr, String name, long def)

added in API level 8

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)

added in API level 8

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)

added in API level 8

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)

added in API level 8

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)

added in API level 8

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)

added in API level 8

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)

added in API level 8

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