Added in API level 3

Secure


class Secure : Settings.NameValueTable
kotlin.Any
   ↳ 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
static String

Setting that specifies whether display color inversion is enabled.

static String

If accessibility is enabled.

static String

Whether to speak passwords while in accessibility mode.

static String

static String

Origins for which browsers should allow geolocation by default.

static String

Setting to allow mock locations and location provider status to be injected into the LocationManager service for testing purposes during application development.

static String

On Android 8.

static String

Whether background data usage is allowed.

static String

static String

static String

Stores android.view.inputmethod.InputMethodInfo#getId() of the input method service that is currently selected.

static String

static String

static String

List of the enabled accessibility providers.

static String

List of input methods that are currently enabled.

static String

Host name and port for global http proxy.

static String

Setting to record the visibility of input method selector

static String

Whether applications can be installed for this user via the system's Intent.ACTION_INSTALL_PACKAGE mechanism.

static String

The current location mode of the device.

static Int

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

static Int

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

static Int

Location mode is off.

static Int

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

static String

Comma-separated list of location providers that are enabled.

static String

Whether autolock is enabled (0 = false, 1 = true)

static String

Whether lock pattern will vibrate as user enters (0 = false, 1 = true)

static String

Whether lock pattern is visible as user enters (0 = false, 1 = true)

static String

The Logging ID (a unique 64-bit value) as a hex string.

static String

static String

No longer supported.

static String

No longer supported.

static String

No longer supported.

static String

User-selected RTT mode.

static String

Indicates whether the device is under restricted secure FRP mode.

static String

Setting to record the input method subtype used by default, holding the ID of the desired method.

static String

Settings classname to launch when Settings is clicked from All Applications.

static String

If enabled, apps should try to skip any introductory hints on first launch.

static String

If touch exploration is enabled.

static String

Default text-to-speech country.

static String

Default text-to-speech language.

static String

Default text-to-speech engine pitch.

static String

Default text-to-speech engine speech rate.

static String

Default text-to-speech engine.

static String

Default text-to-speech locale variant.

static String

Space delimited list of plugin packages that are enabled.

static String

Setting to always use the default text-to-speech settings regardless of the application settings.

static String

static String

static String

static String

static String

static String

static String

static String

static String

The acceptable packet loss percentage (range 0 - 100) before trying another AP on the same network.

static String

The number of access points required for a network in order for the watchdog to monitor it.

static String

The delay between background checks.

static String

Whether the Wi-Fi watchdog is enabled for background checking even after it thinks the user has connected to a good access point.

static String

The timeout for a background ping

static String

The number of initial pings to perform that *may* be ignored if they fail.

static String

The maximum number of access points (per network) to attempt to test.

static String

static String

The number of pings to test if an access point is a good connection.

static String

The delay between pings.

static String

The timeout per ping.

static String

A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.

Inherited constants
Public constructors

Public methods
static Float

Convenience function for retrieving a single secure settings value as a float.

static Float
getFloat(cr: ContentResolver!, name: String!, def: Float)

Convenience function for retrieving a single secure settings value as a floating point number.

static Int
getInt(cr: ContentResolver!, name: String!)

Convenience function for retrieving a single secure settings value as an integer.

static Int
getInt(cr: ContentResolver!, name: String!, def: Int)

Convenience function for retrieving a single secure settings value as an integer.

static Long

Convenience function for retrieving a single secure settings value as a long.

static Long
getLong(cr: ContentResolver!, name: String!, def: Long)

Convenience function for retrieving a single secure settings value as a long.

static String!
getString(resolver: ContentResolver!, name: String!)

Look up a name in the database.

static Uri!
getUriFor(name: String!)

Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver.

static Boolean

Helper method for determining if a location provider is enabled.

static Boolean
putFloat(cr: ContentResolver!, name: String!, value: Float)

Convenience function for updating a single settings value as a floating point number.

static Boolean
putInt(cr: ContentResolver!, name: String!, value: Int)

Convenience function for updating a single settings value as an integer.

static Boolean
putLong(cr: ContentResolver!, name: String!, value: Long)

Convenience function for updating a secure settings value as a long integer.

static Boolean
putString(resolver: ContentResolver!, name: String!, value: String!)

Store a name/value pair into the database.

