Skip to content

Commit f363dfd

Browse files
Johan ViktorssonKenneth Andersson
authored andcommitted
Added check of ActivityInfo launch mode when starting activity.
When starting a singleTop activity from a singleInstance activity, the onNewIntent() callback was not called when expected. The reason for this was that only the launchMode specified on the intent was checked and not the launchMode specified in the manifest. Fixes issue 17137. Change-Id: I1a9bc1007d6f5145bf93a6161534732bf5214b7a
1 parent 3754899 commit f363dfd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/java/com/android/server/am/ActivityStack.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,8 @@ final int startActivityUncheckedLocked(ActivityRecord r,
27622762
// If the top activity in the task is the root
27632763
// activity, deliver this new intent to it if it
27642764
// desires.
2765-
if ((launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0
2765+
if (((launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0
2766+
|| r.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP)
27662767
&& taskTop.realActivity.equals(r.realActivity)) {
27672768
logStartActivity(EventLogTags.AM_NEW_INTENT, r, taskTop.task);
27682769
if (taskTop.frontOfTask) {

0 commit comments

Comments
 (0)