diff options
| author | Julia Reynolds <juliacr@google.com> | 2017-04-13 17:07:41 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-13 17:07:46 +0000 |
| commit | d178ec489ffadff8b0a1e210f3351c00f71a10ab (patch) | |
| tree | bf411fb6b46cde5382ca15a66326da7d6df24919 /core/java/android | |
| parent | 76c13a5fce91acadfa2b28f1def68c87e7b65db5 (diff) | |
| parent | 184b86da382b8e24cdd0e5629e70d7057d418883 (diff) | |
Merge "Allow notification channels to be silent." into oc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/NotificationChannel.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index 92216d15ec95..e50bc136bc5a 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -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; @@ -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; @@ -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)}. @@ -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() { |
