Notification sound field updates

- Show default and silent options
- Don't also update the default notification sound
- Display a better summary in case the sound isn't in media store

Change-Id: I42d537657a7bbddb8a1ce41fd03b8e5847899a82
Fixes: 36734113
Fixes: 36849670
Test: manual (silent sound, default sound, normal sound, private sound)
This commit is contained in:
Julia Reynolds
2017-04-11 16:55:43 -04:00
parent 665c1ced58
commit 18fcc05224
4 changed files with 67 additions and 7 deletions

View File

@@ -21,7 +21,6 @@ import static android.app.NotificationManager.IMPORTANCE_LOW;
import static android.app.NotificationManager.IMPORTANCE_MIN;
import static android.app.NotificationManager.IMPORTANCE_NONE;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -29,7 +28,6 @@ import android.app.admin.DevicePolicyManager;
import android.content.Intent;
import android.content.pm.UserInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.NotificationListenerService.Ranking;
@@ -63,7 +61,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
protected RestrictedSwitchPreference mLights;
protected RestrictedSwitchPreference mVibrate;
protected DefaultNotificationTonePreference mRingtone;
protected NotificationSoundPreference mRingtone;
protected RestrictedDropDownPreference mImportance;
protected RestrictedSwitchPreference mPriority;
protected RestrictedDropDownPreference mVisibilityOverride;
@@ -102,7 +100,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
(RestrictedDropDownPreference) findPreference(KEY_VISIBILITY_OVERRIDE);
mLights = (RestrictedSwitchPreference) findPreference(KEY_LIGHTS);
mVibrate = (RestrictedSwitchPreference) findPreference(KEY_VIBRATE);
mRingtone = (DefaultNotificationTonePreference) findPreference(KEY_RINGTONE);
mRingtone = (NotificationSoundPreference) findPreference(KEY_RINGTONE);
if (mPkgInfo != null && mChannel != null) {
setupPriorityPref(mChannel.canBypassDnd());