From f363dfd26c304bca33f12065a9ed3de291193962 Mon Sep 17 00:00:00 2001 From: Johan Viktorsson Date: Thu, 16 Feb 2012 17:05:16 +0100 Subject: 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 --- services/java/com/android/server/am/ActivityStack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 9171e47..b9e63b7 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -2762,7 +2762,8 @@ final class ActivityStack { // 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) { -- cgit v1.1