diff options
| author | Mady Mellor <madym@google.com> | 2020-04-10 21:17:30 -0700 |
|---|---|---|
| committer | Mady Mellor <madym@google.com> | 2020-04-28 13:24:03 -0700 |
| commit | 80d5ed1473a1c0b3ed4be6be99564f215df58dd4 (patch) | |
| tree | bfdab91aed6330591bdcb7bcaf7bf45a77c987cc /core/java/android/app/ActivityOptions.java | |
| parent | 920cd50f5ca198543bed5608747043677be69a4f (diff) | |
Enable flagging shortcuts to launch properly in a bubble
For things to work correctly in a bubble they must be
flagged to behave as documentLaunchMode=always
Test: atest NotificationManagerTest
Bug: 150719933
Change-Id: Ic5680c40fd2cbf0e9d0809a0a87a166f1e328c74
Diffstat (limited to 'core/java/android/app/ActivityOptions.java')
| -rw-r--r-- | core/java/android/app/ActivityOptions.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index 0129aabd49f8..80d2e6c60f69 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -266,6 +266,14 @@ public class ActivityOptions { "android:activity.disallowEnterPictureInPictureWhileLaunching"; /** + * Indicates flags should be applied to the launching activity such that it will behave + * correctly in a bubble. + * @hide + */ + private static final String KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES = + "android:activity.applyActivityFlagsForBubbles"; + + /** * For Activity transitions, the calling Activity's TransitionListener used to * notify the called Activity when the shared element and the exit transitions * complete. @@ -354,6 +362,7 @@ public class ActivityOptions { private int mSplitScreenCreateMode = SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT; private boolean mLockTaskMode = false; private boolean mDisallowEnterPictureInPictureWhileLaunching; + private boolean mApplyActivityFlagsForBubbles; private boolean mTaskAlwaysOnTop; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; @@ -1033,6 +1042,8 @@ public class ActivityOptions { SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT); mDisallowEnterPictureInPictureWhileLaunching = opts.getBoolean( KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false); + mApplyActivityFlagsForBubbles = opts.getBoolean( + KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, false); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); mAnimSpecs = new AppTransitionAnimationSpec[specs.length]; @@ -1465,6 +1476,16 @@ public class ActivityOptions { return mDisallowEnterPictureInPictureWhileLaunching; } + /** @hide */ + public void setApplyActivityFlagsForBubbles(boolean apply) { + mApplyActivityFlagsForBubbles = apply; + } + + /** @hide */ + public boolean isApplyActivityFlagsForBubbles() { + return mApplyActivityFlagsForBubbles; + } + /** * Update the current values in this ActivityOptions from those supplied * in <var>otherOptions</var>. Any values @@ -1663,6 +1684,9 @@ public class ActivityOptions { b.putBoolean(KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, mDisallowEnterPictureInPictureWhileLaunching); } + if (mApplyActivityFlagsForBubbles) { + b.putBoolean(KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, mApplyActivityFlagsForBubbles); + } if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); } |
