diff options
| author | Julia Reynolds <juliacr@google.com> | 2017-01-31 16:53:35 -0500 |
|---|---|---|
| committer | Julia Reynolds <juliacr@google.com> | 2017-02-01 09:56:00 -0500 |
| commit | a33f5c4312ce708933454dfd1b154ccc46be099c (patch) | |
| tree | 96d08c762ba91bf88848c04d89c585e2723385dc /core/java/android/app/NotificationChannel.java | |
| parent | 033a4120a8ed78c2b97a5ff9ce2f52de7a1a662d (diff) | |
Deprecate notification fields
And move references to the deprecated fields to
NotificationRecord for testability.
Test: runtest systemui-notification
Change-Id: If3910dc78297ad66679b1efa380315127261a018
Diffstat (limited to 'core/java/android/app/NotificationChannel.java')
| -rw-r--r-- | core/java/android/app/NotificationChannel.java | 5 |
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; } |
