summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ben Lin <linben@google.com> 2024-10-31 23:13:10 +0000
committer Ben Lin <linben@google.com> 2024-11-01 14:03:00 +0000
commitd0b23cfd2215f584d28baf0788c715c43136b6d0 (patch)
treec1fccc93c2ad2d5212c18a433b647a027e404210
parent3b816efa6ebde9f01b953041922df17c69e28933 (diff)
Don't allow app handle to be drawn for any task w/ default home package.
If there's a task that's of the default home launcher package, let's not draw the app handle. Although we have ACTIVITY_HOME to guard against general launcher activity already, there are other activities (e.g. ProxyActivityStarter) in the package that we don't want to enter freeform. Bug: 365023423 Test: no longer seeing app handle when launching widget settings Flag: EXEMPT bugfix Change-Id: I33ab6f3d4198d3c531d4323712ae8bdc2672de01
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index 29b8ddd03970..6b884c518ac3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -49,6 +49,7 @@ import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityTaskManager;
import android.app.IActivityManager;
import android.app.IActivityTaskManager;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
@@ -1474,6 +1475,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
&& isTopActivityExemptFromDesktopWindowing(mContext, taskInfo)) {
return false;
}
+ if (isPartOfDefaultHomePackage(taskInfo)) {
+ return false;
+ }
return DesktopModeStatus.canEnterDesktopMode(mContext)
&& !DesktopWallpaperActivity.isWallpaperTask(taskInfo)
&& taskInfo.getWindowingMode() != WINDOWING_MODE_PINNED
@@ -1481,6 +1485,14 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
&& !taskInfo.configuration.windowConfiguration.isAlwaysOnTop();
}
+ private boolean isPartOfDefaultHomePackage(RunningTaskInfo taskInfo) {
+ final ComponentName currentDefaultHome =
+ mContext.getPackageManager().getHomeActivities(new ArrayList<>());
+ return currentDefaultHome != null && taskInfo.baseActivity != null
+ && currentDefaultHome.getPackageName()
+ .equals(taskInfo.baseActivity.getPackageName());
+ }
+
private void createWindowDecoration(
ActivityManager.RunningTaskInfo taskInfo,
SurfaceControl taskSurface,