Class: 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 system UI or specialized APIs for those values, not modified directly by applications.

Inheritance

Superclass tree: Implements:

Methods

  • Settings.Securetop

    public Settings.Secure()
    Google Code Search
    Stack Overflow
  • getBluetoothA2dpSinkPriorityKeytop

    public static final String getBluetoothA2dpSinkPriorityKey(String address)
    Get the key that retrieves a bluetooth a2dp sink's priority.
    Misc:
    @hide
    Google Code Search
    Stack Overflow
  • getBluetoothHeadsetPriorityKeytop

    public static final String getBluetoothHeadsetPriorityKey(String address)
    Get the key that retrieves a bluetooth headset's priority.
    Misc:
    @hide
    Google Code Search
    Stack Overflow
  • getFloattop

    public static float getFloat(ContentResolver cr, String name) throws Settings.SettingNotFoundException
    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 android.provider.Settings$SettingNotFoundException.

    Parameters:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    Return:
    @return The setting's current value.
    Exceptions:
    @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not a float.
    Google Code Search
    Stack Overflow
  • getFloattop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    @param def Value to return if the setting is not defined.
    Return:
    @return The setting's current value, or 'def' if it is not defined or not a valid float.
    Google Code Search
    Stack Overflow
  • getInttop

    public static int getInt(ContentResolver cr, String name) throws Settings.SettingNotFoundException
    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 android.provider.Settings$SettingNotFoundException.

    Parameters:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    Return:
    @return The setting's current value.
    Exceptions:
    @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.
    Google Code Search
    Stack Overflow
  • getInttop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    @param def Value to return if the setting is not defined.
    Return:
    @return The setting's current value, or 'def' if it is not defined or not a valid integer.
    Google Code Search
    Stack Overflow
  • getLongtop

    public static long getLong(ContentResolver cr, String name) throws Settings.SettingNotFoundException
    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 android.provider.Settings$SettingNotFoundException.

    Parameters:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    Return:
    @return The setting's current value.
    Exceptions:
    @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be found or the setting value is not an integer.
    Google Code Search
    Stack Overflow
  • getLongtop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to retrieve.
    @param def Value to return if the setting is not defined.
    Return:
    @return The setting's current value, or 'def' if it is not defined or not a valid long .
    Google Code Search
    Stack Overflow
  • getStringtop

    public static synchronized String getString(ContentResolver resolver, String name)
    Look up a name in the database.
    Parameters:
    @param resolver to access the database with
    @param name to look up in the table
    Return:
    @return the corresponding value, or null if not present
    Google Code Search
    Stack Overflow
  • getUriFortop

    public static Uri getUriFor(String name)
    Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver.
    Parameters:
    @param name to look up in the table
    Return:
    @return the corresponding content URI, or null if not present
    Google Code Search
    Stack Overflow
  • isLocationProviderEnabledtop

    public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider)
    Helper method for determining if a location provider is enabled.
    Parameters:
    @param cr the content resolver to use
    @param provider the location provider to query
    Return:
    @return true if the provider is enabled
    Misc:
    @hide
    Google Code Search
    Stack Overflow
  • putFloattop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to modify.
    @param value The new value for the setting.
    Return:
    @return true if the value was set, false on database errors
    Google Code Search
    Stack Overflow
  • putInttop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to modify.
    @param value The new value for the setting.
    Return:
    @return true if the value was set, false on database errors
    Google Code Search
    Stack Overflow
  • putLongtop

    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:
    @param cr The ContentResolver to access.
    @param name The name of the setting to modify.
    @param value The new value for the setting.
    Return:
    @return true if the value was set, false on database errors
    Google Code Search
    Stack Overflow
  • putStringtop

    public static boolean putString(ContentResolver resolver, String name, String value)
    Store a name/value pair into the database.
    Parameters:
    @param resolver to access the database with
    @param name to store
    @param value to associate with the name
    Return:
    @return true if the value was set, false on database errors
    Google Code Search
    Stack Overflow
  • setLocationProviderEnabledtop

    public static final void setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)
    Thread-safe method for enabling or disabling a single location provider.
    Parameters:
    @param cr the content resolver to use
    @param provider the location provider to enable or disable
    @param enabled true if the provider should be enabled
    Misc:
    @hide
    Google Code Search
    Stack Overflow

