diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2017-04-19 23:24:18 -0600 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2017-04-20 17:21:41 -0600 |
| commit | 6503bd8e33dbf6e8357256d43c6e1158e32a0268 (patch) | |
| tree | 5d07a07cb8251b6a0653edea4a61b084a95e584d /core/java/android/app/NotificationChannel.java | |
| parent | 4132f860419584bf4aefa7b6a3a708b25643675b (diff) | |
Auto-generate docs based on annotations.
We have a handful of annotations that we've been sprinkling across
the platform APIs, such as @Nullable, @NonNull, @IntDef, etc. It
would be really helpful to surface these contracts to developers
through the SDK docs.
This change allows annotations like those mentioned above to declare
the following new javadoc fields:
@memberDoc: docs to append to a field or method definition.
@paramDoc: docs to append to a @param definition.
@returnDoc: docs to append to a @return definition.
This change also builds a docstring to describe the list of all
constants listed in an @IntDef annotation. Sadly AnnotationDesc
only passes along raw constant values, so we need the help of the
new "prefix" annotation argument to help find the field names.
Test: builds
Bug: 37526420
Change-Id: I4cfc00dd904e5dfa945b406d546e36846b7c0c28
Diffstat (limited to 'core/java/android/app/NotificationChannel.java')
| -rw-r--r-- | core/java/android/app/NotificationChannel.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index e50bc136bc5a..9059daa62dc7 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -21,6 +21,7 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlSerializer; import android.annotation.SystemApi; +import android.app.NotificationManager.Importance; import android.content.Intent; import android.media.AudioAttributes; import android.net.Uri; @@ -389,16 +390,14 @@ public final class NotificationChannel implements Parcelable { } /** - * Sets the level of interruption of this notification channel. - * - * Only modifiable before the channel is submitted to + * Sets the level of interruption of this notification channel. Only + * modifiable before the channel is submitted to * {@link NotificationManager#notify(String, int, Notification)}. * - * @param importance the amount the user should be interrupted by notifications from this - * channel. See e.g. - * {@link android.app.NotificationManager#IMPORTANCE_DEFAULT}. + * @param importance the amount the user should be interrupted by + * notifications from this channel. */ - public void setImportance(int importance) { + public void setImportance(@Importance int importance) { this.mImportance = importance; } |