static Unit

Thread-safe method for enabling or disabling a single location provider.

Inherited functions
Properties
static Uri!

The content:// style URL for this table

Constants

ACCESSIBILITY_DISPLAY_INVERSION_ENABLED

Added in API level 21
static val ACCESSIBILITY_DISPLAY_INVERSION_ENABLED: String

Setting that specifies whether display color inversion is enabled.

Value: "accessibility_display_inversion_enabled"

ACCESSIBILITY_ENABLED

Added in API level 4
static val ACCESSIBILITY_ENABLED: String

If accessibility is enabled.

Value: "accessibility_enabled"

ACCESSIBILITY_SPEAK_PASSWORD

Added in API level 15
Deprecated in API level 26
static val ACCESSIBILITY_SPEAK_PASSWORD: String

Deprecated: 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.

Value: "speak_password"

ADB_ENABLED

Added in API level 3
Deprecated in API level 17
static val ADB_ENABLED: String

Deprecated: Use android.provider.Settings.Global#ADB_ENABLED instead

Value: "adb_enabled"

ALLOWED_GEOLOCATION_ORIGINS

Added in API level 8
static val ALLOWED_GEOLOCATION_ORIGINS: String

Origins for which browsers should allow geolocation by default. The value is a space-separated list of origins.

Value: "allowed_geolocation_origins"

ALLOW_MOCK_LOCATION

Added in API level 3
Deprecated in API level 23
static val ALLOW_MOCK_LOCATION: String

Deprecated: 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.

Value: "mock_location"

ANDROID_ID

Added in API level 3
static val ANDROID_ID: String

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.

Value: "android_id"

BACKGROUND_DATA

Added in API level 3
Deprecated in API level 15
static val BACKGROUND_DATA: String

Deprecated: 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.

Value: "background_data"

BLUETOOTH_ON

Added in API level 3
Deprecated in API level 17
static val BLUETOOTH_ON: String

Deprecated: Use android.provider.Settings.Global#BLUETOOTH_ON instead

Value: "bluetooth_on"

DATA_ROAMING

Added in API level 3
Deprecated in API level 17
static val DATA_ROAMING: String

Deprecated: Use android.provider.Settings.Global#DATA_ROAMING instead

Value: "data_roaming"

DEFAULT_INPUT_METHOD

Added in API level 3
static val DEFAULT_INPUT_METHOD: String

Stores android.view.inputmethod.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.

Value: "default_input_method"

DEVELOPMENT_SETTINGS_ENABLED

Added in API level 16
Deprecated in API level 17
static val DEVELOPMENT_SETTINGS_ENABLED: String

Deprecated: Use android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED instead

Value: "development_settings_enabled"

DEVICE_PROVISIONED

Added in API level 3
Deprecated in API level 17
static val DEVICE_PROVISIONED: String

Deprecated: Use android.provider.Settings.Global#DEVICE_PROVISIONED instead

Value: "device_provisioned"

ENABLED_ACCESSIBILITY_SERVICES

Added in API level 4
static val ENABLED_ACCESSIBILITY_SERVICES: String

List of the enabled accessibility providers.

Value: "enabled_accessibility_services"

ENABLED_INPUT_METHODS

Added in API level 3
static val ENABLED_INPUT_METHODS: String

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 android.view.inputmethod.InputMethodManager#getEnabledInputMethodList() instead.

Value: "enabled_input_methods"

HTTP_PROXY

Added in API level 3
Deprecated in API level 17
static val HTTP_PROXY: String

Deprecated: Use Global.HTTP_PROXY

Host name and port for global http proxy. Uses ':' seperator for between host and port.

Value: "http_proxy"

INPUT_METHOD_SELECTOR_VISIBILITY

Added in API level 11
static val INPUT_METHOD_SELECTOR_VISIBILITY: String

Setting to record the visibility of input method selector

Value: "input_method_selector_visibility"

INSTALL_NON_MARKET_APPS

Added in API level 3
Deprecated in API level 26
static val INSTALL_NON_MARKET_APPS: String

Deprecated: Starting from android.os.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

Value: "install_non_market_apps"

LOCATION_MODE

Added in API level 19
Deprecated in API level 28
static val LOCATION_MODE: String

Deprecated: 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.

