summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Notification.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-30 15:59:53 -0700
committerTor Norbye <tnorbye@google.com>2013-09-11 14:55:38 -0700
commitd9273d6f289d9b55da3fd0db2f659fdfb48106a8 (patch)
treedd8bf34b123a4327a7fc55c944adf62e25aaa50d /core/java/android/app/Notification.java
parent78d00050272d796cc77557b9b715604d1c566c01 (diff)
downloadframeworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.zip
frameworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.tar.gz
frameworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.tar.bz2
Add typedefs and nullness annotations.
This changeset adds in typedef annotations (custom annotations marked with @IntDef) for various int parameters and return values in the API. It also adds nullness annotations for cases where the documentation explicitly mentioned null policy, or where it was blindingly obvious from the context. Also fixed some typos in the documentation. Change-Id: Ica27c01368895818e26237544edd8483007155bb
Diffstat (limited to 'core/java/android/app/Notification.java')
-rw-r--r--core/java/android/app/Notification.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index e70ad1c..45992e3 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -18,6 +18,7 @@ package android.app;
import com.android.internal.R;
+import android.annotation.IntDef;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -37,6 +38,8 @@ import android.view.View;
import android.widget.ProgressBar;
import android.widget.RemoteViews;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.text.NumberFormat;
import java.util.ArrayList;
@@ -350,6 +353,11 @@ public class Notification implements Parcelable
public int flags;
+ /** @hide */
+ @IntDef({PRIORITY_DEFAULT,PRIORITY_LOW,PRIORITY_MIN,PRIORITY_HIGH,PRIORITY_MAX})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Priority {}
+
/**
* Default notification {@link #priority}. If your application does not prioritize its own
* notifications, use this value for all notifications.
@@ -391,6 +399,7 @@ public class Notification implements Parcelable
* system will make a determination about how to interpret this priority when presenting
* the notification.
*/
+ @Priority
public int priority;
/**
@@ -1434,7 +1443,7 @@ public class Notification implements Parcelable
*
* @see Notification#priority
*/
- public Builder setPriority(int pri) {
+ public Builder setPriority(@Priority int pri) {
mPriority = pri;
return this;
}