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
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index e73f42f..ad96e44 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 @@
// 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();
}