summaryrefslogtreecommitdiff
path: root/core/java/android/app/NotificationChannel.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app/NotificationChannel.java')
-rw-r--r--core/java/android/app/NotificationChannel.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java
index 58ff4968b0a5..afcbcdf43344 100644
--- a/core/java/android/app/NotificationChannel.java
+++ b/core/java/android/app/NotificationChannel.java
@@ -347,12 +347,15 @@ public final class NotificationChannel implements Parcelable {
}
/**
- * Sets whether notification posted to this channel should vibrate.
+ * Sets the vibration pattern for notifications posted to this channel. If the provided
+ * pattern is valid (non-null, non-empty), will {@link #enableVibration(boolean)} enable
+ * vibration} as well. Otherwise, vibration will be disabled.
*
* Only modifiable before the channel is submitted to
* {@link NotificationManager#notify(String, int, Notification)}.
*/
public void setVibrationPattern(long[] vibrationPattern) {
+ this.mVibrationEnabled = vibrationPattern != null && vibrationPattern.length > 0;
this.mVibration = vibrationPattern;
}