diff options
| author | 2024-11-04 19:51:08 +0000 | |
|---|---|---|
| committer | 2024-11-04 19:51:08 +0000 | |
| commit | fafc8aadbb863ac7412f7b8facd591d2c2b9e66d (patch) | |
| tree | b695c0a63d272d7f2463614082661bdecf7088a7 | |
| parent | e0a5ac004948535d0449e32e1dc5ccce330cebc2 (diff) | |
| parent | d0b23cfd2215f584d28baf0788c715c43136b6d0 (diff) | |
Merge "Don't allow app handle to be drawn for any task w/ default home package." into main
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java | 12 |
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 4d4bd530079b..3adcdee3f9b4 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 @@ -48,6 +48,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; @@ -1467,6 +1468,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 @@ -1474,6 +1478,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, |