From 96b3f8dba0a9747cf85a18abe87413ac00d73c11 Mon Sep 17 00:00:00 2001 From: Achim Thesmann Date: Fri, 17 Mar 2023 11:36:20 -0700 Subject: [PATCH] Make PendingIntent.send public API. There are several use cases where a developer would need to specyfy a Bundle with options, but currently they need to specify a lot of additional values (all null) to do so. Having this API public makes it a lot easier and less errorprone. This change does not refactor existing uses where only the Bundle is passed in. Test: API change only Bug: 273784196 Change-Id: I6486e953d21023cf5c8d120287205a3f9922bdd6 --- core/api/current.txt | 1 + core/java/android/app/PendingIntent.java | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 8b2a46903ef0a..06e3160eb1077 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -6944,6 +6944,7 @@ package android.app { method public void send() throws android.app.PendingIntent.CanceledException; method public void send(int) throws android.app.PendingIntent.CanceledException; method public void send(android.content.Context, int, @Nullable android.content.Intent) throws android.app.PendingIntent.CanceledException; + method public void send(@Nullable android.os.Bundle) throws android.app.PendingIntent.CanceledException; method public void send(int, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler) throws android.app.PendingIntent.CanceledException; method public void send(android.content.Context, int, @Nullable android.content.Intent, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler) throws android.app.PendingIntent.CanceledException; method public void send(android.content.Context, int, @Nullable android.content.Intent, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler, @Nullable String) throws android.app.PendingIntent.CanceledException; diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index e0f5fb4f75e2f..9bf56b374576b 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -892,10 +892,8 @@ public final class PendingIntent implements Parcelable { * @param options Additional options the caller would like to provide to modify the * sending behavior. May be built from an {@link ActivityOptions} to apply to an * activity start. - * - * @hide */ - public void send(Bundle options) throws CanceledException { + public void send(@Nullable Bundle options) throws CanceledException { send(null, 0, null, null, null, null, options); }