Loading core/java/android/app/NotificationChannel.java +5 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.media.AudioAttributes; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.text.TextUtils; Loading Loading @@ -139,7 +140,7 @@ public final class NotificationChannel implements Parcelable { private int mImportance = DEFAULT_IMPORTANCE; private boolean mBypassDnd; private int mLockscreenVisibility = DEFAULT_VISIBILITY; private Uri mSound; private Uri mSound = Settings.System.DEFAULT_NOTIFICATION_URI; private boolean mLights; private int mLightColor = DEFAULT_LIGHT_COLOR; private long[] mVibration; Loading Loading @@ -330,7 +331,8 @@ public final class NotificationChannel implements Parcelable { /** * Sets the sound that should be played for notifications posted to this channel and its * audio attributes. * audio attributes. Notification channels with an {@link #getImportance() importance} of at * least {@link NotificationManager#IMPORTANCE_DEFAULT} should have a sound. * * Only modifiable before the channel is submitted to * {@link NotificationManager#notify(String, int, Notification)}. Loading Loading @@ -445,7 +447,7 @@ public final class NotificationChannel implements Parcelable { } /** * Returns the user specified importance {e.g. @link NotificationManager#IMPORTANCE_LOW} for * Returns the user specified importance e.g. {@link NotificationManager#IMPORTANCE_LOW} for * notifications posted to this channel. */ public int getImportance() { Loading services/core/java/com/android/server/notification/RankingHelper.java +0 −4 Original line number Diff line number Diff line Loading @@ -570,10 +570,6 @@ public class RankingHelper implements RankingConfig { if (!r.showBadge) { channel.setShowBadge(false); } if (channel.getSound() == null) { channel.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, Notification.AUDIO_ATTRIBUTES_DEFAULT); } r.channels.put(channel.getId(), channel); MetricsLogger.action(getChannelLog(channel, pkg).setType( MetricsProto.MetricsEvent.TYPE_OPEN)); Loading services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,8 @@ public class BuzzBeepBlinkTest { builder.setSound(CUSTOM_SOUND); channel.setSound(CUSTOM_SOUND, CUSTOM_ATTRIBUTES); } } else { channel.setSound(null, null); } if (buzzy) { if (defaultVibration) { Loading services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +0 −9 Original line number Diff line number Diff line Loading @@ -737,15 +737,6 @@ public class RankingHelperTest { mHelper.getNotificationChannel(PKG, UID, newChannel.getId(), false)); } @Test public void testCreateChannel_addMissingSound() throws Exception { final NotificationChannel channel = new NotificationChannel("id2", "name2", IMPORTANCE_LOW); mHelper.createNotificationChannel(PKG, UID, channel, true); assertNotNull(mHelper.getNotificationChannel( PKG, UID, channel.getId(), false).getSound()); } @Test public void testCreateChannel_noOverrideSound() throws Exception { Uri sound = new Uri.Builder().scheme("test").build(); Loading Loading
core/java/android/app/NotificationChannel.java +5 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.media.AudioAttributes; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.text.TextUtils; Loading Loading @@ -139,7 +140,7 @@ public final class NotificationChannel implements Parcelable { private int mImportance = DEFAULT_IMPORTANCE; private boolean mBypassDnd; private int mLockscreenVisibility = DEFAULT_VISIBILITY; private Uri mSound; private Uri mSound = Settings.System.DEFAULT_NOTIFICATION_URI; private boolean mLights; private int mLightColor = DEFAULT_LIGHT_COLOR; private long[] mVibration; Loading Loading @@ -330,7 +331,8 @@ public final class NotificationChannel implements Parcelable { /** * Sets the sound that should be played for notifications posted to this channel and its * audio attributes. * audio attributes. Notification channels with an {@link #getImportance() importance} of at * least {@link NotificationManager#IMPORTANCE_DEFAULT} should have a sound. * * Only modifiable before the channel is submitted to * {@link NotificationManager#notify(String, int, Notification)}. Loading Loading @@ -445,7 +447,7 @@ public final class NotificationChannel implements Parcelable { } /** * Returns the user specified importance {e.g. @link NotificationManager#IMPORTANCE_LOW} for * Returns the user specified importance e.g. {@link NotificationManager#IMPORTANCE_LOW} for * notifications posted to this channel. */ public int getImportance() { Loading
services/core/java/com/android/server/notification/RankingHelper.java +0 −4 Original line number Diff line number Diff line Loading @@ -570,10 +570,6 @@ public class RankingHelper implements RankingConfig { if (!r.showBadge) { channel.setShowBadge(false); } if (channel.getSound() == null) { channel.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, Notification.AUDIO_ATTRIBUTES_DEFAULT); } r.channels.put(channel.getId(), channel); MetricsLogger.action(getChannelLog(channel, pkg).setType( MetricsProto.MetricsEvent.TYPE_OPEN)); Loading
services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,8 @@ public class BuzzBeepBlinkTest { builder.setSound(CUSTOM_SOUND); channel.setSound(CUSTOM_SOUND, CUSTOM_ATTRIBUTES); } } else { channel.setSound(null, null); } if (buzzy) { if (defaultVibration) { Loading
services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +0 −9 Original line number Diff line number Diff line Loading @@ -737,15 +737,6 @@ public class RankingHelperTest { mHelper.getNotificationChannel(PKG, UID, newChannel.getId(), false)); } @Test public void testCreateChannel_addMissingSound() throws Exception { final NotificationChannel channel = new NotificationChannel("id2", "name2", IMPORTANCE_LOW); mHelper.createNotificationChannel(PKG, UID, channel, true); assertNotNull(mHelper.getNotificationChannel( PKG, UID, channel.getId(), false).getSound()); } @Test public void testCreateChannel_noOverrideSound() throws Exception { Uri sound = new Uri.Builder().scheme("test").build(); Loading