Value: "location_mode"

LOCATION_MODE_BATTERY_SAVING

Added in API level 19
Deprecated in API level 28
static val LOCATION_MODE_BATTERY_SAVING: Int

Deprecated: See LOCATION_MODE.

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

Value: 2

LOCATION_MODE_HIGH_ACCURACY

Added in API level 19
Deprecated in API level 28
static val LOCATION_MODE_HIGH_ACCURACY: Int

Deprecated: See LOCATION_MODE.

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

Value: 3

LOCATION_MODE_OFF

Added in API level 19
static val LOCATION_MODE_OFF: Int

Location mode is off.

Value: 0

LOCATION_MODE_SENSORS_ONLY

Added in API level 19
Deprecated in API level 28
static val LOCATION_MODE_SENSORS_ONLY: Int

Deprecated: See LOCATION_MODE.

This mode no longer has any distinct meaning, but is interpreted as the location mode is on.

Value: 1

LOCATION_PROVIDERS_ALLOWED

Added in API level 3
Deprecated in API level 19
static val LOCATION_PROVIDERS_ALLOWED: String

Deprecated: This setting no longer exists from Android S onwards as it no longer is capable of realistically reflecting location settings. Use android.location.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.

Value: "location_providers_allowed"

LOCK_PATTERN_ENABLED

Added in API level 8
Deprecated in API level 23
static val LOCK_PATTERN_ENABLED: String

Deprecated: Use android.app.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)

Value: "lock_pattern_autolock"

LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED

Added in API level 8
Deprecated in API level 17
static val LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED: String

Deprecated: 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)

Value: "lock_pattern_tactile_feedback_enabled"

LOCK_PATTERN_VISIBLE

Added in API level 8
Deprecated in API level 23
static val LOCK_PATTERN_VISIBLE: String

Deprecated: 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)

Value: "lock_pattern_visible_pattern"

LOGGING_ID

Added in API level 3
Deprecated in API level 15
static val LOGGING_ID: String

Deprecated: 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.

Value: "logging_id"

NETWORK_PREFERENCE

Added in API level 3
Deprecated in API level 17
static val NETWORK_PREFERENCE: String

Deprecated: Use android.provider.Settings.Global#NETWORK_PREFERENCE instead

Value: "network_preference"

PARENTAL_CONTROL_ENABLED

Added in API level 3
static val PARENTAL_CONTROL_ENABLED: String

No longer supported.

Value: "parental_control_enabled"

PARENTAL_CONTROL_LAST_UPDATE

Added in API level 3
static val PARENTAL_CONTROL_LAST_UPDATE: String

No longer supported.

Value: "parental_control_last_update"

PARENTAL_CONTROL_REDIRECT_URL

Added in API level 3
static val PARENTAL_CONTROL_REDIRECT_URL: String

No longer supported.

Value: "parental_control_redirect_url"

RTT_CALLING_MODE

Added in API level 28
static val RTT_CALLING_MODE: String

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

Value: "rtt_calling_mode"

SECURE_FRP_MODE

Added in API level 30
Deprecated in API level 34
static val SECURE_FRP_MODE: String

Deprecated: 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)

Value: "secure_frp_mode"

SELECTED_INPUT_METHOD_SUBTYPE

Added in API level 11
static val SELECTED_INPUT_METHOD_SUBTYPE: String

Setting to record the input method subtype used by default, holding the ID of the desired method.

Value: "selected_input_method_subtype"

SETTINGS_CLASSNAME

Added in API level 3
static val SETTINGS_CLASSNAME: String

Settings classname to launch when Settings is clicked from All Applications. Needed because of user testing between the old and new Settings apps.

Value: "settings_classname"

SKIP_FIRST_USE_HINTS

Added in API level 21
static val SKIP_FIRST_USE_HINTS: String

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)

Value: "skip_first_use_hints"

TOUCH_EXPLORATION_ENABLED

Added in API level 14
static val TOUCH_EXPLORATION_ENABLED: String

If touch exploration is enabled.

Value: "touch_exploration_enabled"

TTS_DEFAULT_COUNTRY

Added in API level 4
Deprecated in API level 15
static val TTS_DEFAULT_COUNTRY: String

Deprecated: 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.

