Build 1.0_r1(from source)

android.provider
Class Im.ProviderSettings

java.lang.Object
  extended by android.provider.Im.ProviderSettings
All Implemented Interfaces:
Im.ProviderSettingsColumns
Enclosing class:
Im

public static class Im.ProviderSettings
extends Object
implements Im.ProviderSettingsColumns


Nested Class Summary
static class Im.ProviderSettings.QueryMap
           
 
Field Summary
static String CONTENT_TYPE
          The MIME type of CONTENT_URI providing provider settings
static Uri CONTENT_URI
          The content:// style URI for this table
static String LAST_RMQ_RECEIVED
          Used for reliable message queue (RMQ).
static String SETTING_AUTOMATICALLY_CONNECT_GTALK
          controls whether or not the GTalk service automatically connect to server.
static String SETTING_AUTOMATICALLY_START_SERVICE
          controls whether or not the IM service will be automatically started after boot
static String SETTING_ENABLE_NOTIFICATION
          controls whether or not enable the IM notification
static String SETTING_HIDE_OFFLINE_CONTACTS
          controls whether or not the offline contacts will be hided
static String SETTING_RINGTONE
          specifies the Uri string of the ringtone
static String SETTING_RINGTONE_DEFAULT
          specifies the Uri of the default ringtone
static String SETTING_SHOW_MOBILE_INDICATOR
          specifies whether or not to show mobile indicator to friends
static String SETTING_VIBRATE
          specifies whether or not to vibrate
static String SHOW_OFFLINE_CONTACTS
          A boolean value to indicate whether this provider should show the offline contacts
 
Fields inherited from interface android.provider.Im.ProviderSettingsColumns
NAME, PROVIDER, VALUE
 
Method Summary
static boolean getBooleanValue(ContentResolver cr, long providerId, String settingName)
          Get the boolean value of setting which is specified by provider id and the setting name.
static String getStringValue(ContentResolver cr, long providerId, String settingName)
          Get the string value of setting which is specified by provider id and the setting name.
static void putBooleanValue(ContentResolver cr, long providerId, String name, boolean value)
          Save a boolean value of setting in the table providerSetting.
static void putLongValue(ContentResolver cr, long providerId, String name, long value)
          Save a long value of setting in the table providerSetting.
static void putStringValue(ContentResolver cr, long providerId, String name, String value)
          Save a string value of setting in the table providerSetting.
static HashMap<String,String> queryProviderSettings(ContentResolver cr, long providerId)
          Query the settings of the provider specified by id
static void setAutomaticallyConnectGTalk(ContentResolver contentResolver, long providerId, boolean autoConnect)
          A convenience method to set whether or not the GTalk service should be started automatically.
static void setEnableNotification(ContentResolver contentResolver, long providerId, boolean enable)
          A convenience method to set whether or not enable the IM notification.
static void setHideOfflineContacts(ContentResolver contentResolver, long providerId, boolean hideOfflineContacts)
          A convenience method to set whether or not the offline contacts should be hided
static void setRingtoneURI(ContentResolver contentResolver, long providerId, String ringtoneUri)
          A convenience method to set the Uri String of the ringtone.
static void setShowMobileIndicator(ContentResolver contentResolver, long providerId, boolean showMobileIndicator)
          A convenience method to set whether or not to show mobile indicator.
static void setVibrate(ContentResolver contentResolver, long providerId, boolean vibrate)
          A convenience method to set whether or not to vibrate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_URI

public static final Uri CONTENT_URI
The content:// style URI for this table


CONTENT_TYPE

public static final String CONTENT_TYPE
The MIME type of CONTENT_URI providing provider settings

See Also:
Constant Field Values

SHOW_OFFLINE_CONTACTS

public static final String SHOW_OFFLINE_CONTACTS
A boolean value to indicate whether this provider should show the offline contacts

See Also:
Constant Field Values

SETTING_AUTOMATICALLY_CONNECT_GTALK

public static final String SETTING_AUTOMATICALLY_CONNECT_GTALK
controls whether or not the GTalk service automatically connect to server.

See Also:
Constant Field Values

SETTING_AUTOMATICALLY_START_SERVICE

public static final String SETTING_AUTOMATICALLY_START_SERVICE
controls whether or not the IM service will be automatically started after boot

See Also:
Constant Field Values

SETTING_HIDE_OFFLINE_CONTACTS

public static final String SETTING_HIDE_OFFLINE_CONTACTS
controls whether or not the offline contacts will be hided

See Also:
Constant Field Values

SETTING_ENABLE_NOTIFICATION

public static final String SETTING_ENABLE_NOTIFICATION
controls whether or not enable the IM notification

See Also:
Constant Field Values

SETTING_VIBRATE

public static final String SETTING_VIBRATE
specifies whether or not to vibrate

