summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2023-01-13 14:00:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-01-13 14:00:10 +0000
commit7a75dfd56d5eb50eba3a0abf7aeaf403b036bb48 (patch)
tree99942541b6149ea420fa1c40de4845a031d6a39d
parent1be316ae02a0c732ecfe2eb4032cc93ed38149e3 (diff)
parentb2c884668b124cddf007ab05be6d857e56a0576f (diff)
downloadbase-7a75dfd56d5eb50eba3a0abf7aeaf403b036bb48.tar.gz
Merge "Add missing nullness annotations to Notification.Action and its Builder."
-rw-r--r--core/api/current.txt6
-rw-r--r--core/java/android/app/Notification.java14
2 files changed, 12 insertions, 8 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index a0c132f980dc..7765cd96aa15 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -6024,7 +6024,7 @@ package android.app {
}
public static class Notification.Action implements android.os.Parcelable {
- ctor @Deprecated public Notification.Action(int, CharSequence, android.app.PendingIntent);
+ ctor @Deprecated public Notification.Action(int, CharSequence, @Nullable android.app.PendingIntent);
method public android.app.Notification.Action clone();
method public int describeContents();
method public boolean getAllowGeneratedReplies();
@@ -6054,8 +6054,8 @@ package android.app {
}
public static final class Notification.Action.Builder {
- ctor @Deprecated public Notification.Action.Builder(int, CharSequence, android.app.PendingIntent);
- ctor public Notification.Action.Builder(android.graphics.drawable.Icon, CharSequence, android.app.PendingIntent);
+ ctor @Deprecated public Notification.Action.Builder(int, CharSequence, @Nullable android.app.PendingIntent);
+ ctor public Notification.Action.Builder(android.graphics.drawable.Icon, CharSequence, @Nullable android.app.PendingIntent);
ctor public Notification.Action.Builder(android.app.Notification.Action);
method @NonNull public android.app.Notification.Action.Builder addExtras(android.os.Bundle);
method @NonNull public android.app.Notification.Action.Builder addRemoteInput(android.app.RemoteInput);
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f320b742a430..b316b19c0b8a 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -1783,7 +1783,7 @@ public class Notification implements Parcelable
* @deprecated Use {@link android.app.Notification.Action.Builder}.
*/
@Deprecated
- public Action(int icon, CharSequence title, PendingIntent intent) {
+ public Action(int icon, CharSequence title, @Nullable PendingIntent intent) {
this(Icon.createWithResource("", icon), title, intent, new Bundle(), null, true,
SEMANTIC_ACTION_NONE, false /* isContextual */, false /* requireAuth */);
}
@@ -1908,10 +1908,12 @@ public class Notification implements Parcelable
* which may display them in other contexts, for example on a wearable device.
* @param icon icon to show for this action
* @param title the title of the action
- * @param intent the {@link PendingIntent} to fire when users trigger this action
+ * @param intent the {@link PendingIntent} to fire when users trigger this action. May
+ * be null, in which case the action may be rendered in a disabled presentation by the
+ * system UI.
*/
@Deprecated
- public Builder(int icon, CharSequence title, PendingIntent intent) {
+ public Builder(int icon, CharSequence title, @Nullable PendingIntent intent) {
this(Icon.createWithResource("", icon), title, intent);
}
@@ -1940,9 +1942,11 @@ public class Notification implements Parcelable
*
* @param icon icon to show for this action
* @param title the title of the action
- * @param intent the {@link PendingIntent} to fire when users trigger this action
+ * @param intent the {@link PendingIntent} to fire when users trigger this action. May
+ * be null, in which case the action may be rendered in a disabled presentation by the
+ * system UI.
*/
- public Builder(Icon icon, CharSequence title, PendingIntent intent) {
+ public Builder(Icon icon, CharSequence title, @Nullable PendingIntent intent) {
this(icon, title, intent, new Bundle(), null, true, SEMANTIC_ACTION_NONE, false);
}