Value: "tts_default_country"

TTS_DEFAULT_LANG

Added in API level 4
Deprecated in API level 15
static val TTS_DEFAULT_LANG: String

Deprecated: 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.

Value: "tts_default_lang"

TTS_DEFAULT_PITCH

Added in API level 4
static val TTS_DEFAULT_PITCH: String

Default text-to-speech engine pitch. 100 = 1x

Value: "tts_default_pitch"

TTS_DEFAULT_RATE

Added in API level 4
static val TTS_DEFAULT_RATE: String

Default text-to-speech engine speech rate. 100 = 1x

Value: "tts_default_rate"

TTS_DEFAULT_SYNTH

Added in API level 4
static val TTS_DEFAULT_SYNTH: String

Default text-to-speech engine.

Value: "tts_default_synth"

TTS_DEFAULT_VARIANT

Added in API level 4
Deprecated in API level 15
static val TTS_DEFAULT_VARIANT: String

Deprecated: 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.

Value: "tts_default_variant"

TTS_ENABLED_PLUGINS

Added in API level 8
static val TTS_ENABLED_PLUGINS: String

Space delimited list of plugin packages that are enabled.

Value: "tts_enabled_plugins"

TTS_USE_DEFAULTS

Added in API level 4
Deprecated in API level 15
static val TTS_USE_DEFAULTS: String

Deprecated: 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).

Value: "tts_use_defaults"

USB_MASS_STORAGE_ENABLED

Added in API level 3
Deprecated in API level 17
static val USB_MASS_STORAGE_ENABLED: String

Deprecated: Use android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED instead

Value: "usb_mass_storage_enabled"

USE_GOOGLE_MAIL

Added in API level 3
Deprecated in API level 17
static val USE_GOOGLE_MAIL: String

Deprecated: Use android.provider.Settings.Global#USE_GOOGLE_MAIL instead

Value: "use_google_mail"

WIFI_MAX_DHCP_RETRY_COUNT

Added in API level 3
Deprecated in API level 17
static val WIFI_MAX_DHCP_RETRY_COUNT: String

Deprecated: Use android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT instead

Value: "wifi_max_dhcp_retry_count"

WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS

Added in API level 3
Deprecated in API level 17
static val WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS: String

Deprecated: Use android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS instead

Value: "wifi_mobile_data_transition_wakelock_timeout_ms"

WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON

Added in API level 3
Deprecated in API level 17
static val WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON: String

Deprecated: Use android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON instead.

Value: "wifi_networks_available_notification_on"

WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY

Added in API level 3
Deprecated in API level 17
static val WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY: String

Deprecated: Use android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY instead.

Value: "wifi_networks_available_repeat_delay"

WIFI_NUM_OPEN_NETWORKS_KEPT

Added in API level 3
Deprecated in API level 17
static val WIFI_NUM_OPEN_NETWORKS_KEPT: String

Deprecated: Use android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT instead.

Value: "wifi_num_open_networks_kept"

WIFI_ON

Added in API level 3
Deprecated in API level 17
static val WIFI_ON: String

Deprecated: Use android.provider.Settings.Global#WIFI_ON instead.

Value: "wifi_on"

WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE: String

Deprecated: This setting is not used.

The acceptable packet loss percentage (range 0 - 100) before trying another AP on the same network.

Value: "wifi_watchdog_acceptable_packet_loss_percentage"

WIFI_WATCHDOG_AP_COUNT

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_AP_COUNT: String

Deprecated: This setting is not used.

The number of access points required for a network in order for the watchdog to monitor it.

Value: "wifi_watchdog_ap_count"

WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS: String

Deprecated: This setting is not used.

The delay between background checks.

Value: "wifi_watchdog_background_check_delay_ms"

WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED: String

Deprecated: 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.

Value: "wifi_watchdog_background_check_enabled"

WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS: String

Deprecated: This setting is not used.

The timeout for a background ping

Value: "wifi_watchdog_background_check_timeout_ms"

WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT: String

Deprecated: 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.

Value: "wifi_watchdog_initial_ignored_ping_count"

WIFI_WATCHDOG_MAX_AP_CHECKS

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_MAX_AP_CHECKS: String

Deprecated: 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.

