Merge "Moves the task to front if it is different from the top task" into main
This commit is contained in:
commit
0dd9152868
@ -2767,10 +2767,7 @@ class ActivityStarter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the target task is not in the front, then we need to bring it to the front...
|
// If the target task is not in the front, then we need to bring it to the front.
|
||||||
// except... well, with SINGLE_TASK_LAUNCH it's not entirely clear. We'd like to have
|
|
||||||
// the same behavior as if a new instance was being started, which means not bringing it
|
|
||||||
// to the front if the caller is not itself in the front.
|
|
||||||
final boolean differentTopTask;
|
final boolean differentTopTask;
|
||||||
if (mTargetRootTask.getDisplayArea() == mPreferredTaskDisplayArea) {
|
if (mTargetRootTask.getDisplayArea() == mPreferredTaskDisplayArea) {
|
||||||
final Task focusRootTask = mTargetRootTask.mDisplayContent.getFocusedRootTask();
|
final Task focusRootTask = mTargetRootTask.mDisplayContent.getFocusedRootTask();
|
||||||
@ -2787,7 +2784,6 @@ class ActivityStarter {
|
|||||||
|
|
||||||
if (differentTopTask && !avoidMoveToFront()) {
|
if (differentTopTask && !avoidMoveToFront()) {
|
||||||
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
|
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
|
||||||
if (mSourceRecord == null || inTopNonFinishingTask(mSourceRecord)) {
|
|
||||||
// We really do want to push this one into the user's face, right now.
|
// We really do want to push this one into the user's face, right now.
|
||||||
if (mLaunchTaskBehind && mSourceRecord != null) {
|
if (mLaunchTaskBehind && mSourceRecord != null) {
|
||||||
intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask());
|
intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask());
|
||||||
@ -2830,7 +2826,6 @@ class ActivityStarter {
|
|||||||
}
|
}
|
||||||
mOptions = null;
|
mOptions = null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (differentTopTask) {
|
if (differentTopTask) {
|
||||||
logPIOnlyCreatorAllowsBAL();
|
logPIOnlyCreatorAllowsBAL();
|
||||||
}
|
}
|
||||||
@ -2850,20 +2845,6 @@ class ActivityStarter {
|
|||||||
mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetRootTask);
|
mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetRootTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean inTopNonFinishingTask(ActivityRecord r) {
|
|
||||||
if (r == null || r.getTask() == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Task rTask = r.getTask();
|
|
||||||
final Task parent = rTask.getCreatedByOrganizerTask() != null
|
|
||||||
? rTask.getCreatedByOrganizerTask() : r.getRootTask();
|
|
||||||
final ActivityRecord topNonFinishingActivity = parent != null
|
|
||||||
? parent.getTopNonFinishingActivity() : null;
|
|
||||||
|
|
||||||
return topNonFinishingActivity != null && topNonFinishingActivity.getTask() == rTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resumeTargetRootTaskIfNeeded() {
|
private void resumeTargetRootTaskIfNeeded() {
|
||||||
if (mDoResume) {
|
if (mDoResume) {
|
||||||
final ActivityRecord next = mTargetRootTask.topRunningActivity(
|
final ActivityRecord next = mTargetRootTask.topRunningActivity(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user