Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a33f5c43 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Deprecate notification fields

And move references to the deprecated fields to
NotificationRecord for testability.

Test: runtest systemui-notification
Change-Id: If3910dc78297ad66679b1efa380315127261a018
parent 033a4120
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -5088,26 +5088,26 @@ package android.app {
    field public static final int FLAG_NO_CLEAR = 32; // 0x20
    field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
    field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
    field public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final deprecated int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final java.lang.String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field public static final int PRIORITY_DEFAULT = 0; // 0x0
    field public static final int PRIORITY_HIGH = 1; // 0x1
    field public static final int PRIORITY_LOW = -1; // 0xffffffff
    field public static final int PRIORITY_MAX = 2; // 0x2
    field public static final int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int PRIORITY_DEFAULT = 0; // 0x0
    field public static final deprecated int PRIORITY_HIGH = 1; // 0x1
    field public static final deprecated int PRIORITY_LOW = -1; // 0xffffffff
    field public static final deprecated int PRIORITY_MAX = 2; // 0x2
    field public static final deprecated int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int STREAM_DEFAULT = -1; // 0xffffffff
    field public static final int VISIBILITY_PRIVATE = 0; // 0x0
    field public static final int VISIBILITY_PUBLIC = 1; // 0x1
    field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
    field public android.app.Notification.Action[] actions;
    field public android.media.AudioAttributes audioAttributes;
    field public deprecated android.media.AudioAttributes audioAttributes;
    field public deprecated int audioStreamType;
    field public deprecated android.widget.RemoteViews bigContentView;
    field public java.lang.String category;
    field public int color;
    field public android.app.PendingIntent contentIntent;
    field public deprecated android.widget.RemoteViews contentView;
    field public int defaults;
    field public deprecated int defaults;
    field public android.app.PendingIntent deleteIntent;
    field public android.os.Bundle extras;
    field public int flags;
@@ -5116,16 +5116,16 @@ package android.app {
    field public deprecated int icon;
    field public int iconLevel;
    field public deprecated android.graphics.Bitmap largeIcon;
    field public int ledARGB;
    field public int ledOffMS;
    field public int ledOnMS;
    field public deprecated int ledARGB;
    field public deprecated int ledOffMS;
    field public deprecated int ledOnMS;
    field public deprecated int number;
    field public int priority;
    field public deprecated int priority;
    field public android.app.Notification publicVersion;
    field public android.net.Uri sound;
    field public deprecated android.net.Uri sound;
    field public java.lang.CharSequence tickerText;
    field public deprecated android.widget.RemoteViews tickerView;
    field public long[] vibrate;
    field public deprecated long[] vibrate;
    field public int visibility;
    field public long when;
  }
@@ -5229,7 +5229,7 @@ package android.app {
    method public android.app.Notification.Builder setCustomBigContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomHeadsUpContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setDefaults(int);
    method public deprecated android.app.Notification.Builder setDefaults(int);
    method public android.app.Notification.Builder setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setExtras(android.os.Bundle);
    method public android.app.Notification.Builder setFullScreenIntent(android.app.PendingIntent, boolean);
@@ -5237,12 +5237,12 @@ package android.app {
    method public android.app.Notification.Builder setGroupSummary(boolean);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setLights(int, int, int);
    method public deprecated android.app.Notification.Builder setLights(int, int, int);
    method public android.app.Notification.Builder setLocalOnly(boolean);
    method public deprecated android.app.Notification.Builder setNumber(int);
    method public android.app.Notification.Builder setOngoing(boolean);
    method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
    method public android.app.Notification.Builder setPriority(int);
    method public deprecated android.app.Notification.Builder setPriority(int);
    method public android.app.Notification.Builder setProgress(int, int, boolean);
    method public android.app.Notification.Builder setPublicVersion(android.app.Notification);
    method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]);
@@ -5251,16 +5251,16 @@ package android.app {
    method public android.app.Notification.Builder setSmallIcon(int, int);
    method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setSortKey(java.lang.String);
    method public android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
    method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public android.app.Notification.Builder setStyle(android.app.Notification.Style);
    method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
    method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
    method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
    method public android.app.Notification.Builder setTimeout(long);
    method public android.app.Notification.Builder setUsesChronometer(boolean);
    method public android.app.Notification.Builder setVibrate(long[]);
    method public deprecated android.app.Notification.Builder setVibrate(long[]);
    method public android.app.Notification.Builder setVisibility(int);
    method public android.app.Notification.Builder setWhen(long);
  }
+20 −20
Original line number Diff line number Diff line
@@ -5251,26 +5251,26 @@ package android.app {
    field public static final int FLAG_NO_CLEAR = 32; // 0x20
    field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
    field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
    field public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final deprecated int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final java.lang.String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field public static final int PRIORITY_DEFAULT = 0; // 0x0
    field public static final int PRIORITY_HIGH = 1; // 0x1
    field public static final int PRIORITY_LOW = -1; // 0xffffffff
    field public static final int PRIORITY_MAX = 2; // 0x2
    field public static final int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int PRIORITY_DEFAULT = 0; // 0x0
    field public static final deprecated int PRIORITY_HIGH = 1; // 0x1
    field public static final deprecated int PRIORITY_LOW = -1; // 0xffffffff
    field public static final deprecated int PRIORITY_MAX = 2; // 0x2
    field public static final deprecated int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int STREAM_DEFAULT = -1; // 0xffffffff
    field public static final int VISIBILITY_PRIVATE = 0; // 0x0
    field public static final int VISIBILITY_PUBLIC = 1; // 0x1
    field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
    field public android.app.Notification.Action[] actions;
    field public android.media.AudioAttributes audioAttributes;
    field public deprecated android.media.AudioAttributes audioAttributes;
    field public deprecated int audioStreamType;
    field public deprecated android.widget.RemoteViews bigContentView;
    field public java.lang.String category;
    field public int color;
    field public android.app.PendingIntent contentIntent;
    field public deprecated android.widget.RemoteViews contentView;
    field public int defaults;
    field public deprecated int defaults;
    field public android.app.PendingIntent deleteIntent;
    field public android.os.Bundle extras;
    field public int flags;
@@ -5279,16 +5279,16 @@ package android.app {
    field public deprecated int icon;
    field public int iconLevel;
    field public deprecated android.graphics.Bitmap largeIcon;
    field public int ledARGB;
    field public int ledOffMS;
    field public int ledOnMS;
    field public deprecated int ledARGB;
    field public deprecated int ledOffMS;
    field public deprecated int ledOnMS;
    field public deprecated int number;
    field public int priority;
    field public deprecated int priority;
    field public android.app.Notification publicVersion;
    field public android.net.Uri sound;
    field public deprecated android.net.Uri sound;
    field public java.lang.CharSequence tickerText;
    field public deprecated android.widget.RemoteViews tickerView;
    field public long[] vibrate;
    field public deprecated long[] vibrate;
    field public int visibility;
    field public long when;
  }
@@ -5392,7 +5392,7 @@ package android.app {
    method public android.app.Notification.Builder setCustomBigContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomHeadsUpContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setDefaults(int);
    method public deprecated android.app.Notification.Builder setDefaults(int);
    method public android.app.Notification.Builder setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setExtras(android.os.Bundle);
    method public android.app.Notification.Builder setFullScreenIntent(android.app.PendingIntent, boolean);
@@ -5400,12 +5400,12 @@ package android.app {
    method public android.app.Notification.Builder setGroupSummary(boolean);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setLights(int, int, int);
    method public deprecated android.app.Notification.Builder setLights(int, int, int);
    method public android.app.Notification.Builder setLocalOnly(boolean);
    method public deprecated android.app.Notification.Builder setNumber(int);
    method public android.app.Notification.Builder setOngoing(boolean);
    method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
    method public android.app.Notification.Builder setPriority(int);
    method public deprecated android.app.Notification.Builder setPriority(int);
    method public android.app.Notification.Builder setProgress(int, int, boolean);
    method public android.app.Notification.Builder setPublicVersion(android.app.Notification);
    method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]);
@@ -5414,16 +5414,16 @@ package android.app {
    method public android.app.Notification.Builder setSmallIcon(int, int);
    method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setSortKey(java.lang.String);
    method public android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
    method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public android.app.Notification.Builder setStyle(android.app.Notification.Style);
    method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
    method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
    method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
    method public android.app.Notification.Builder setTimeout(long);
    method public android.app.Notification.Builder setUsesChronometer(boolean);
    method public android.app.Notification.Builder setVibrate(long[]);
    method public deprecated android.app.Notification.Builder setVibrate(long[]);
    method public android.app.Notification.Builder setVisibility(int);
    method public android.app.Notification.Builder setWhen(long);
  }
+20 −20
Original line number Diff line number Diff line
@@ -5098,26 +5098,26 @@ package android.app {
    field public static final int FLAG_NO_CLEAR = 32; // 0x20
    field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
    field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
    field public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final deprecated int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final java.lang.String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field public static final int PRIORITY_DEFAULT = 0; // 0x0
    field public static final int PRIORITY_HIGH = 1; // 0x1
    field public static final int PRIORITY_LOW = -1; // 0xffffffff
    field public static final int PRIORITY_MAX = 2; // 0x2
    field public static final int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int PRIORITY_DEFAULT = 0; // 0x0
    field public static final deprecated int PRIORITY_HIGH = 1; // 0x1
    field public static final deprecated int PRIORITY_LOW = -1; // 0xffffffff
    field public static final deprecated int PRIORITY_MAX = 2; // 0x2
    field public static final deprecated int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated int STREAM_DEFAULT = -1; // 0xffffffff
    field public static final int VISIBILITY_PRIVATE = 0; // 0x0
    field public static final int VISIBILITY_PUBLIC = 1; // 0x1
    field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
    field public android.app.Notification.Action[] actions;
    field public android.media.AudioAttributes audioAttributes;
    field public deprecated android.media.AudioAttributes audioAttributes;
    field public deprecated int audioStreamType;
    field public deprecated android.widget.RemoteViews bigContentView;
    field public java.lang.String category;
    field public int color;
    field public android.app.PendingIntent contentIntent;
    field public deprecated android.widget.RemoteViews contentView;
    field public int defaults;
    field public deprecated int defaults;
    field public android.app.PendingIntent deleteIntent;
    field public android.os.Bundle extras;
    field public int flags;
@@ -5126,16 +5126,16 @@ package android.app {
    field public deprecated int icon;
    field public int iconLevel;
    field public deprecated android.graphics.Bitmap largeIcon;
    field public int ledARGB;
    field public int ledOffMS;
    field public int ledOnMS;
    field public deprecated int ledARGB;
    field public deprecated int ledOffMS;
    field public deprecated int ledOnMS;
    field public deprecated int number;
    field public int priority;
    field public deprecated int priority;
    field public android.app.Notification publicVersion;
    field public android.net.Uri sound;
    field public deprecated android.net.Uri sound;
    field public java.lang.CharSequence tickerText;
    field public deprecated android.widget.RemoteViews tickerView;
    field public long[] vibrate;
    field public deprecated long[] vibrate;
    field public int visibility;
    field public long when;
  }
@@ -5239,7 +5239,7 @@ package android.app {
    method public android.app.Notification.Builder setCustomBigContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomHeadsUpContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setDefaults(int);
    method public deprecated android.app.Notification.Builder setDefaults(int);
    method public android.app.Notification.Builder setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setExtras(android.os.Bundle);
    method public android.app.Notification.Builder setFullScreenIntent(android.app.PendingIntent, boolean);
@@ -5247,12 +5247,12 @@ package android.app {
    method public android.app.Notification.Builder setGroupSummary(boolean);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setLights(int, int, int);
    method public deprecated android.app.Notification.Builder setLights(int, int, int);
    method public android.app.Notification.Builder setLocalOnly(boolean);
    method public deprecated android.app.Notification.Builder setNumber(int);
    method public android.app.Notification.Builder setOngoing(boolean);
    method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
    method public android.app.Notification.Builder setPriority(int);
    method public deprecated android.app.Notification.Builder setPriority(int);
    method public android.app.Notification.Builder setProgress(int, int, boolean);
    method public android.app.Notification.Builder setPublicVersion(android.app.Notification);
    method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]);
@@ -5261,16 +5261,16 @@ package android.app {
    method public android.app.Notification.Builder setSmallIcon(int, int);
    method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setSortKey(java.lang.String);
    method public android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
    method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public android.app.Notification.Builder setStyle(android.app.Notification.Style);
    method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
    method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
    method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
    method public android.app.Notification.Builder setTimeout(long);
    method public android.app.Notification.Builder setUsesChronometer(boolean);
    method public android.app.Notification.Builder setVibrate(long[]);
    method public deprecated android.app.Notification.Builder setVibrate(long[]);
    method public android.app.Notification.Builder setVisibility(int);
    method public android.app.Notification.Builder setWhen(long);
  }
+55 −9

File changed.

Preview size limit exceeded, changes collapsed.

+4 −1
Original line number Diff line number Diff line
@@ -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;
    }

Loading