Merge "Fix not able to enter split screen with trampoline launch" into tm-qpr-dev
This commit is contained in:
@@ -2867,9 +2867,9 @@ class ActivityStarter {
|
||||
|
||||
if (differentTopTask && !mAvoidMoveToFront) {
|
||||
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
|
||||
if (mSourceRecord == null || (mSourceRootTask.getTopNonFinishingActivity() != null
|
||||
&& mSourceRootTask.getTopNonFinishingActivity().getTask()
|
||||
== mSourceRecord.getTask())) {
|
||||
// TODO(b/264487981): Consider using BackgroundActivityStartController to determine
|
||||
// whether to bring the launching activity to the front.
|
||||
if (mSourceRecord == null || inTopNonFinishingTask(mSourceRecord)) {
|
||||
// We really do want to push this one into the user's face, right now.
|
||||
if (mLaunchTaskBehind && mSourceRecord != null) {
|
||||
intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask());
|
||||
@@ -2928,6 +2928,20 @@ class ActivityStarter {
|
||||
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() {
|
||||
if (mDoResume) {
|
||||
final ActivityRecord next = mTargetRootTask.topRunningActivity(
|
||||
|
||||
Reference in New Issue
Block a user