From 99b514acb193ac80e1b6a2ee82dd3eadff1c0631 Mon Sep 17 00:00:00 2001 From: Jeongeun Song Date: Thu, 15 Sep 2022 15:52:40 +0900 Subject: [PATCH] Resolve the home intent with MATCH_DEFAULT_ONLY When a 3rd party home app which doesn't have CATEGORY_DEFAULT and a user clicks the home button, the ResolverActivity always comes out even though the user clicked always on the ResolverActivity. This change adds MATCH_DEFAULT_ONLY while resolving the home intent by consolidating the intent resolving through ActivityTaskSupervisor#resolveIntent. Bug: 245383780 Test: Install a 3rd party home app without CATEGORY_DEFAULT and click the home button Change-Id: If24f8531aeb91f38e247ed396677f76c4a62c719 --- .../core/java/com/android/server/wm/RootWindowContainer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index b3f35487f3a5e..f66ba383b44fd 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -1487,8 +1487,8 @@ class RootWindowContainer extends WindowContainer } else { final String resolvedType = homeIntent.resolveTypeIfNeeded(mService.mContext.getContentResolver()); - final ResolveInfo info = AppGlobals.getPackageManager() - .resolveIntent(homeIntent, resolvedType, flags, userId); + final ResolveInfo info = mTaskSupervisor.resolveIntent(homeIntent, resolvedType, + userId, flags, Binder.getCallingUid()); if (info != null) { aInfo = info.activityInfo; }