summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-11-24 15:42:47 -0800
committerAndrew Lee <anwlee@google.com>2014-11-24 16:49:35 -0800
commitc11bd1b0ac01d0bd3497d1e47e70e53792036e5a (patch)
treed3ad247afb0d9a245d2a1761fd2c5eb0bdfa3425 /src
parent0830cf646293665e2e28ae1159b7c1ac2a286396 (diff)
downloadandroid_packages_apps_PhoneCommon-c11bd1b0ac01d0bd3497d1e47e70e53792036e5a.tar.gz
android_packages_apps_PhoneCommon-c11bd1b0ac01d0bd3497d1e47e70e53792036e5a.tar.bz2
android_packages_apps_PhoneCommon-c11bd1b0ac01d0bd3497d1e47e70e53792036e5a.zip
Use string SharedPreferences key for update ringtone.
Instead of using the preference, deal directly with the key. I changed the logic so that it will return null/silent as the ringtone uri if the key is null. Because, technically, one could call the function with a "type" expecting a valid return type, but not provide a key. Bug: 18232725 Change-Id: Ifb3d517ef8b0a5ddba388f2e0d471874f7b4b235
Diffstat (limited to 'src')
-rw-r--r--src/com/android/phone/common/util/SettingsUtil.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/com/android/phone/common/util/SettingsUtil.java b/src/com/android/phone/common/util/SettingsUtil.java
index 6a5bd1c..859c1a5 100644
--- a/src/com/android/phone/common/util/SettingsUtil.java
+++ b/src/com/android/phone/common/util/SettingsUtil.java
@@ -58,15 +58,11 @@ public class SettingsUtil {
* @param context The application context.
* @param handler The handler, which takes the name of the ringtone as a String as a parameter.
* @param type The type of sound.
- * @param preference The preference being updated.
+ * @param key The key to the shared preferences entry being updated.
* @param msg An integer identifying the message sent to the handler.
*/
public static void updateRingtoneName(
- Context context, Handler handler, int type, Preference preference, int msg) {
- if (preference == null) {
- return;
- }
-
+ Context context, Handler handler, int type, String key, int msg) {
final Uri ringtoneUri;
boolean defaultRingtone = false;
if (type == RingtoneManager.TYPE_RINGTONE) {
@@ -76,7 +72,7 @@ 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(preference.getKey(), null);
+ String uriString = prefs.getString(key, null);
if (TextUtils.isEmpty(uriString)) {
// silent ringtone
ringtoneUri = null;