summaryrefslogtreecommitdiff
path: root/core/java/android/app/Notification.java
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2017-07-10 17:14:57 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-07-10 17:14:57 +0000
commited7b5c64e0c2eabd044f363c75ba4ae139fc8a70 (patch)
treea06cac444cb9dae811e3369b8c31263b57b81804 /core/java/android/app/Notification.java
parent0407c1259c0e2b67274d92b8357f91cf925941f6 (diff)
parent8d4cd22ffb79a9f70bd3ecf78c95e056d3643661 (diff)
Merge "Limit the number of notis an app can enqueue" into oc-dr1-dev am: c65071d625
am: 8d4cd22ffb Change-Id: I60ddda50a6d5a6a3028361435a340d6191f6c729
Diffstat (limited to 'core/java/android/app/Notification.java')
-rw-r--r--core/java/android/app/Notification.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 71b159ea0f66..df4f0e4a8216 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -2543,6 +2543,22 @@ public class Notification implements Parcelable
}
}
+ /**
+ * @hide
+ */
+ public boolean hasCompletedProgress() {
+ // not a progress notification; can't be complete
+ if (!extras.containsKey(EXTRA_PROGRESS)
+ || !extras.containsKey(EXTRA_PROGRESS_MAX)) {
+ return false;
+ }
+ // many apps use max 0 for 'indeterminate'; not complete
+ if (extras.getInt(EXTRA_PROGRESS_MAX) == 0) {
+ return false;
+ }
+ return extras.getInt(EXTRA_PROGRESS) == extras.getInt(EXTRA_PROGRESS_MAX);
+ }
+
/** @removed */
@Deprecated
public String getChannel() {