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) {
|
if (differentTopTask && !mAvoidMoveToFront) {
|
||||||
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
|
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
|
||||||
if (mSourceRecord == null || (mSourceRootTask.getTopNonFinishingActivity() != null
|
// TODO(b/264487981): Consider using BackgroundActivityStartController to determine
|
||||||
&& mSourceRootTask.getTopNonFinishingActivity().getTask()
|
// whether to bring the launching activity to the front.
|
||||||
== mSourceRecord.getTask())) {
|
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());
|
||||||
@@ -2928,6 +2928,20 @@ 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(
|
||||||
|
|||||||
Reference in New Issue
Block a user