Settings.Secure
public
static
final
class
Settings.Secure
extends Settings.NameValueTable
java.lang.Object | ||
↳ | android.provider.Settings.NameValueTable | |
↳ | android.provider.Settings.Secure |
Secure system settings, containing system preferences that applications can read but are not allowed to write. These are for preferences that the user must explicitly modify through the UI of a system app. Normal applications cannot modify the secure settings database, either directly or by calling the "put" methods that this class contains.
Summary
Constants | |
---|---|
String |
ACCESSIBILITY_DISPLAY_INVERSION_ENABLED
Setting that specifies whether display color inversion is enabled. |
String |
ACCESSIBILITY_ENABLED
If accessibility is enabled. |
String |
ACCESSIBILITY_SPEAK_PASSWORD
This constant was deprecated
in API level 26.
The speaking of passwords is controlled by individual accessibility services.
Apps should ignore this setting and provide complete information to accessibility
at all times, which was the behavior when this value was |
String |
ADB_ENABLED
This constant was deprecated
in API level 17.
Use |
String |
ALLOWED_GEOLOCATION_ORIGINS
Origins for which browsers should allow geolocation by default. |
String |
ALLOW_MOCK_LOCATION
This constant was deprecated in API level 23. This settings is not used anymore. |
String |
ANDROID_ID
On Android 8.0 (API level 26) and higher versions of the platform, a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device. |
String |
BACKGROUND_DATA
This constant was deprecated
in API level 15.
As of |
String |
BLUETOOTH_ON
This constant was deprecated
in API level 17.
Use |
String |
DATA_ROAMING
This constant was deprecated
in API level 17.
Use |
String |
DEFAULT_INPUT_METHOD
Stores |
String |
DEVELOPMENT_SETTINGS_ENABLED
This constant was deprecated
in API level 17.
Use |
String |
DEVICE_PROVISIONED
This constant was deprecated
in API level 17.
Use |
String |
ENABLED_ACCESSIBILITY_SERVICES
List of the enabled accessibility providers. |
String |
ENABLED_INPUT_METHODS
List of input methods that are currently enabled. |
String |
HTTP_PROXY
This constant was deprecated
in API level 17.
Use |
String |
INPUT_METHOD_SELECTOR_VISIBILITY
Setting to record the visibility of input method selector |
String |
INSTALL_NON_MARKET_APPS
This constant was deprecated
in API level 26.
Starting from |
String |
LOCATION_MODE
This constant was deprecated
in API level 28.
The preferred methods for checking location mode and listening for changes
are via |
int |
LOCATION_MODE_BATTERY_SAVING
This constant was deprecated
in API level 28.
See |
int |
LOCATION_MODE_HIGH_ACCURACY
This constant was deprecated
in API level 28.
See |
int |
LOCATION_MODE_OFF
Location mode is off. |
int |
LOCATION_MODE_SENSORS_ONLY
This constant was deprecated
in API level 28.
See |
String |
LOCATION_PROVIDERS_ALLOWED
This constant was deprecated
in API level 19.
This setting no longer exists from Android S onwards as it no longer is
capable of realistically reflecting location settings. Use |
String |
LOCK_PATTERN_ENABLED
This constant was deprecated
in API level 23.
Use |
String |
LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED
This constant was deprecated
in API level 17.
Starting in |
String |
LOCK_PATTERN_VISIBLE
This constant was deprecated
in API level 23.
Accessing this setting from an app that is targeting
|
String |
LOGGING_ID
This constant was deprecated in API level 15. This identifier is poorly initialized and has many collisions. It should not be used. |
String |
NETWORK_PREFERENCE
This constant was deprecated
in API level 17.
Use |
String |
PARENTAL_CONTROL_ENABLED
No longer supported. |
String |
PARENTAL_CONTROL_LAST_UPDATE
No longer supported. |
String |
PARENTAL_CONTROL_REDIRECT_URL
No longer supported. |
String |
RTT_CALLING_MODE
User-selected RTT mode. |
String |
SECURE_FRP_MODE
This constant was deprecated in API level 34. Use Global.SECURE_FRP_MODE |
String |
SELECTED_INPUT_METHOD_SUBTYPE
Setting to record the input method subtype used by default, holding the ID of the desired method. |
String |
SETTINGS_CLASSNAME
Settings classname to launch when Settings is clicked from All Applications. |
String |
SKIP_FIRST_USE_HINTS
If enabled, apps should try to skip any introductory hints on first launch. |
String |
TOUCH_EXPLORATION_ENABLED
If touch exploration is enabled. |
String |
TTS_DEFAULT_COUNTRY
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the default
locale. |
String |
TTS_DEFAULT_LANG
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the default
locale. |
String |
TTS_DEFAULT_PITCH
Default text-to-speech engine pitch. |
String |
TTS_DEFAULT_RATE
Default text-to-speech engine speech rate. |
String |
TTS_DEFAULT_SYNTH
Default text-to-speech engine. |
String |
TTS_DEFAULT_VARIANT
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the
locale that is in use |
String |
TTS_ENABLED_PLUGINS
Space delimited list of plugin packages that are enabled. |
String |
TTS_USE_DEFAULTS
This constant was deprecated in API level 15. The value of this setting is no longer respected by the framework text to speech APIs as of the Ice Cream Sandwich release. |
String |
USB_MASS_STORAGE_ENABLED
This constant was deprecated
in API level 17.
Use |
String |
USE_GOOGLE_MAIL
This constant was deprecated
in API level 17.
Use |
String |
WIFI_MAX_DHCP_RETRY_COUNT
This constant was deprecated
in API level 17.
Use
|
String |
WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
This constant was deprecated
in API level 17.
Use
|
String |
WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
This constant was deprecated
in API level 17.
Use |
String |
WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
This constant was deprecated
in API level 17.
Use |
String |
WIFI_NUM_OPEN_NETWORKS_KEPT
This constant was deprecated
in API level 17.
Use |
String |
WIFI_ON
This constant was deprecated
in API level 17.
Use |
String |
WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_AP_COUNT
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_MAX_AP_CHECKS
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_ON
This constant was deprecated
in API level 17.
Use |
String |
WIFI_WATCHDOG_PING_COUNT
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_PING_DELAY_MS
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_PING_TIMEOUT_MS
This constant was deprecated in API level 15. This setting is not used. |
String |
WIFI_WATCHDOG_WATCH_LIST
This constant was deprecated in API level 15. This setting is not used. |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Uri |
CONTENT_URI
The content:// style URL for this table |
Public constructors | |
---|---|
Secure()
|
Public methods | |
---|---|
static
float
|
getFloat(ContentResolver cr, String name, float def)
Convenience function for retrieving a single secure settings value as a floating point number. |
static
float
|
getFloat(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as a float. |
static
int
|
getInt(ContentResolver cr, String name, int def)
Convenience function for retrieving a single secure settings value as an integer. |
static
int
|
getInt(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as an integer. |
static
long
|
getLong(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value
as a |
static
long
|
getLong(ContentResolver cr, String name, long def)
Convenience function for retrieving a single secure settings value
as a |
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
|
isLocationProviderEnabled(ContentResolver cr, String provider)
This method was deprecated
in API level 19.
use |
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 secure settings value as a long integer. |
static
boolean
|
putString(ContentResolver resolver, String name, String value)
Store a name/value pair into the database. |
static
void
|
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)
This method was deprecated in API level 19. This API is deprecated |
Inherited methods | |
---|---|
Constants
ACCESSIBILITY_DISPLAY_INVERSION_ENABLED
public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED
Setting that specifies whether display color inversion is enabled.
Constant Value: "accessibility_display_inversion_enabled"
ACCESSIBILITY_ENABLED
public static final String ACCESSIBILITY_ENABLED
If accessibility is enabled.
Constant Value: "accessibility_enabled"
ACCESSIBILITY_SPEAK_PASSWORD
public static final String ACCESSIBILITY_SPEAK_PASSWORD
This constant was deprecated
in API level 26.
The speaking of passwords is controlled by individual accessibility services.
Apps should ignore this setting and provide complete information to accessibility
at all times, which was the behavior when this value was true
.
Whether to speak passwords while in accessibility mode.
Constant Value: "speak_password"
ADB_ENABLED
public static final String ADB_ENABLED
This constant was deprecated
in API level 17.
Use Settings.Global.ADB_ENABLED
instead
Constant Value: "adb_enabled"
ALLOWED_GEOLOCATION_ORIGINS
public static final String ALLOWED_GEOLOCATION_ORIGINS
Origins for which browsers should allow geolocation by default. The value is a space-separated list of origins.
Constant Value: "allowed_geolocation_origins"
ALLOW_MOCK_LOCATION
public static final String ALLOW_MOCK_LOCATION
This constant was deprecated
in API level 23.
This settings is not used anymore.
Setting to allow mock locations and location provider status to be injected into the LocationManager service for testing purposes during application development. These locations and status values override actual location and status information generated by network, gps, or other location providers.
Constant Value: "mock_location"
ANDROID_ID
public static final String ANDROID_ID
On Android 8.0 (API level 26) and higher versions of the platform,
a 64-bit number (expressed as a hexadecimal string), unique to
each combination of app-signing key, user, and device.
Values of ANDROID_ID
are scoped by signing key and user.
The value may change if a factory reset is performed on the
device or if an APK signing key changes.
For more information about how the platform handles ANDROID_ID
in Android 8.0 (API level 26) and higher, see
Android 8.0 Behavior Changes.
Note: For apps that were installed
prior to updating the device to a version of Android 8.0
(API level 26) or higher, the value of ANDROID_ID
changes
if the app is uninstalled and then reinstalled after the OTA.
To preserve values across uninstalls after an OTA to Android 8.0
or higher, developers can use
Key/Value Backup.
In versions of the platform lower than Android 8.0 (API level 26),
a 64-bit number (expressed as a hexadecimal string) that is randomly
generated when the user first sets up the device and should remain
constant for the lifetime of the user's device.
On devices that have
multiple users, each user appears as a
completely separate device, so the ANDROID_ID
value is
unique to each user.
Note: If the caller is an Instant App the ID is scoped to the Instant App, it is generated when the Instant App is first installed and reset if the user clears the Instant App.
Constant Value: "android_id"
BACKGROUND_DATA
public static final String BACKGROUND_DATA
This constant was deprecated
in API level 15.
As of VERSION_CODES#ICE_CREAM_SANDWICH
,
availability of background data depends on several
combined factors. When background data is unavailable,
ConnectivityManager#getActiveNetworkInfo()
will
now appear disconnected.
Whether background data usage is allowed.
Constant Value: "background_data"
BLUETOOTH_ON
public static final String BLUETOOTH_ON
This constant was deprecated
in API level 17.
Use Settings.Global.BLUETOOTH_ON
instead
Constant Value: "bluetooth_on"
DATA_ROAMING
public static final String DATA_ROAMING
This constant was deprecated
in API level 17.
Use Settings.Global.DATA_ROAMING
instead
Constant Value: "data_roaming"
DEFAULT_INPUT_METHOD
public static final String DEFAULT_INPUT_METHOD
Stores InputMethodInfo.getId()
of the input method
service that is currently selected.
Although the name DEFAULT_INPUT_METHOD
implies that there is a concept of
default input method, in reality this setting is no more or less than the
currently selected input method. This setting can be updated at any
time as a result of user-initiated and system-initiated input method switching.
Use ComponentName#unflattenFromString(String)
to parse the stored value.
Constant Value: "default_input_method"
DEVELOPMENT_SETTINGS_ENABLED
public static final String DEVELOPMENT_SETTINGS_ENABLED
This constant was deprecated
in API level 17.
Use Settings.Global.DEVELOPMENT_SETTINGS_ENABLED
instead
Constant Value: "development_settings_enabled"
DEVICE_PROVISIONED
public static final String DEVICE_PROVISIONED
This constant was deprecated
in API level 17.
Use Settings.Global.DEVICE_PROVISIONED
instead
Constant Value: "device_provisioned"
ENABLED_ACCESSIBILITY_SERVICES
public static final String ENABLED_ACCESSIBILITY_SERVICES
List of the enabled accessibility providers.
Constant Value: "enabled_accessibility_services"
ENABLED_INPUT_METHODS
public static final String ENABLED_INPUT_METHODS
List of input methods that are currently enabled. This is a string containing the IDs of all enabled input methods, each ID separated by ':'. Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" where imeId is ComponentName and subtype is int32.
Note: This setting is not readable to the app targeting API level 34 or higher. use
InputMethodManager.getEnabledInputMethodList()
instead.
Constant Value: "enabled_input_methods"
HTTP_PROXY
public static final String HTTP_PROXY
This constant was deprecated
in API level 17.
Use Global#HTTP_PROXY
Host name and port for global http proxy. Uses ':' seperator for between host and port.
Constant Value: "http_proxy"
INPUT_METHOD_SELECTOR_VISIBILITY
public static final String INPUT_METHOD_SELECTOR_VISIBILITY
Setting to record the visibility of input method selector
Constant Value: "input_method_selector_visibility"
INSTALL_NON_MARKET_APPS
public static final String INSTALL_NON_MARKET_APPS
This constant was deprecated
in API level 26.
Starting from Build.VERSION_CODES.O
, apps should use
PackageManager#canRequestPackageInstalls()
Whether applications can be installed for this user via the system's
Intent#ACTION_INSTALL_PACKAGE
mechanism.
1 = permit app installation via the system package installer intent
0 = do not allow use of the package installer
Constant Value: "install_non_market_apps"
LOCATION_MODE
public static final String LOCATION_MODE
This constant was deprecated
in API level 28.
The preferred methods for checking location mode and listening for changes
are via LocationManager#isLocationEnabled()
and
LocationManager#MODE_CHANGED_ACTION
.
The current location mode of the device. Do not rely on this value being present or on ContentObserver notifications on the corresponding Uri.
Constant Value: "location_mode"
LOCATION_MODE_BATTERY_SAVING
public static final int LOCATION_MODE_BATTERY_SAVING
This constant was deprecated
in API level 28.
See LOCATION_MODE
.
This mode no longer has any distinct meaning, but is interpreted as the location mode is on.
Constant Value: 2 (0x00000002)
LOCATION_MODE_HIGH_ACCURACY
public static final int LOCATION_MODE_HIGH_ACCURACY
This constant was deprecated
in API level 28.
See LOCATION_MODE
.
This mode no longer has any distinct meaning, but is interpreted as the location mode is on.
Constant Value: 3 (0x00000003)
LOCATION_MODE_OFF
public static final int LOCATION_MODE_OFF
Location mode is off.
Constant Value: 0 (0x00000000)
LOCATION_MODE_SENSORS_ONLY
public static final int LOCATION_MODE_SENSORS_ONLY
This constant was deprecated
in API level 28.
See LOCATION_MODE
.
This mode no longer has any distinct meaning, but is interpreted as the location mode is on.
Constant Value: 1 (0x00000001)
LOCATION_PROVIDERS_ALLOWED
public static final String LOCATION_PROVIDERS_ALLOWED
This constant was deprecated
in API level 19.
This setting no longer exists from Android S onwards as it no longer is
capable of realistically reflecting location settings. Use LocationManager.isProviderEnabled(java.lang.String)
or LocationManager#isLocationEnabled()
instead.
Comma-separated list of location providers that are enabled. Do not rely on this value being present or correct, or on ContentObserver notifications on the corresponding Uri.
Constant Value: "location_providers_allowed"
LOCK_PATTERN_ENABLED
public static final String LOCK_PATTERN_ENABLED
This constant was deprecated
in API level 23.
Use KeyguardManager
to determine the state and security
level of the keyguard. Accessing this setting from an app that is targeting
VERSION_CODES#M
or later throws a SecurityException
.
Whether autolock is enabled (0 = false, 1 = true)
Constant Value: "lock_pattern_autolock"
LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED
public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED
This constant was deprecated
in API level 17.
Starting in VERSION_CODES#JELLY_BEAN_MR1
the
lockscreen uses
Settings.System#HAPTIC_FEEDBACK_ENABLED
.
Accessing this setting from an app that is targeting
VERSION_CODES#M
or later throws a SecurityException
.
Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
Constant Value: "lock_pattern_tactile_feedback_enabled"
LOCK_PATTERN_VISIBLE
public static final String LOCK_PATTERN_VISIBLE
This constant was deprecated
in API level 23.
Accessing this setting from an app that is targeting
VERSION_CODES#M
or later throws a SecurityException
.
Whether lock pattern is visible as user enters (0 = false, 1 = true)
Constant Value: "lock_pattern_visible_pattern"
LOGGING_ID
public static final String LOGGING_ID
This constant was deprecated
in API level 15.
This identifier is poorly initialized and has
many collisions. It should not be used.
The Logging ID (a unique 64-bit value) as a hex string. Used as a pseudonymous identifier for logging.
Constant Value: "logging_id"
NETWORK_PREFERENCE
public static final String NETWORK_PREFERENCE
This constant was deprecated
in API level 17.
Use Settings.Global.NETWORK_PREFERENCE
instead
Constant Value: "network_preference"
PARENTAL_CONTROL_ENABLED
public static final String PARENTAL_CONTROL_ENABLED
No longer supported.
Constant Value: "parental_control_enabled"
PARENTAL_CONTROL_LAST_UPDATE
public static final String PARENTAL_CONTROL_LAST_UPDATE
No longer supported.
Constant Value: "parental_control_last_update"
PARENTAL_CONTROL_REDIRECT_URL
public static final String PARENTAL_CONTROL_REDIRECT_URL
No longer supported.
Constant Value: "parental_control_redirect_url"
RTT_CALLING_MODE
public static final String RTT_CALLING_MODE
User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT calls when supported by the device and carrier. Boolean value. 0 = OFF 1 = ON
Constant Value: "rtt_calling_mode"
SECURE_FRP_MODE
public static final String SECURE_FRP_MODE
This constant was deprecated
in API level 34.
Use Global.SECURE_FRP_MODE
Indicates whether the device is under restricted secure FRP mode. Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge, device is removed from this mode.
Type: int (0 for false, 1 for true)
Constant Value: "secure_frp_mode"
SELECTED_INPUT_METHOD_SUBTYPE
public static final String SELECTED_INPUT_METHOD_SUBTYPE
Setting to record the input method subtype used by default, holding the ID of the desired method.
Constant Value: "selected_input_method_subtype"
SETTINGS_CLASSNAME
public static final String SETTINGS_CLASSNAME
Settings classname to launch when Settings is clicked from All Applications. Needed because of user testing between the old and new Settings apps.
Constant Value: "settings_classname"
SKIP_FIRST_USE_HINTS
public static final String SKIP_FIRST_USE_HINTS
If enabled, apps should try to skip any introductory hints on first launch. This might apply to users that are already familiar with the environment or temporary users.
Type : int (0 to show hints, 1 to skip showing hints)
Constant Value: "skip_first_use_hints"
TOUCH_EXPLORATION_ENABLED
public static final String TOUCH_EXPLORATION_ENABLED
If touch exploration is enabled.
Constant Value: "touch_exploration_enabled"
TTS_DEFAULT_COUNTRY
public static final String TTS_DEFAULT_COUNTRY
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the default
locale. TextToSpeech#getLanguage()
.
Default text-to-speech country.
Constant Value: "tts_default_country"
TTS_DEFAULT_LANG
public static final String TTS_DEFAULT_LANG
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the default
locale. TextToSpeech#getLanguage()
.
Default text-to-speech language.
Constant Value: "tts_default_lang"
TTS_DEFAULT_PITCH
public static final String TTS_DEFAULT_PITCH
Default text-to-speech engine pitch. 100 = 1x
Constant Value: "tts_default_pitch"
TTS_DEFAULT_RATE
public static final String TTS_DEFAULT_RATE
Default text-to-speech engine speech rate. 100 = 1x
Constant Value: "tts_default_rate"
TTS_DEFAULT_SYNTH
public static final String TTS_DEFAULT_SYNTH
Default text-to-speech engine.
Constant Value: "tts_default_synth"
TTS_DEFAULT_VARIANT
public static final String TTS_DEFAULT_VARIANT
This constant was deprecated
in API level 15.
this setting is no longer in use, as of the Ice Cream
Sandwich release. Apps should never need to read this setting directly,
instead can query the TextToSpeech framework classes for the
locale that is in use TextToSpeech#getLanguage()
.
Default text-to-speech locale variant.
Constant Value: "tts_default_variant"
TTS_ENABLED_PLUGINS
public static final String TTS_ENABLED_PLUGINS
Space delimited list of plugin packages that are enabled.
Constant Value: "tts_enabled_plugins"
TTS_USE_DEFAULTS
public static final String TTS_USE_DEFAULTS
This constant was deprecated
in API level 15.
The value of this setting is no longer respected by
the framework text to speech APIs as of the Ice Cream Sandwich release.
Setting to always use the default text-to-speech settings regardless of the application settings. 1 = override application settings, 0 = use application settings (if specified).
Constant Value: "tts_use_defaults"
USB_MASS_STORAGE_ENABLED
public static final String USB_MASS_STORAGE_ENABLED
This constant was deprecated
in API level 17.
Use Settings.Global.USB_MASS_STORAGE_ENABLED
instead
Constant Value: "usb_mass_storage_enabled"
USE_GOOGLE_MAIL
public static final String USE_GOOGLE_MAIL
This constant was deprecated
in API level 17.
Use Settings.Global.USE_GOOGLE_MAIL
instead
Constant Value: "use_google_mail"
WIFI_MAX_DHCP_RETRY_COUNT
public static final String WIFI_MAX_DHCP_RETRY_COUNT
This constant was deprecated
in API level 17.
Use
Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT
instead
Constant Value: "wifi_max_dhcp_retry_count"
WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
This constant was deprecated
in API level 17.
Use
Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
instead
Constant Value: "wifi_mobile_data_transition_wakelock_timeout_ms"
WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
This constant was deprecated
in API level 17.
Use Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
instead.
Constant Value: "wifi_networks_available_notification_on"
WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
This constant was deprecated
in API level 17.
Use Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
instead.
Constant Value: "wifi_networks_available_repeat_delay"
WIFI_NUM_OPEN_NETWORKS_KEPT
public static final String WIFI_NUM_OPEN_NETWORKS_KEPT
This constant was deprecated
in API level 17.
Use Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT
instead.
Constant Value: "wifi_num_open_networks_kept"
WIFI_ON
public static final String WIFI_ON
This constant was deprecated
in API level 17.
Use Settings.Global.WIFI_ON
instead.
Constant Value: "wifi_on"
WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE
public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE
This constant was deprecated
in API level 15.
This setting is not used.
The acceptable packet loss percentage (range 0 - 100) before trying another AP on the same network.
Constant Value: "wifi_watchdog_acceptable_packet_loss_percentage"
WIFI_WATCHDOG_AP_COUNT
public static final String WIFI_WATCHDOG_AP_COUNT
This constant was deprecated
in API level 15.
This setting is not used.
The number of access points required for a network in order for the watchdog to monitor it.
Constant Value: "wifi_watchdog_ap_count"
WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS
public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS
This constant was deprecated
in API level 15.
This setting is not used.
The delay between background checks.
Constant Value: "wifi_watchdog_background_check_delay_ms"
WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED
public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED
This constant was deprecated
in API level 15.
This setting is not used.
Whether the Wi-Fi watchdog is enabled for background checking even after it thinks the user has connected to a good access point.
Constant Value: "wifi_watchdog_background_check_enabled"
WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS
public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS
This constant was deprecated
in API level 15.
This setting is not used.
The timeout for a background ping
Constant Value: "wifi_watchdog_background_check_timeout_ms"
WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT
public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT
This constant was deprecated
in API level 15.
This setting is not used.
The number of initial pings to perform that *may* be ignored if they fail. Again, if these fail, they will *not* be used in packet loss calculation. For example, one network always seemed to time out for the first couple pings, so this is set to 3 by default.
Constant Value: "wifi_watchdog_initial_ignored_ping_count"
WIFI_WATCHDOG_MAX_AP_CHECKS
public static final String WIFI_WATCHDOG_MAX_AP_CHECKS
This constant was deprecated
in API level 15.
This setting is not used.
The maximum number of access points (per network) to attempt to test. If this number is reached, the watchdog will no longer monitor the initial connection state for the network. This is a safeguard for networks containing multiple APs whose DNS does not respond to pings.
Constant Value: "wifi_watchdog_max_ap_checks"
WIFI_WATCHDOG_ON
public static final String WIFI_WATCHDOG_ON
This constant was deprecated
in API level 17.
Use Settings.Global.WIFI_WATCHDOG_ON
instead
Constant Value: "wifi_watchdog_on"
WIFI_WATCHDOG_PING_COUNT
public static final String WIFI_WATCHDOG_PING_COUNT
This constant was deprecated
in API level 15.
This setting is not used.
The number of pings to test if an access point is a good connection.
Constant Value: "wifi_watchdog_ping_count"
WIFI_WATCHDOG_PING_DELAY_MS
public static final String WIFI_WATCHDOG_PING_DELAY_MS
This constant was deprecated
in API level 15.
This setting is not used.
The delay between pings.
Constant Value: "wifi_watchdog_ping_delay_ms"
WIFI_WATCHDOG_PING_TIMEOUT_MS
public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS
This constant was deprecated
in API level 15.
This setting is not used.
The timeout per ping.
Constant Value: "wifi_watchdog_ping_timeout_ms"
WIFI_WATCHDOG_WATCH_LIST
public static final String WIFI_WATCHDOG_WATCH_LIST
This constant was deprecated
in API level 15.
This setting is not used.
A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Constant Value: "wifi_watchdog_watch_list"
Fields
CONTENT_URI
public static final Uri CONTENT_URI
The content:// style URL for this table
Public constructors
Secure
public Secure ()
Public methods
getFloat
public static float getFloat (ContentResolver cr, String name, float def)
Convenience function for retrieving a single secure 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. |
getFloat
public static float getFloat (ContentResolver cr, String name)
Convenience function for retrieving a single secure 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 SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
float |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not a float. |
getInt
public static int getInt (ContentResolver cr, String name, int def)
Convenience function for retrieving a single secure 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
public static int getInt (ContentResolver cr, String name)
Convenience function for retrieving a single secure 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 SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
int |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not an integer. |
getLong
public static long getLong (ContentResolver cr, String name)
Convenience function for retrieving a single secure 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 SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
long |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not an integer. |
getLong
public static long getLong (ContentResolver cr, String name, long def)
Convenience function for retrieving a single secure 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 . |
getString
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 |
getUriFor
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, or null if not present |
isLocationProviderEnabled
public static boolean isLocationProviderEnabled (ContentResolver cr, String provider)
This method was deprecated
in API level 19.
use LocationManager#isProviderEnabled(String)
Helper method for determining if a location provider is enabled.
Parameters | |
---|---|
cr |
ContentResolver : the content resolver to use |
provider |
String : the location provider to query |
Returns | |
---|---|
boolean |
true if the provider is enabled |
putFloat
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 |
putInt
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 |
putLong
public static boolean putLong (ContentResolver cr, String name, long value)
Convenience function for updating a secure 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 |
putString
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 |
setLocationProviderEnabled
public static void setLocationProviderEnabled (ContentResolver cr, String provider, boolean enabled)
This method was deprecated
in API level 19.
This API is deprecated
Thread-safe method for enabling or disabling a single location provider. This will have no effect on Android Q and above.
Parameters | |
---|---|
cr |
ContentResolver : the content resolver to use |
provider |
String : the location provider to enable or disable |
enabled |
boolean : true if the provider should be enabled |