diff options
author | Andrew Lee <anwlee@google.com> | 2015-01-23 18:52:53 -0800 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-01-23 18:54:31 -0800 |
commit | 895849b2484727546133da8b8762e1fdcc3ecd9b (patch) | |
tree | ba8973f2062b02ed519c30c68909b9e4025bfb4a /src | |
parent | 690b2c6971c6c8a8ef447a15b24d8dd1506f2d0b (diff) | |
download | android_packages_apps_PhoneCommon-895849b2484727546133da8b8762e1fdcc3ecd9b.tar.gz android_packages_apps_PhoneCommon-895849b2484727546133da8b8762e1fdcc3ecd9b.tar.bz2 android_packages_apps_PhoneCommon-895849b2484727546133da8b8762e1fdcc3ecd9b.zip |
Return default notification uri if none found.
Before, if none was found, it assumed there was no notification
sound, but that's a bad default behavior.
Bug: 19125984
Change-Id: I7b6c536dc0a457c043f6bc97b882cbc3a10711ca
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/phone/common/util/SettingsUtil.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/phone/common/util/SettingsUtil.java b/src/com/android/phone/common/util/SettingsUtil.java index 859c1a5..d513f2c 100644 --- a/src/com/android/phone/common/util/SettingsUtil.java +++ b/src/com/android/phone/common/util/SettingsUtil.java @@ -36,6 +36,9 @@ import java.lang.CharSequence; import java.lang.String; public class SettingsUtil { + private static final String DEFAULT_NOTIFICATION_URI_STRING = + Settings.System.DEFAULT_NOTIFICATION_URI.toString(); + /** * Obtain the setting for "vibrate when ringing" setting. * @@ -72,12 +75,12 @@ public class SettingsUtil { } else { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); // For voicemail notifications, we use the value saved in Phone's shared preferences. - String uriString = prefs.getString(key, null); + String uriString = prefs.getString(key, DEFAULT_NOTIFICATION_URI_STRING); if (TextUtils.isEmpty(uriString)) { // silent ringtone ringtoneUri = null; } else { - if (uriString.equals(Settings.System.DEFAULT_NOTIFICATION_URI.toString())) { + if (uriString.equals(DEFAULT_NOTIFICATION_URI_STRING)) { // If it turns out that the voicemail notification is set to the system // default notification, we retrieve the actual URI to prevent it from showing // up as "Unknown Ringtone". |