English | Site Directory

Android - An Open Handset Alliance Project

android.provider
public static final class

android.provider.Settings.System

java.lang.Object
android.provider.Settings.System BaseColumns

System settings, containing miscellaneous system preferences. This table holds simple name/value pairs. There are convenience functions for accessing individual settings entries.

Summary

Constants

      Value  
String  ALWAYS_FINISH_ACTIVITIES  If 1, the activity manager will aggressively finish activities and processes as soon as they are no longer needed.  "always_finish_activities" 
String  BLUETOOTH_DISCOVERABILITY  Determines whether remote devices may discover and/or connect to this device.  "bluetooth_discoverability" 
String  BLUETOOTH_DISCOVERABILITY_TIMEOUT  Bluetooth discoverability timeout.  "bluetooth_discoverability_timeout" 
String  BLUETOOTH_DUN_ON    "bluetooth_dun_on" 
String  BLUETOOTH_HFAG_ON    "bluetooth_hfag_on" 
String  BLUETOOTH_HSAG_ON    "bluetooth_hsag_on" 
String  BLUETOOTH_NAME  The user-friendly name of this device.  "bluetooth_name" 
String  BLUETOOTH_ON  Whether bluetooth and the various services are enabled/disabled 0=disabled.  "bluetooth_on" 
String  BLUETOOTH_SHELL_ON    "bluetooth_shell_on" 
Uri  CONTENT_URI  The content:// style URL for this table      
String  DATE_FORMAT  Date format string mm/dd/yyyy dd/mm/yyyy yyyy/mm/dd   "date_format" 
String  DEBUG_APP  Name of an application package to be debugged.  "debug_app" 
String  DIM_SCREEN  Whether or not to dim the screen.  "dim_screen" 
String  FONT_SCALE  Scaling factor for fonts, float.  "font_scale" 
String  HTTP_PROXY  Host name and port for a user-selected proxy.  "http_proxy" 
String  KEYGUARD  Whether we use keyguard.  "keyguard" 
String  KEYGUARD_PASSWORD  The keyguard password, base64 (just so it's not quite cleartext)   "keyguard_password" 
String  MUSIC_VOLUME  Music volume   "music_volume" 
String  NAME  The unique name of the settings value.  "name" 
String  RINGER_ALWAYS_VIBRATE  Always vibrate.  "ringer_always_vibrate" 
String  RINGER_INCREASING_RING  Increasing Ring   "ringer_increasing_ring" 
String  RINGER_VOLUME  Ringer volume   "ringer_volume" 
String  SCREEN_OFF_TIMEOUT  The timeout before the screen turns off.  "screen_off_timeout" 
String  SETTINGS_CLASSNAME  Settings classname to launch when Settings is clicked from All Applications.  "settings_classname" 
String  SETUP_WIZARD_HAS_RUN  Whether the setup wizard has been run before (on first boot), or if it still needs to be run.  "setup_wizard_has_run" 
String  SHOW_GTALK_SERVICE_STATUS    "SHOW_GTALK_SERVICE_STATUS" 
String  SHOW_PROCESSES  Control whether the process CPU usage meter should be shown.  "show_processes" 
String  STAY_ON_WHILE_PLUGGED_IN  Whether we keep the device on while the device is plugged in.  "stay_on_while_plugged_in" 
String  TIME_12_24  Display times as 12 or 24 hours 12 24   "time_12_24" 
String  USB_MASS_STORAGE_ENABLED  USB Mass Storage Enabled   "usb_mass_storage_enabled" 
String  VALUE  The contents of the setting value

Type: TEXT

 
"value" 
String  VOICE_VOLUME  Voice volume   "voice_volume" 
String  WAIT_FOR_DEBUGGER  If 1, when launching DEBUG_APP it will wait for the debugger before starting user code.  "wait_for_debugger" 
String  WALLPAPER_ACTIVITY  Name of activity to use for wallpaper on the home screen.  "wallpaper_activity" 
Constants inherited from interface android.provider.BaseColumns

Public Constructors

          Settings.System()

Public Methods

    final  static  void  getConfiguration(ContentResolver cr, Configuration outConfig)
Convenience function to read all of the current configuration-related settings into a Resources.Configuration object.
    final  static  float  getFloat(ContentResolver cr, String name, float def)
Convenience function for retrieving a single system settings value as a floating point number.
    final  static  int  getInt(ContentResolver cr, String name)
Convenience function for retrieving a single system settings value as an integer.
    final  static  int  getInt(ContentResolver cr, String name, int def)
Convenience function for retrieving a single system settings value as an integer.
      static  boolean  getShowGTalkServiceStatus(ContentResolver cr)
    final  static  String  getString(ContentResolver cr, String name)
Convenience function for retrieving a single system settings value.
      static  Uri  getUriFor(ContentResolver cr, String name)
    final  static  void  putConfiguration(ContentResolver cr, Configuration config)
Convenience function to write a batch of configuration-related settings from a Resources.Configuration object.
    final  static  void  putFloat(ContentResolver cr, String name, float value)
Convenience function for updating a single settings value as a floating point number.
    final  static  void  putInt(ContentResolver cr, String name, int value)
Convenience function for updating a single settings value as an integer.
    final  static  void  putString(ContentResolver cr, String name, String value)
Convenience function for updating a single settings value.
      static  void  setShowGTalkServiceStatus(ContentResolver cr, boolean flag)
Methods inherited from class java.lang.Object

Details

Constants

public static final String ALWAYS_FINISH_ACTIVITIES

If 1, the activity manager will aggressively finish activities and processes as soon as they are no longer needed. If 0, the normal extended lifetime is used.
Constant Value: "always_finish_activities"

public static final String BLUETOOTH_DISCOVERABILITY

Determines whether remote devices may discover and/or connect to this device.

Type: INT

2 -- discoverable and connectable 1 -- connectable but not discoverable 0 -- neither connectable nor discoverable
Constant Value: "bluetooth_discoverability"

public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT

Bluetooth discoverability timeout. If this value is nonzero, then Bluetooth becomes discoverable for a certain number of seconds, after which is becomes simply connectable. The value is in seconds.
Constant Value: "bluetooth_discoverability_timeout"

public static final String BLUETOOTH_DUN_ON

Constant Value: "bluetooth_dun_on"

public static final String BLUETOOTH_HFAG_ON

Constant Value: "bluetooth_hfag_on"

public static final String BLUETOOTH_HSAG_ON

Constant Value: "bluetooth_hsag_on"

public static final String BLUETOOTH_NAME

The user-friendly name of this device.

Type: STRING

Constant Value: "bluetooth_name"

public static final String BLUETOOTH_ON

Whether bluetooth and the various services are enabled/disabled 0=disabled. 1=enabled. The services are: DUN -- Dial-Up Networking; HFAG -- Handsfree Audio Gateway; HSAG -- Headset Audio Gateway; SHELL -- Bluetooth shell over serial-port emulation.
Constant Value: "bluetooth_on"

public static final String BLUETOOTH_SHELL_ON

Constant Value: "bluetooth_shell_on"

public static final Uri CONTENT_URI

The content:// style URL for this table

public static final String DATE_FORMAT

Date format string mm/dd/yyyy dd/mm/yyyy yyyy/mm/dd
Constant Value: "date_format"

public static final String DEBUG_APP

Name of an application package to be debugged.
Constant Value: "debug_app"

public static final String DIM_SCREEN

Whether or not to dim the screen. 0=no 1=yes
Constant Value: "dim_screen"

public static final String FONT_SCALE

Scaling factor for fonts, float.
Constant Value: "font_scale"

public static final String HTTP_PROXY

Host name and port for a user-selected proxy.
Constant Value: "http_proxy"

public static final String KEYGUARD

Whether we use keyguard. 0=no. 1=keyguard
Constant Value: "keyguard"

public static final String KEYGUARD_PASSWORD

The keyguard password, base64 (just so it's not quite cleartext)
Constant Value: "keyguard_password"

public static final String MUSIC_VOLUME

Music volume
Constant Value: "music_volume"

public static final String NAME

The unique name of the settings value.

Type: TEXT

Constant Value: "name"

public static final String RINGER_ALWAYS_VIBRATE

Always vibrate.
Constant Value: "ringer_always_vibrate"

public static final String RINGER_INCREASING_RING

Increasing Ring
Constant Value: "ringer_increasing_ring"

public static final String RINGER_VOLUME

Ringer volume
Constant Value: "ringer_volume"

public static final String SCREEN_OFF_TIMEOUT

The timeout before the screen turns off.
Constant Value: "screen_off_timeout"

public static final String SETTINGS_CLASSNAME

Settings classname to launch when Settings is clicked from All Applications. Needed because of user testing between the old and new Settings apps. TODO: 881807
Constant Value: "settings_classname"

public static final String SETUP_WIZARD_HAS_RUN

Whether the setup wizard has been run before (on first boot), or if it still needs to be run. nonzero = it has been run in the past 0 = it has not been run in the past
Constant Value: "setup_wizard_has_run"

public static final String SHOW_GTALK_SERVICE_STATUS

Constant Value: "SHOW_GTALK_SERVICE_STATUS"

public static final String SHOW_PROCESSES

Control whether the process CPU usage meter should be shown.
Constant Value: "show_processes"

public static final String STAY_ON_WHILE_PLUGGED_IN

Whether we keep the device on while the device is plugged in. 0=no 1=yes
Constant Value: "stay_on_while_plugged_in"

public static final String TIME_12_24

Display times as 12 or 24 hours 12 24
Constant Value: "time_12_24"

public static final String USB_MASS_STORAGE_ENABLED

USB Mass Storage Enabled
Constant Value: "usb_mass_storage_enabled"

public static final String VALUE

The contents of the setting value

Type: TEXT

Constant Value: "value"

public static final String VOICE_VOLUME

Voice volume
Constant Value: "voice_volume"

public static final String WAIT_FOR_DEBUGGER

If 1, when launching DEBUG_APP it will wait for the debugger before starting user code. If 0, it will run normally.
Constant Value: "wait_for_debugger"

public static final String WALLPAPER_ACTIVITY

Name of activity to use for wallpaper on the home screen.
Constant Value: "wallpaper_activity"

Public Constructors

public Settings.System()

Public Methods

public static final void getConfiguration(ContentResolver cr, Configuration outConfig)

Convenience function to read all of the current configuration-related settings into a Resources.Configuration object.

Parameters

cr The ContentResolver to access.
outConfig Where to place the configuration settings.

public static final float getFloat(ContentResolver cr, String name, float def)

Convenience function for retrieving a single system settings value as a floating point number. Note that internally setting values are always stored as strings; this function converts the string to an float for you. An exception will be thrown if the string is not a valid float.

Parameters

cr The ContentResolver to access.
name The name of the setting to retrieve.
def Value to return if the setting is not defined.

Returns

  • The setting's current value, or 'def' if it is not defined.

public static final int getInt(ContentResolver cr, String name)

Convenience function for retrieving a single system settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you. An exception will be thrown if the string is not a valid integer.

This version does not take a default value. If the setting has not been set, it returns the system default value.

Parameters

cr The ContentResolver to access.
name The name of the setting to retrieve.

Returns

  • The setting's current value, or 'def' if it is not defined.

Throws

Settings.SettingNotFoundException Thrown if a setting by the given name can't be found.

public static final int getInt(ContentResolver cr, String name, int def)

Convenience function for retrieving a single system settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you. An exception will be thrown if the string is not a valid integer.

Parameters

cr The ContentResolver to access.
name The name of the setting to retrieve.
def Value to return if the setting is not defined.

Returns

  • The setting's current value, or 'def' if it is not defined.

public static boolean getShowGTalkServiceStatus(ContentResolver cr)

public static final String getString(ContentResolver cr, String name)

Convenience function for retrieving a single system settings value.

Parameters

cr The ContentResolver to access.
name The name of the setting to retrieve.

Returns

  • String The setting's current value, or null if it is not defined.

public static Uri getUriFor(ContentResolver cr, String name)

public static final void putConfiguration(ContentResolver cr, Configuration config)

Convenience function to write a batch of configuration-related settings from a Resources.Configuration object.

Parameters

cr The ContentResolver to access.
config The settings to write.

public static final void putFloat(ContentResolver cr, String name, float value)

Convenience function for updating a single settings value as a floating point number. This will either create a new entry in the table if the given name does not exist, or modify the value of the existing row with that name. Note that internally setting values are always stored as strings, so this function converts the given value to a string before storing it.

Parameters

cr The ContentResolver to access.
name The name of the setting to modify.
value The new value for the setting.

public static final void putInt(ContentResolver cr, String name, int value)

Convenience function for updating a single settings value as an integer. This will either create a new entry in the table if the given name does not exist, or modify the value of the existing row with that name. Note that internally setting values are always stored as strings, so this function converts the given value to a string before storing it.

Parameters

cr The ContentResolver to access.
name The name of the setting to modify.
value The new value for the setting.

public static final void putString(ContentResolver cr, String name, String value)

Convenience function for updating a single settings value. 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.

Parameters

cr The ContentResolver to access.
name The name of the setting to modify.
value The new value for the setting.

public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag)

Build m5-rc15i - 10 Jun 2008 13:54