diff options
| author | 2009-06-12 10:03:18 -0700 | |
|---|---|---|
| committer | 2009-06-12 10:03:18 -0700 | |
| commit | 451a37ed2d4dca5aed13c4b10bf25590cd41a462 (patch) | |
| tree | 71889b18e1d9c10bea3daa8e3d21fbdbfcc4055f | |
| parent | 69b0db06543d4dfc49abcde3370fcb9e26b222ec (diff) | |
| parent | 8c737f7353b1cf933b082d17d651cf1b8873b675 (diff) | |
Merge change 3618
* changes:
Fix bug 1875344 cut 2: adding option to show/noshow away presence when device is idle.
| -rw-r--r-- | core/java/android/provider/Im.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/provider/Im.java b/core/java/android/provider/Im.java index c36f5080d2a8..ef4ff515874e 100644 --- a/core/java/android/provider/Im.java +++ b/core/java/android/provider/Im.java @@ -1611,6 +1611,9 @@ public class Im { /** specifies whether or not to show mobile indicator to friends */ public static final String SETTING_SHOW_MOBILE_INDICATOR = "mobile_indicator"; + /** specifies whether or not to show as away when device is idle */ + public static final String SETTING_SHOW_AWAY_ON_IDLE = "show_away_on_idle"; + /** * Used for reliable message queue (RMQ). This is for storing the last rmq id received * from the GTalk server @@ -1819,6 +1822,17 @@ public class Im { showMobileIndicator); } + /** + * A convenience method to set whether or not to show as away when device is idle. + * + * @param contentResolver The ContentResolver to use to access the setting table. + * @param showAway Whether or not to show as away when device is idle. + */ + public static void setShowAwayOnIdle(ContentResolver contentResolver, + long providerId, boolean showAway) { + putBooleanValue(contentResolver, providerId, SETTING_SHOW_AWAY_ON_IDLE, showAway); + } + public static class QueryMap extends ContentQueryMap { private ContentResolver mContentResolver; private long mProviderId; @@ -1949,6 +1963,25 @@ public class Im { } /** + * Set whether or not to show as away when device is idle. + * + * @param showAway whether or not to show as away when device is idle. + */ + public void setShowAwayOnIdle(boolean showAway) { + ProviderSettings.setShowAwayOnIdle(mContentResolver, mProviderId, showAway); + } + + /** + * Get whether or not to show as away when device is idle. + * + * @return Whether or not to show as away when device is idle. + */ + public boolean getShowAwayOnIdle() { + return getBoolean(SETTING_SHOW_AWAY_ON_IDLE, + true /* by default show as away on idle*/); + } + + /** * Convenience function for retrieving a single settings value * as a boolean. * |