Merge "Enable flagging shortcut with additional activity flags" into tm-qpr-dev am: 4a0e698b68
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21013716 Change-Id: I9dee161473001f64346836c36e9efa9b1cb9c133 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -326,6 +326,13 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
private static final String KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES =
|
private static final String KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES =
|
||||||
"android:activity.applyActivityFlagsForBubbles";
|
"android:activity.applyActivityFlagsForBubbles";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates to apply {@link Intent#FLAG_ACTIVITY_MULTIPLE_TASK} to the launching shortcut.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
private static final String KEY_APPLY_MULTIPLE_TASK_FLAG_FOR_SHORTCUT =
|
||||||
|
"android:activity.applyMultipleTaskFlagForShortcut";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For Activity transitions, the calling Activity's TransitionListener used to
|
* For Activity transitions, the calling Activity's TransitionListener used to
|
||||||
* notify the called Activity when the shared element and the exit transitions
|
* notify the called Activity when the shared element and the exit transitions
|
||||||
@@ -459,6 +466,7 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
private boolean mLockTaskMode = false;
|
private boolean mLockTaskMode = false;
|
||||||
private boolean mDisallowEnterPictureInPictureWhileLaunching;
|
private boolean mDisallowEnterPictureInPictureWhileLaunching;
|
||||||
private boolean mApplyActivityFlagsForBubbles;
|
private boolean mApplyActivityFlagsForBubbles;
|
||||||
|
private boolean mApplyMultipleTaskFlagForShortcut;
|
||||||
private boolean mTaskAlwaysOnTop;
|
private boolean mTaskAlwaysOnTop;
|
||||||
private boolean mTaskOverlay;
|
private boolean mTaskOverlay;
|
||||||
private boolean mTaskOverlayCanResume;
|
private boolean mTaskOverlayCanResume;
|
||||||
@@ -1258,6 +1266,8 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false);
|
KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false);
|
||||||
mApplyActivityFlagsForBubbles = opts.getBoolean(
|
mApplyActivityFlagsForBubbles = opts.getBoolean(
|
||||||
KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, false);
|
KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, false);
|
||||||
|
mApplyMultipleTaskFlagForShortcut = opts.getBoolean(
|
||||||
|
KEY_APPLY_MULTIPLE_TASK_FLAG_FOR_SHORTCUT, false);
|
||||||
if (opts.containsKey(KEY_ANIM_SPECS)) {
|
if (opts.containsKey(KEY_ANIM_SPECS)) {
|
||||||
Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS);
|
Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS);
|
||||||
mAnimSpecs = new AppTransitionAnimationSpec[specs.length];
|
mAnimSpecs = new AppTransitionAnimationSpec[specs.length];
|
||||||
@@ -1844,6 +1854,16 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
return mApplyActivityFlagsForBubbles;
|
return mApplyActivityFlagsForBubbles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
public void setApplyMultipleTaskFlagForShortcut(boolean apply) {
|
||||||
|
mApplyMultipleTaskFlagForShortcut = apply;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
public boolean isApplyMultipleTaskFlagForShortcut() {
|
||||||
|
return mApplyMultipleTaskFlagForShortcut;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a launch cookie that can be used to track the activity and task that are launch as a
|
* Sets a launch cookie that can be used to track the activity and task that are launch as a
|
||||||
* result of this option. If the launched activity is a trampoline that starts another activity
|
* result of this option. If the launched activity is a trampoline that starts another activity
|
||||||
@@ -2175,6 +2195,10 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
if (mApplyActivityFlagsForBubbles) {
|
if (mApplyActivityFlagsForBubbles) {
|
||||||
b.putBoolean(KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, mApplyActivityFlagsForBubbles);
|
b.putBoolean(KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, mApplyActivityFlagsForBubbles);
|
||||||
}
|
}
|
||||||
|
if (mApplyMultipleTaskFlagForShortcut) {
|
||||||
|
b.putBoolean(KEY_APPLY_MULTIPLE_TASK_FLAG_FOR_SHORTCUT,
|
||||||
|
mApplyMultipleTaskFlagForShortcut);
|
||||||
|
}
|
||||||
if (mAnimSpecs != null) {
|
if (mAnimSpecs != null) {
|
||||||
b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs);
|
b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1114,12 +1114,16 @@ public class LauncherAppsService extends SystemService {
|
|||||||
|
|
||||||
// Flag for bubble
|
// Flag for bubble
|
||||||
ActivityOptions options = ActivityOptions.fromBundle(startActivityOptions);
|
ActivityOptions options = ActivityOptions.fromBundle(startActivityOptions);
|
||||||
if (options != null && options.isApplyActivityFlagsForBubbles()) {
|
if (options != null) {
|
||||||
|
if (options.isApplyActivityFlagsForBubbles()) {
|
||||||
// Flag for bubble to make behaviour match documentLaunchMode=always.
|
// Flag for bubble to make behaviour match documentLaunchMode=always.
|
||||||
intents[0].addFlags(FLAG_ACTIVITY_NEW_DOCUMENT);
|
intents[0].addFlags(FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
|
intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
}
|
}
|
||||||
|
if (options.isApplyMultipleTaskFlagForShortcut()) {
|
||||||
|
intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
|
}
|
||||||
|
}
|
||||||
intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intents[0].setSourceBounds(sourceBounds);
|
intents[0].setSourceBounds(sourceBounds);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user