From 72470f011b057eeb89894e45527b7cc09d2e5b36 Mon Sep 17 00:00:00 2001 From: Jeff Chang Date: Thu, 4 Mar 2021 12:09:13 +0800 Subject: [PATCH] =?UTF-8?q?Make=20documentLaunchMode=3D"never"=20activity?= =?UTF-8?q?=20don=E2=80=99t=20create=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- services/core/java/com/android/server/wm/ActivityStarter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 6ce9048d79e29..0bc67b9f18716 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -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; } }