Make documentLaunchMode="never" activity don’t create task

Activity that specify “documentLaunchMode="never" should not launched
into a new document even if the Intent contains
FLAG_ACTIVITY_NEW_DOCUMENT.

This CL overrides the behavior of the FLAG_ACTIVITY_NEW_DOCUMENT and
FLAG_ACTIVITY_MULTIPLE_TASK flags to make the definition consistent
with documentation.

Bug: 113840793
Test: atest IntentTests
Change-Id: I9b96e7fe0306d54b8f833873bcad8e0508dd3aa8
This commit is contained in:
Jeff Chang
2021-03-04 12:09:13 +08:00
parent 02073550c0
commit 72470f011b

View File

@@ -2691,7 +2691,8 @@ class ActivityStarter {
launchFlags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
break;
case ActivityInfo.DOCUMENT_LAUNCH_NEVER:
launchFlags &= ~FLAG_ACTIVITY_MULTIPLE_TASK;
launchFlags &=
~(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | FLAG_ACTIVITY_MULTIPLE_TASK);
break;
}
}