Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.

Constants

ACCELEROMETER_ROTATION

Control whether the accelerometer will be used to change screen
orientation. If 0, it will not be used unless explicitly requested
by the application; if 1, it will be used by default unless explicitly
disabled by the application.

END_BUTTON_BEHAVIOR

What happens when the user presses the end call button if they're not
on a call.Values:
0 - The end button does nothing.
1 - The end button goes to the home screen.
2 - The end button puts the device to sleep and locks the keyguard.
3 - The end button goes to the home screen. If the user is already on the
home screen, it puts the device to sleep.

SCREEN_BRIGHTNESS_MODE_MANUAL

SCREEN_OFF_TIMEOUT

The amount of time in milliseconds before the device goes to sleep or begins
to dream after a period of inactivity. This value is also known as the
user activity timeout period since the screen isn't necessarily turned off
when it expires.

VIBRATE_WHEN_RINGING

Whether the phone vibrates when it is ringing due to an incoming call. This will
be used by Phone and Setting apps; it shouldn't affect other apps.
The value is boolean (1 or 0).
Note: this is not same as "vibrate on ring", which had been available until ICS.
It was about AudioManager's setting and thus affected all the applications which
relied on the setting, while this is purely about the vibration setting for incoming
calls.

Public constructors

Settings.System

Public methods

canWrite

Checks if the specified app can modify system settings. As of API
level 23, an app cannot modify system settings unless it declares the
WRITE_SETTINGS
permission in its manifest, and the user specifically grants
the app this capability. To prompt the user to grant this approval,
the app must send an intent with the action ACTION_MANAGE_WRITE_SETTINGS, which causes
the system to display a permission management screen.

getFloat

Convenience function for retrieving a single system 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.

getInt

Convenience function for retrieving a single system 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.

getInt

Convenience function for retrieving a single system 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.

getLong

Convenience function for retrieving a single system 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.

putFloat

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

putInt

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

putLong

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.