Merge "Avoid creating new instance on top when started for result in some cases"
This commit is contained in:
committed by
Android (Google) Code Review
commit
305c7391cc
@@ -1813,12 +1813,12 @@ class ActivityStarter {
|
||||
*/
|
||||
private int deliverToCurrentTopIfNeeded(ActivityStack topStack) {
|
||||
final ActivityRecord top = topStack.topRunningNonDelayedActivityLocked(mNotTop);
|
||||
final boolean dontStart = top != null && mStartActivity.resultTo == null
|
||||
final boolean dontStart = top != null
|
||||
&& top.mActivityComponent.equals(mStartActivity.mActivityComponent)
|
||||
&& top.mUserId == mStartActivity.mUserId
|
||||
&& top.attachedToProcess()
|
||||
&& ((mLaunchFlags & FLAG_ACTIVITY_SINGLE_TOP) != 0
|
||||
|| isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK))
|
||||
|| isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK))
|
||||
// This allows home activity to automatically launch on secondary display when
|
||||
// display added, if home was the top activity on default display, instead of
|
||||
// sending new intent to the home activity on default display.
|
||||
@@ -2049,8 +2049,6 @@ class ActivityStarter {
|
||||
&& !isLaunchModeOneOf(LAUNCH_SINGLE_TASK, LAUNCH_SINGLE_INSTANCE)
|
||||
&& (mLaunchFlags & FLAG_ACTIVITY_NEW_DOCUMENT) != 0;
|
||||
|
||||
sendNewTaskResultRequestIfNeeded();
|
||||
|
||||
if ((mLaunchFlags & FLAG_ACTIVITY_NEW_DOCUMENT) != 0 && r.resultTo == null) {
|
||||
mLaunchFlags |= FLAG_ACTIVITY_NEW_TASK;
|
||||
}
|
||||
@@ -2232,6 +2230,8 @@ class ActivityStarter {
|
||||
mLaunchFlags |= FLAG_ACTIVITY_NEW_TASK;
|
||||
}
|
||||
}
|
||||
|
||||
sendNewTaskResultRequestIfNeeded();
|
||||
}
|
||||
|
||||
private void computeSourceStack() {
|
||||
|
||||
Reference in New Issue
Block a user