See Also:
Constant Field Values

SETTING_RINGTONE

public static final String SETTING_RINGTONE
specifies the Uri string of the ringtone

See Also:
Constant Field Values

SETTING_RINGTONE_DEFAULT

public static final String SETTING_RINGTONE_DEFAULT
specifies the Uri of the default ringtone

See Also:
Constant Field Values

SETTING_SHOW_MOBILE_INDICATOR

public static final String SETTING_SHOW_MOBILE_INDICATOR
specifies whether or not to show mobile indicator to friends

See Also:
Constant Field Values

LAST_RMQ_RECEIVED

public static final String LAST_RMQ_RECEIVED
Used for reliable message queue (RMQ). This is for storing the last rmq id received from the GTalk server

See Also:
Constant Field Values
Method Detail

queryProviderSettings

public static HashMap<String,String> queryProviderSettings(ContentResolver cr,
                                                           long providerId)
Query the settings of the provider specified by id

Parameters:
cr - the relative content resolver
providerId - the specified id of provider
Returns:
a HashMap which contains all the settings for the specified provider

getStringValue

public static String getStringValue(ContentResolver cr,
                                    long providerId,
                                    String settingName)
Get the string value of setting which is specified by provider id and the setting name.

Parameters:
cr - The ContentResolver to use to access the settings table.
providerId - The id of the provider.
settingName - The name of the setting.
Returns:
The value of the setting if the setting exist, otherwise return null.

getBooleanValue

public static boolean getBooleanValue(ContentResolver cr,
                                      long providerId,
                                      String settingName)
Get the boolean value of setting which is specified by provider id and the setting name.

Parameters:
cr - The ContentResolver to use to access the settings table.
providerId - The id of the provider.
settingName - The name of the setting.
Returns:
The value of the setting if the setting exist, otherwise return false.

putLongValue

public static void putLongValue(ContentResolver cr,
                                long providerId,
                                String name,
                                long value)
Save a long value of setting in the table providerSetting.

Parameters:
cr - The ContentProvider used to access the providerSetting table.
providerId - The id of the provider.
name - The name of the setting.
value - The value of the setting.

putBooleanValue

public static void putBooleanValue(ContentResolver cr,
                                   long providerId,
                                   String name,
                                   boolean value)
Save a boolean value of setting in the table providerSetting.

Parameters:
cr - The ContentProvider used to access the providerSetting table.
providerId - The id of the provider.
name - The name of the setting.
value - The value of the setting.

putStringValue

public static void putStringValue(ContentResolver cr,
                                  long providerId,
                                  String name,
                                  String value)
Save a string value of setting in the table providerSetting.

Parameters:
cr - The ContentProvider used to access the providerSetting table.
providerId - The id of the provider.
name - The name of the setting.
value - The value of the setting.

setAutomaticallyConnectGTalk

public static void setAutomaticallyConnectGTalk(ContentResolver contentResolver,
                                                long providerId,
                                                boolean autoConnect)
A convenience method to set whether or not the GTalk service should be started automatically.

Parameters:
contentResolver - The ContentResolver to use to access the settings table
autoConnect - Whether the GTalk service should be started automatically.

setHideOfflineContacts

public static void setHideOfflineContacts(ContentResolver contentResolver,
                                          long providerId,
                                          boolean hideOfflineContacts)
A convenience method to set whether or not the offline contacts should be hided

Parameters:
contentResolver - The ContentResolver to use to access the setting table
hideOfflineContacts - Whether the offline contacts should be hided

setEnableNotification

public static void setEnableNotification(ContentResolver contentResolver,
                                         long providerId,
                                         boolean enable)
A convenience method to set whether or not enable the IM notification.

Parameters:
contentResolver - The ContentResolver to use to access the setting table.
enable - Whether enable the IM notification

setVibrate

public static void setVibrate(ContentResolver contentResolver,
                              long providerId,
                              boolean vibrate)
A convenience method to set whether or not to vibrate.

Parameters:
contentResolver - The ContentResolver to use to access the setting table.
vibrate - Whether or not to vibrate

setRingtoneURI

public static void setRingtoneURI(ContentResolver contentResolver,
                                  long providerId,
                                  String ringtoneUri)
A convenience method to set the Uri String of the ringtone.

Parameters:
contentResolver - The ContentResolver to use to access the setting table.
ringtoneUri - The Uri String of the ringtone to be set.

setShowMobileIndicator

public static void setShowMobileIndicator(ContentResolver contentResolver,
                                          long providerId,
                                          boolean showMobileIndicator)
A convenience method to set whether or not to show mobile indicator.

Parameters:
contentResolver - The ContentResolver to use to access the setting table.
showMobileIndicator - Whether or not to show mobile indicator.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature