From 547afd2dba285d57d8db1e3a4f038dba6d0fddcf Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 17 May 2018 16:03:25 -0700 Subject: [PATCH] Fix issue with home activity started with standard activity type - Specifically in the case where we have a merged Launcher+Recents activity and there is no default home activity set, allow the recents button handler to launch the merged home activity (in Overview mode) without showing a disambig dialog (by having the component set in the home intent) Bug: 79878243 Test: Disable swipe up (enable 3 button nav), launch an app, reinstall launcher in the background to remove the home stack, tap the recents button and ensure we launch home with ACTIVITY_TYPE_HOME. Change-Id: I4d114b7f474390dd6fe9bdadc58a399a2daf1b81 --- services/core/java/com/android/server/am/ActivityRecord.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index e73f42fa42645..ad96e44476550 100644 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -1077,6 +1077,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo // System process can launch home activity. return true; } + // Allow the recents component to launch the home activity. + final RecentTasks recentTasks = mStackSupervisor.mService.getRecentTasks(); + if (recentTasks != null && recentTasks.isCallerRecents(uid)) { + return true; + } // Resolver activity can launch home activity. return sourceRecord != null && sourceRecord.isResolverActivity(); }