From f3eb843665d0e52729a7063442f1c229568c3118 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 19 Sep 2014 17:21:46 -0700 Subject: [PATCH] Fix issue #17492300: NavUtils.shouldUpRecreateTask returns different... ...value in L Only do the new logic when the task is a document. Change-Id: I4664b94a3fe86ea266c2feb4e889c14c06751a15 --- services/core/java/com/android/server/am/ActivityStack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index a75fc5a012216..0646cce92c713 100755 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2856,7 +2856,8 @@ final class ActivityStack { // they need to re-create their task if this current activity is the root // of a document, unless simply finishing it will return them to the the // correct app behind. - if (srec.frontOfTask && srec.task != null) { + if (srec.frontOfTask && srec.task != null && srec.task.getBaseIntent() != null + && srec.task.getBaseIntent().isDocument()) { // Okay, this activity is at the root of its task. What to do, what to do... if (srec.task.getTaskToReturnTo() != ActivityRecord.APPLICATION_ACTIVITY_TYPE) { // Finishing won't return to an application, so we need to recreate.