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 |
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 |
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 | |
---|---|
Secure() |
Public methods | |
---|---|
static Float |
getFloat(cr: ContentResolver!, name: String!, def: Float) Convenience function for retrieving a single secure settings value as a floating point number. |
static Float |
getFloat(cr: ContentResolver!, name: String!) Convenience function for retrieving a single secure settings value as a float. |
static Int |
getInt(cr: ContentResolver!, name: String!, def: Int) Convenience function for retrieving a single secure settings value as an integer. |
static Int |
getInt(cr: ContentResolver!, name: String!) Convenience function for retrieving a single secure settings value as an integer. |
static Long |
getLong(cr: ContentResolver!, name: String!, def: Long) Convenience function for retrieving a single secure settings value as a |
static Long |
getLong(cr: ContentResolver!, name: String!) Convenience function for retrieving a single secure settings value as a |
static String! |
getString(resolver: ContentResolver!, name: String!) Look up a name in the database. |
static Uri! |
Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver. |
static Boolean |
isLocationProviderEnabled(cr: ContentResolver!, provider: String!) 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 |
setLocationProviderEnabled(cr: ContentResolver!, provider: String!, enabled: Boolean) 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
static val ACCESSIBILITY_DISPLAY_INVERSION_ENABLED: String
Setting that specifies whether display color inversion is enabled.
Value: "accessibility_display_inversion_enabled"
ACCESSIBILITY_ENABLED
static val ACCESSIBILITY_ENABLED: String
If accessibility is enabled.
Value: "accessibility_enabled"
ACCESSIBILITY_SPEAK_PASSWORD
static valACCESSIBILITY_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
static valADB_ENABLED: String
Deprecated: Use android.provider.Settings.Global#ADB_ENABLED
instead
Value: "adb_enabled"
ALLOWED_GEOLOCATION_ORIGINS
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
static valALLOW_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
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
static valBACKGROUND_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
static valBLUETOOTH_ON: String
Deprecated: Use android.provider.Settings.Global#BLUETOOTH_ON
instead
Value: "bluetooth_on"
DATA_ROAMING
static valDATA_ROAMING: String
Deprecated: Use android.provider.Settings.Global#DATA_ROAMING
instead
Value: "data_roaming"
DEFAULT_INPUT_METHOD
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
static valDEVELOPMENT_SETTINGS_ENABLED: String
Deprecated: Use android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED
instead
Value: "development_settings_enabled"
DEVICE_PROVISIONED
static valDEVICE_PROVISIONED: String
Deprecated: Use android.provider.Settings.Global#DEVICE_PROVISIONED
instead
Value: "device_provisioned"
ENABLED_ACCESSIBILITY_SERVICES
static val ENABLED_ACCESSIBILITY_SERVICES: String
List of the enabled accessibility providers.
Value: "enabled_accessibility_services"
ENABLED_INPUT_METHODS
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
static valHTTP_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
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
static valINSTALL_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
static valLOCATION_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
static valLOCATION_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
static valLOCATION_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
static val LOCATION_MODE_OFF: Int
Location mode is off.
Value: 0
LOCATION_MODE_SENSORS_ONLY
static valLOCATION_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
static valLOCATION_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
static valLOCK_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
static valLOCK_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
static valLOCK_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
static valLOGGING_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
static valNETWORK_PREFERENCE: String
Deprecated: Use android.provider.Settings.Global#NETWORK_PREFERENCE
instead
Value: "network_preference"
PARENTAL_CONTROL_ENABLED
static val PARENTAL_CONTROL_ENABLED: String
No longer supported.
Value: "parental_control_enabled"
PARENTAL_CONTROL_LAST_UPDATE
static val PARENTAL_CONTROL_LAST_UPDATE: String
No longer supported.
Value: "parental_control_last_update"
PARENTAL_CONTROL_REDIRECT_URL
static val PARENTAL_CONTROL_REDIRECT_URL: String
No longer supported.
Value: "parental_control_redirect_url"
RTT_CALLING_MODE
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
static valSECURE_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
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
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
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
static val TOUCH_EXPLORATION_ENABLED: String
If touch exploration is enabled.
Value: "touch_exploration_enabled"
TTS_DEFAULT_COUNTRY
static valTTS_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
static valTTS_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
static val TTS_DEFAULT_PITCH: String
Default text-to-speech engine pitch. 100 = 1x
Value: "tts_default_pitch"
TTS_DEFAULT_RATE
static val TTS_DEFAULT_RATE: String
Default text-to-speech engine speech rate. 100 = 1x
Value: "tts_default_rate"
TTS_DEFAULT_SYNTH
static val TTS_DEFAULT_SYNTH: String
Default text-to-speech engine.
Value: "tts_default_synth"
TTS_DEFAULT_VARIANT
static valTTS_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
static val TTS_ENABLED_PLUGINS: String
Space delimited list of plugin packages that are enabled.
Value: "tts_enabled_plugins"
TTS_USE_DEFAULTS
static valTTS_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
static valUSB_MASS_STORAGE_ENABLED: String
Deprecated: Use android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED
instead
Value: "usb_mass_storage_enabled"
USE_GOOGLE_MAIL
static valUSE_GOOGLE_MAIL: String
Deprecated: Use android.provider.Settings.Global#USE_GOOGLE_MAIL
instead
Value: "use_google_mail"
WIFI_MAX_DHCP_RETRY_COUNT
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_ON: String
Deprecated: Use android.provider.Settings.Global#WIFI_ON
instead.
Value: "wifi_on"
WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_WATCHDOG_ON: String
Deprecated: Use android.provider.Settings.Global#WIFI_WATCHDOG_ON
instead
Value: "wifi_watchdog_on"
WIFI_WATCHDOG_PING_COUNT
static valWIFI_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
static valWIFI_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
static valWIFI_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
static valWIFI_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
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. |
getFloat
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. |
getInt
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. |
getInt
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. |
getLong
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 . |
getLong
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. |
getString
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
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
static funisLocationProviderEnabled(
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
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
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
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
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
static funsetLocationProviderEnabled(
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
static val CONTENT_URI: Uri!
The content:// style URL for this table