Value: "wifi_watchdog_max_ap_checks"

WIFI_WATCHDOG_ON

Added in API level 3
Deprecated in API level 17
static val WIFI_WATCHDOG_ON: String

Deprecated: Use android.provider.Settings.Global#WIFI_WATCHDOG_ON instead

Value: "wifi_watchdog_on"

WIFI_WATCHDOG_PING_COUNT

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_PING_COUNT: String

Deprecated: This setting is not used.

The number of pings to test if an access point is a good connection.

Value: "wifi_watchdog_ping_count"

WIFI_WATCHDOG_PING_DELAY_MS

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_PING_DELAY_MS: String

Deprecated: This setting is not used.

The delay between pings.

Value: "wifi_watchdog_ping_delay_ms"

WIFI_WATCHDOG_PING_TIMEOUT_MS

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_PING_TIMEOUT_MS: String

Deprecated: This setting is not used.

The timeout per ping.

Value: "wifi_watchdog_ping_timeout_ms"

WIFI_WATCHDOG_WATCH_LIST

Added in API level 3
Deprecated in API level 15
static val WIFI_WATCHDOG_WATCH_LIST: String

Deprecated: This setting is not used.

A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.

Value: "wifi_watchdog_watch_list"

Public constructors

Secure

Secure()

Public methods

getFloat

Added in API level 3
static fun getFloat(
    cr: ContentResolver!,
    name: String!
): Float

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.
Return
Float The setting's current value.
Exceptions
android.provider.Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not a float.

getFloat

Added in API level 3
static fun getFloat(
    cr: ContentResolver!,
    name: String!,
    def: Float
): Float

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.
Return
Float The setting's current value, or 'def' if it is not defined or not a valid float.

getInt

Added in API level 3
static fun getInt(
    cr: ContentResolver!,
    name: String!
): Int

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.
Return
Int The setting's current value.
Exceptions
android.provider.Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.

getInt

Added in API level 3
static fun getInt(
    cr: ContentResolver!,
    name: String!,
    def: Int
): Int

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.
Return
Int The setting's current value, or 'def' if it is not defined or not a valid integer.

getLong

Added in API level 3
static fun getLong(
    cr: ContentResolver!,
    name: String!
): Long

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.
Return
Long The setting's current value.
Exceptions
android.provider.Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.

getLong

Added in API level 3
static fun getLong(
    cr: ContentResolver!,
    name: String!,
    def: Long
): Long

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.
Return
Long The setting's current value, or 'def' if it is not defined or not a valid long.

getString

Added in API level 3
static fun getString(
    resolver: ContentResolver!,
    name: String!
): String!

Look up a name in the database.

Parameters
resolver ContentResolver!: to access the database with
name String!: to look up in the table
Return
String! the corresponding value, or null if not present

getUriFor

Added in API level 3
static fun getUriFor(name: String!): Uri!

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
Return
Uri! the corresponding content URI, or null if not present

isLocationProviderEnabled

Added in API level 8
Deprecated in API level 19
static fun isLocationProviderEnabled(
    cr: ContentResolver!,
    provider: String!
): Boolean

Deprecated: 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
Return
Boolean true if the provider is enabled

putFloat

Added in API level 3
static fun putFloat(
    cr: ContentResolver!,
    name: String!,
    value: Float
): Boolean

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.
Return
Boolean true if the value was set, false on database errors

putInt

Added in API level 3
static fun putInt(
    cr: ContentResolver!,
    name: String!,
    value: Int
): Boolean

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.
Return
Boolean true if the value was set, false on database errors

putLong

Added in API level 3
static fun putLong(
    cr: ContentResolver!,
    name: String!,
    value: Long
): Boolean

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.
Return
Boolean true if the value was set, false on database errors

putString

Added in API level 3
static fun putString(
    resolver: ContentResolver!,
    name: String!,
    value: String!
): Boolean

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
Return
Boolean true if the value was set, false on database errors

setLocationProviderEnabled

Added in API level 8
Deprecated in API level 19
static fun setLocationProviderEnabled(
    cr: ContentResolver!,
    provider: String!,
    enabled: Boolean
): Unit

Deprecated: 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

Properties

CONTENT_URI

Added in API level 3
static val CONTENT_URI: Uri!

The content:// style URL for this table