method public int describeContents();
method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
method public void writeToParcel(android.os.Parcel, int);
+ field public static final java.lang.String CATEGORY_ALARM = "alarm";
+ field public static final java.lang.String CATEGORY_CALL = "call";
+ field public static final java.lang.String CATEGORY_EMAIL = "email";
+ field public static final java.lang.String CATEGORY_ERROR = "err";
+ field public static final java.lang.String CATEGORY_EVENT = "event";
+ field public static final java.lang.String CATEGORY_MESSAGE = "msg";
+ field public static final java.lang.String CATEGORY_PROGRESS = "progress";
+ field public static final java.lang.String CATEGORY_PROMO = "promo";
+ field public static final java.lang.String CATEGORY_RECOMMENDATION = "recommendation";
+ field public static final java.lang.String CATEGORY_SERVICE = "service";
+ field public static final java.lang.String CATEGORY_SOCIAL = "social";
+ field public static final java.lang.String CATEGORY_STATUS = "status";
+ field public static final java.lang.String CATEGORY_SYSTEM = "sys";
+ field public static final java.lang.String CATEGORY_TRANSPORT = "transport";
field public static final android.os.Parcelable.Creator CREATOR;
field public static final int DEFAULT_ALL = -1; // 0xffffffff
field public static final int DEFAULT_LIGHTS = 4; // 0x4
field public android.app.Notification.Action[] actions;
field public int audioStreamType;
field public android.widget.RemoteViews bigContentView;
+ field public java.lang.String category;
field public android.app.PendingIntent contentIntent;
field public android.widget.RemoteViews contentView;
field public int defaults;
method public android.os.Bundle getExtras();
method public deprecated android.app.Notification getNotification();
method public android.app.Notification.Builder setAutoCancel(boolean);
+ method public android.app.Notification.Builder setCategory(java.lang.String);
method public android.app.Notification.Builder setContent(android.widget.RemoteViews);
method public android.app.Notification.Builder setContentInfo(java.lang.CharSequence);
method public android.app.Notification.Builder setContentIntent(android.app.PendingIntent);
public int priority;
/**
- * @hide
- * Notification type: incoming call (voice or video) or similar synchronous communication request.
+ * Notification category: incoming call (voice or video) or similar synchronous communication request.
*/
- public static final String KIND_CALL = "android.call";
+ public static final String CATEGORY_CALL = "call";
/**
- * @hide
- * Notification type: incoming direct message (SMS, instant message, etc.).
+ * Notification category: incoming direct message (SMS, instant message, etc.).
*/
- public static final String KIND_MESSAGE = "android.message";
+ public static final String CATEGORY_MESSAGE = "msg";
/**
- * @hide
- * Notification type: asynchronous bulk message (email).
+ * Notification category: asynchronous bulk message (email).
*/
- public static final String KIND_EMAIL = "android.email";
+ public static final String CATEGORY_EMAIL = "email";
/**
- * @hide
- * Notification type: calendar event.
+ * Notification category: calendar event.
*/
- public static final String KIND_EVENT = "android.event";
+ public static final String CATEGORY_EVENT = "event";
/**
- * @hide
- * Notification type: promotion or advertisement.
+ * Notification category: promotion or advertisement.
*/
- public static final String KIND_PROMO = "android.promo";
+ public static final String CATEGORY_PROMO = "promo";
/**
- * @hide
- * If this notification matches of one or more special types (see the <code>KIND_*</code>
- * constants), add them here, best match first.
+ * Notification category: alarm or timer.
+ */
+ public static final String CATEGORY_ALARM = "alarm";
+
+ /**
+ * Notification category: progress of a long-running background operation.
+ */
+ public static final String CATEGORY_PROGRESS = "progress";
+
+ /**
+ * Notification category: social network or sharing update.
+ */
+ public static final String CATEGORY_SOCIAL = "social";
+
+ /**
+ * Notification category: error in background operation or authentication status.
+ */
+ public static final String CATEGORY_ERROR = "err";
+
+ /**
+ * Notification category: media transport control for playback.
+ */
+ public static final String CATEGORY_TRANSPORT = "transport";
+
+ /**
+ * Notification category: system or device status update. Reserved for system use.
+ */
+ public static final String CATEGORY_SYSTEM = "sys";
+
+ /**
+ * Notification category: indication of running background service.
+ */
+ public static final String CATEGORY_SERVICE = "service";
+
+ /**
+ * Notification category: a specific, timely recommendation for a single thing.
+ * For example, a news app might want to recommend a news story it believes the user will
+ * want to read next.
+ */
+ public static final String CATEGORY_RECOMMENDATION = "recommendation";
+
+ /**
+ * Notification category: ongoing information about device or contextual status.
+ */
+ public static final String CATEGORY_STATUS = "status";
+
+ /**
+ * One of the predefined notification categories (see the <code>CATEGORY_*</code> constants)
+ * that best describes this Notification. May be used by the system for ranking and filtering.
*/
- public String[] kind;
+ public String category;
/**
* Additional semantic data to be carried around with this Notification.
public static final String EXTRA_AS_HEADS_UP = "headsup";
/**
+ * Allow certain system-generated notifications to appear before the device is provisioned.
+ * Only available to notifications coming from the android package.
+ * @hide
+ */
+ public static final String EXTRA_ALLOW_DURING_SETUP = "android.allowDuringSetup";
+
+ /**
* Value for {@link #EXTRA_AS_HEADS_UP}.
* @hide
*/
priority = parcel.readInt();
- kind = parcel.createStringArray(); // may set kind to null
+ category = parcel.readString();
extras = parcel.readBundle(); // may be null
that.priority = this.priority;
- final String[] thiskind = this.kind;
- if (thiskind != null) {
- final int N = thiskind.length;
- final String[] thatkind = that.kind = new String[N];
- System.arraycopy(thiskind, 0, thatkind, 0, N);
- }
+ that.category = this.category;
if (this.extras != null) {
try {
parcel.writeInt(priority);
- parcel.writeStringArray(kind); // ok for null
+ parcel.writeString(category);
parcel.writeBundle(extras); // null ok
sb.append(Integer.toHexString(this.defaults));
sb.append(" flags=0x");
sb.append(Integer.toHexString(this.flags));
- sb.append(" kind=[");
- if (this.kind == null) {
- sb.append("null");
- } else {
- for (int i=0; i<this.kind.length; i++) {
- if (i>0) sb.append(",");
- sb.append(this.kind[i]);
- }
- }
- sb.append("]");
+ sb.append(" category="); sb.append(this.category);
if (actions != null) {
sb.append(" ");
sb.append(actions.length);
private int mProgressMax;
private int mProgress;
private boolean mProgressIndeterminate;
- private ArrayList<String> mKindList = new ArrayList<String>(1);
+ private String mCategory;
private Bundle mExtras;
private int mPriority;
private ArrayList<Action> mActions = new ArrayList<Action>(MAX_ACTION_BUTTONS);
}
/**
- * @hide
- *
- * Add a kind (category) to this notification. Optional.
+ * Set the notification category.
*
- * @see Notification#kind
+ * @see Notification#category
*/
- public Builder addKind(String k) {
- mKindList.add(k);
+ public Builder setCategory(String category) {
+ mCategory = category;
return this;
}
if ((mDefaults & DEFAULT_LIGHTS) != 0) {
n.flags |= FLAG_SHOW_LIGHTS;
}
- if (mKindList.size() > 0) {
- n.kind = new String[mKindList.size()];
- mKindList.toArray(n.kind);
- } else {
- n.kind = null;
- }
+ n.category = mCategory;
n.priority = mPriority;
if (mActions.size() > 0) {
n.actions = new Action[mActions.size()];