Fields

  • ACCESSIBILITY_ENABLED

    public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"
    If accessibility is enabled.
  • ADB_ENABLED

    public static final String ADB_ENABLED = "adb_enabled"
    Whether ADB is enabled.
  • ALLOW_MOCK_LOCATION

    public static final String ALLOW_MOCK_LOCATION = "mock_location"
    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.
  • ANDROID_ID

    public static final String ANDROID_ID = "android_id"
    The Android ID (a unique 64-bit value) as a hex string. Identical to that obtained by calling GoogleLoginService.getAndroidId(); it is also placed here so you can get it without binding to a service.
  • ASSISTED_GPS_ENABLED

    public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"
    Whether assisted GPS should be enabled or not.
  • BACKGROUND_DATA

    public static final String BACKGROUND_DATA = "background_data"
    Whether background data usage is allowed by the user. See ConnectivityManager for more info.
  • BACKUP_ENABLED

    public static final String BACKUP_ENABLED = "backup_enabled"
    Controls whether settings backup is enabled. Type: int ( 0 = disabled, 1 = enabled )
  • BACKUP_PROVISIONED

    public static final String BACKUP_PROVISIONED = "backup_provisioned"
    Indicates whether settings backup has been fully provisioned. Type: int ( 0 = unprovisioned, 1 = fully provisioned )
  • BACKUP_TRANSPORT

    public static final String BACKUP_TRANSPORT = "backup_transport"
    Component of the transport to use for backup/restore.
  • BLUETOOTH_ON

    public static final String BLUETOOTH_ON = "bluetooth_on"
    Whether bluetooth is enabled/disabled 0=disabled. 1=enabled.
  • CDMA_CELL_BROADCAST_SMS

    public static final String CDMA_CELL_BROADCAST_SMS = "cdma_cell_broadcast_sms"
    CDMA Cell Broadcast SMS 0 = CDMA Cell Broadcast SMS disabled 1 = CDMA Cell Broadcast SMS enabled
  • CDMA_ROAMING_MODE

    public static final String CDMA_ROAMING_MODE = "roaming_settings"
    The CDMA roaming mode 0 = Home Networks, CDMA default 1 = Roaming on Affiliated networks 2 = Roaming on any networks
  • CDMA_SUBSCRIPTION_MODE

    public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"
    The CDMA subscription mode 0 = RUIM/SIM (default) 1 = NV
  • CHECKIN_SEND_APANIC_CONSOLE_TIME

    public static final String CHECKIN_SEND_APANIC_CONSOLE_TIME = "checkin_apanic_console_time"
    The time in msec, when the apanic_console file was send to the checkin server. We will only send the apanic_console file if it was modified after this time.
  • CHECKIN_SEND_APANIC_THREAD_TIME

    public static final String CHECKIN_SEND_APANIC_THREAD_TIME = "checkin_apanic_thread_time"
    The time in msec, when the apanic_thread file was send to the checkin server. We will only send the apanic_thread file if it was modified after this time.
  • CHECKIN_SEND_LAST_KMSG_TIME

    public static final String CHECKIN_SEND_LAST_KMSG_TIME = "checkin_kmsg_time"
    The time in msec, when the LAST_KMSG file was send to the checkin server. We will only send the LAST_KMSG file if it was modified after this time.
  • CONTENT_URI

    public static final Uri CONTENT_URI
    The content:// style URL for this table
  • DATA_ROAMING

    public static final String DATA_ROAMING = "data_roaming"
    Whether or not data roaming is enabled. (0 = false, 1 = true)
  • DEFAULT_INPUT_METHOD

    public static final String DEFAULT_INPUT_METHOD = "default_input_method"
    Setting to record the input method used by default, holding the ID of the desired method.
  • DEVICE_PROVISIONED

    public static final String DEVICE_PROVISIONED = "device_provisioned"
    Whether the device has been provisioned (0 = false, 1 = true)
  • ENABLED_ACCESSIBILITY_SERVICES

    public static final String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services"
    List of the enabled accessibility providers.
  • ENABLED_INPUT_METHODS

    public static final String ENABLED_INPUT_METHODS = "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 ':'.
  • ENHANCED_VOICE_PRIVACY_ENABLED

    public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"
    Whether the enhanced voice privacy mode is enabled. 0 = normal voice privacy 1 = enhanced voice privacy
  • HTTP_PROXY

    public static final String HTTP_PROXY = "http_proxy"
    Host name and port for a user-selected proxy.
  • INSTALL_NON_MARKET_APPS

    public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"
    Whether the package installer should allow installation of apps downloaded from sources other than the Android Market (vending machine). 1 = allow installing from other sources 0 = only allow installing from the Android Market
  • LAST_SETUP_SHOWN

    public static final String LAST_SETUP_SHOWN = "last_setup_shown"
    Version for which the setup wizard was last shown. Bumped for each release when there is new setup information to show.
  • LOCATION_PROVIDERS_ALLOWED

    public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"
    Comma-separated list of location providers that activities may access.
  • LOGGING_ID

    public static final String LOGGING_ID = "logging_id"
    The Logging ID (a unique 64-bit value) as a hex string. Used as a pseudonymous identifier for logging.
  • LOGGING_ID2

    public static final String LOGGING_ID2 = "logging_id2"
    The Logging ID (a unique 64-bit value) as a hex string. Used as a pseudonymous identifier for logging.
  • NETWORK_PREFERENCE

    public static final String NETWORK_PREFERENCE = "network_preference"
    User preference for which network(s) should be used. Only the connectivity service should touch this.
  • PARENTAL_CONTROL_ENABLED

    public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"
  • PARENTAL_CONTROL_LAST_UPDATE

    public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"
  • PARENTAL_CONTROL_REDIRECT_URL

    public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"
  • PREFERRED_CDMA_SUBSCRIPTION

    public static final String PREFERRED_CDMA_SUBSCRIPTION = "preferred_cdma_subscription"
    The cdma subscription 0 = Subscription from RUIM, when available 1 = Subscription from NV
  • PREFERRED_NETWORK_MODE

    public static final String PREFERRED_NETWORK_MODE = "preferred_network_mode"
    The preferred network mode 7 = Global 6 = EvDo only 5 = CDMA w/o EvDo 4 = CDMA / EvDo auto 3 = GSM / WCDMA auto 2 = WCDMA only 1 = GSM only 0 = GSM / WCDMA preferred
  • PREFERRED_TTY_MODE

    public static final String PREFERRED_TTY_MODE = "preferred_tty_mode"
    The preferred TTY mode 0 = TTy Off, CDMA default 1 = TTY Full 2 = TTY HCO 3 = TTY VCO
  • SETTINGS_CLASSNAME

    public static final String SETTINGS_CLASSNAME = "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.
  • SETTINGS_TO_BACKUP

    public static final String[] SETTINGS_TO_BACKUP
  • SYS_PROP_SETTING_VERSION

    public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"
  • TTS_DEFAULT_COUNTRY

    public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"
    Default text-to-speech country.
  • TTS_DEFAULT_LANG

    public static final String TTS_DEFAULT_LANG = "tts_default_lang"
    Default text-to-speech language.
  • TTS_DEFAULT_PITCH

    public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"
    Default text-to-speech engine pitch. 100 = 1x
  • TTS_DEFAULT_RATE

    public static final String TTS_DEFAULT_RATE = "tts_default_rate"
    Default text-to-speech engine speech rate. 100 = 1x
  • TTS_DEFAULT_SYNTH

    public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"
    Default text-to-speech engine.
  • TTS_DEFAULT_VARIANT

    public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"
    Default text-to-speech locale variant.
  • TTS_USE_DEFAULTS

    public static final String TTS_USE_DEFAULTS = "tts_use_defaults"
    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).
  • TTY_MODE_ENABLED

    public static final String TTY_MODE_ENABLED = "tty_mode_enabled"
    Whether the TTY mode mode is enabled. 0 = disabled 1 = enabled
  • USB_MASS_STORAGE_ENABLED

    public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"
    USB Mass Storage Enabled
  • USE_GOOGLE_MAIL

    public static final String USE_GOOGLE_MAIL = "use_google_mail"
    If this setting is set (to anything), then all references to Gmail on the device must change to Google Mail.
  • USE_LOCATION_FOR_SERVICES

    public static final String USE_LOCATION_FOR_SERVICES = "use_location"
    Flag for allowing service provider to use location information to improve products and services. Type: int ( 0 = disallow, 1 = allow )
  • WIFI_MAX_DHCP_RETRY_COUNT

    public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"
    The maximum number of times we will retry a connection to an access point for which we have failed in acquiring an IP address from DHCP. A value of N means that we will make N+1 connection attempts in all.
  • WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS

    public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms"
    Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile data connectivity to be established after a disconnect from Wi-Fi.
  • WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON

    public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on"
    Whether to notify the user of open networks.

    If not connected and the scan results have an open network, we will put this notification up. If we attempt to connect to a network or the open network(s) disappear, we remove the notification. When we show the notification, we will not show it again for android.provider.Settings$Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY time.

  • WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY

    public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay"
    Delay (in seconds) before repeating the Wi-Fi networks available notification. Connecting to a network will reset the timer.
  • WIFI_NUM_ALLOWED_CHANNELS

    public static final String WIFI_NUM_ALLOWED_CHANNELS = "wifi_num_allowed_channels"
    The number of radio channels that are allowed in the local 802.11 regulatory domain.
  • WIFI_NUM_OPEN_NETWORKS_KEPT

    public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"
    When the number of open networks exceeds this number, the least-recently-used excess networks will be removed.
  • WIFI_ON

    public static final String WIFI_ON = "wifi_on"
    Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
  • WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE

    public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage"
    The acceptable packet loss percentage (range 0 - 100) before trying another AP on the same network.
  • WIFI_WATCHDOG_AP_COUNT

    public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"
    The number of access points required for a network in order for the watchdog to monitor it.
  • WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS

    public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms"
    The delay between background checks.
  • WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED

    public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = "wifi_watchdog_background_check_enabled"
    Whether the Wi-Fi watchdog is enabled for background checking even after it thinks the user has connected to a good access point.
  • WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS

    public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = "wifi_watchdog_background_check_timeout_ms"
    The timeout for a background ping
  • WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT

    public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = "wifi_watchdog_initial_ignored_ping_count"
    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.
  • WIFI_WATCHDOG_MAX_AP_CHECKS

    public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"
    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.
  • WIFI_WATCHDOG_ON

    public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"
    Whether the Wi-Fi watchdog is enabled.
  • WIFI_WATCHDOG_PING_COUNT

    public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"
    The number of pings to test if an access point is a good connection.
  • WIFI_WATCHDOG_PING_DELAY_MS

    public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"
    The delay between pings.
  • WIFI_WATCHDOG_PING_TIMEOUT_MS

    public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"
    The timeout per ping.
  • WIFI_WATCHDOG_WATCH_LIST

    public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"
    A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
  • mNameValueCache

    static volatile private Settings.NameValueCache mNameValueCache