diff options
| author | Mady Mellor <madym@google.com> | 2021-04-12 14:53:01 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-12 14:53:01 +0000 |
| commit | 02b75bb425be4aa0d326ce582d9169374795b60f (patch) | |
| tree | 2f8585bce773fc066393b298b76bb19be32360c9 /core/java/android/app/Activity.java | |
| parent | 7d9605d7c1c8659f95904caf84cd143d14fa4ffe (diff) | |
| parent | 8693eabf20e798634427e812d69018232a926191 (diff) | |
Merge "API Update: extra_is_bubbled -> Activity#isLaunchedFromBubble" into sc-dev
Diffstat (limited to 'core/java/android/app/Activity.java')
| -rw-r--r-- | core/java/android/app/Activity.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index f0d5a893bb96..45120b694b62 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -899,6 +899,9 @@ public class Activity extends ContextThemeWrapper /** The options for scene transition. */ ActivityOptions mPendingOptions; + /** Whether this activity was launched from a bubble. **/ + boolean mLaunchedFromBubble; + private static final class ManagedCursor { ManagedCursor(Cursor cursor) { mCursor = cursor; @@ -6790,6 +6793,25 @@ public class Activity extends ContextThemeWrapper return getSharedPreferences(getLocalClassName(), mode); } + /** + * Indicates whether this activity is launched from a bubble. A bubble is a floating shortcut + * on the screen that expands to show an activity. + * + * If your activity can be used normally or as a bubble, you might use this method to check + * if the activity is bubbled to modify any behaviour that might be different between the + * normal activity and the bubbled activity. For example, if you normally cancel the + * notification associated with the activity when you open the activity, you might not want to + * do that when you're bubbled as that would remove the bubble. + * + * @return {@code true} if the activity is launched from a bubble. + * + * @see Notification.Builder#setBubbleMetadata(Notification.BubbleMetadata) + * @see Notification.BubbleMetadata.Builder#Builder(String) + */ + public boolean isLaunchedFromBubble() { + return mLaunchedFromBubble; + } + private void ensureSearchManager() { if (mSearchManager != null) { return; |
