Browse files

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
  • Loading branch information...
1 parent 3754899 commit f363dfd26c304bca33f12065a9ed3de291193962 Johan Viktorsson committed with kennethandersson Feb 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 services/java/com/android/server/am/ActivityStack.java
View
3 services/java/com/android/server/am/ActivityStack.java
@@ -2762,7 +2762,8 @@ final int startActivityUncheckedLocked(ActivityRecord r,
// If the top activity in the task is the root
// activity, deliver this new intent to it if it
// desires.
- if ((launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0
+ if (((launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0
+ || r.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP)
&& taskTop.realActivity.equals(r.realActivity)) {
logStartActivity(EventLogTags.AM_NEW_INTENT, r, taskTop.task);
if (taskTop.frontOfTask) {

0 comments on commit f363dfd

Please sign in to comment.