summaryrefslogtreecommitdiff
path: root/core/java/android/app/Notification.java
diff options
context:
space:
mode:
authorcncn <cncn@google.com>2019-11-21 19:02:49 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-11-21 19:02:49 -0800
commitf4878a0094025412729f8a5cc1b5c69bfafcd01e (patch)
tree7ef52690d1cf5c25245982591e8747b897ac3606 /core/java/android/app/Notification.java
parent2ff5bbe82253201950f61523b7d75a71ec3beac0 (diff)
parent689403c3d5a0fe91fcc57cabef7eaf177b9b1114 (diff)
Merge "Make Notification.Builder.SetFlag public" am: c8bd4aecb3 am: dca2d45630
am: 689403c3d5 Change-Id: I8e8d117020327593833536ae7ee43e5b94899c9e
Diffstat (limited to 'core/java/android/app/Notification.java')
-rw-r--r--core/java/android/app/Notification.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 3ac88ebe1abb..b37cc266a156 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -627,6 +627,13 @@ public class Notification implements Parcelable
*/
public static final int FLAG_BUBBLE = 0x00001000;
+ /** @hide */
+ @IntDef({FLAG_SHOW_LIGHTS, FLAG_ONGOING_EVENT, FLAG_INSISTENT, FLAG_ONLY_ALERT_ONCE,
+ FLAG_AUTO_CANCEL, FLAG_NO_CLEAR, FLAG_FOREGROUND_SERVICE, FLAG_HIGH_PRIORITY,
+ FLAG_LOCAL_ONLY, FLAG_GROUP_SUMMARY, FLAG_AUTOGROUP_SUMMARY, FLAG_BUBBLE})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface NotificationFlags{};
+
public int flags;
/** @hide */
@@ -4545,10 +4552,15 @@ public class Notification implements Parcelable
}
/**
- * @hide
+ * Set the value for a notification flag
+ *
+ * @param mask Bit mask of the flag
+ * @param value Status (on/off) of the flag
+ *
+ * @return The same Builder.
*/
@NonNull
- public Builder setFlag(int mask, boolean value) {
+ public Builder setFlag(@NotificationFlags int mask, boolean value) {
if (value) {
mN.flags |= mask;
} else {