summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/java/com/android/internal/telephony/util/NotificationChannelController.java6
-rw-r--r--src/java/com/android/internal/telephony/util/VoicemailNotificationSettingsUtil.java22
2 files changed, 4 insertions, 24 deletions
diff --git a/src/java/com/android/internal/telephony/util/NotificationChannelController.java b/src/java/com/android/internal/telephony/util/NotificationChannelController.java
index de1ddd3026..ac6a385fa4 100644
--- a/src/java/com/android/internal/telephony/util/NotificationChannelController.java
+++ b/src/java/com/android/internal/telephony/util/NotificationChannelController.java
@@ -23,7 +23,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioAttributes;
-import android.net.Uri;
import android.provider.Settings;
import android.telephony.SubscriptionManager;
@@ -138,7 +137,6 @@ public class NotificationChannelController {
/**
* migrate deprecated voicemail notification settings to initial notification channel settings
- * {@link VoicemailNotificationSettingsUtil#getRingTonePreference(Context)}}
* {@link VoicemailNotificationSettingsUtil#getVibrationPreference(Context)}
* notification settings are based on subId, only migrate if sub id matches.
* otherwise fallback to predefined voicemail channel settings.
@@ -151,10 +149,6 @@ public class NotificationChannelController {
NotificationManager.IMPORTANCE_DEFAULT);
voiceMailChannel.enableVibration(
VoicemailNotificationSettingsUtil.getVibrationPreference(context));
- Uri sound = VoicemailNotificationSettingsUtil.getRingTonePreference(context);
- voiceMailChannel.setSound(
- (sound == null) ? Settings.System.DEFAULT_NOTIFICATION_URI : sound,
- new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build());
context.getSystemService(NotificationManager.class)
.createNotificationChannel(voiceMailChannel);
}
diff --git a/src/java/com/android/internal/telephony/util/VoicemailNotificationSettingsUtil.java b/src/java/com/android/internal/telephony/util/VoicemailNotificationSettingsUtil.java
index d8988e3230..3dd3d375c9 100644
--- a/src/java/com/android/internal/telephony/util/VoicemailNotificationSettingsUtil.java
+++ b/src/java/com/android/internal/telephony/util/VoicemailNotificationSettingsUtil.java
@@ -21,10 +21,8 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
-import android.provider.Settings;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
-import android.text.TextUtils;
public class VoicemailNotificationSettingsUtil {
private static final String VOICEMAIL_NOTIFICATION_RINGTONE_SHARED_PREFS_KEY_PREFIX =
@@ -64,27 +62,15 @@ public class VoicemailNotificationSettingsUtil {
}
public static void setRingtoneUri(Context context, Uri ringtoneUri) {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- String ringtoneUriStr = ringtoneUri != null ? ringtoneUri.toString() : "";
-
- SharedPreferences.Editor editor = prefs.edit();
- editor.putString(getVoicemailRingtoneSharedPrefsKey(), ringtoneUriStr);
- editor.commit();
+ // Do nothing; we don't use the shared preference any more.
}
public static Uri getRingtoneUri(Context context) {
final NotificationChannel channel = NotificationChannelController.getChannel(
NotificationChannelController.CHANNEL_ID_VOICE_MAIL, context);
- return (channel != null) ? channel.getSound() : getRingTonePreference(context);
- }
-
- public static Uri getRingTonePreference(Context context) {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- migrateVoicemailRingtoneSettingsIfNeeded(context, prefs);
- String uriString = prefs.getString(
- getVoicemailRingtoneSharedPrefsKey(),
- Settings.System.DEFAULT_NOTIFICATION_URI.toString());
- return !TextUtils.isEmpty(uriString) ? Uri.parse(uriString) : null;
+ // Note: NEVER look at the shared preferences; this was migrated to the notification channel
+ // in Android P.
+ return (channel != null) ? channel.getSound() : null;
}
/**