Loading core/java/android/window/ITaskOrganizerController.aidl +20 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.window.ITaskOrganizer; import android.window.TaskAppearedInfo; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import android.view.SurfaceControl; /** @hide */ interface ITaskOrganizerController { Loading Loading @@ -69,4 +70,23 @@ interface ITaskOrganizerController { * Restarts the top activity in the given task by killing its process if it is visible. */ void restartTaskTopActivityProcessIfVisible(in WindowContainerToken task); /** * Set layers to be excluded when taking a task snapshot. * * Warning: MUST NOT pass layers that are managed by the Window Manager (e.g., from a Task or * Activity). Doing so may cause the corresponding layer to be destroyed when * clearExcludeLayersFromTaskSnapshot is called. */ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.MANAGE_ACTIVITY_TASKS)") void setExcludeLayersFromTaskSnapshot(in WindowContainerToken task, in SurfaceControl[] layers); /** * Clears all layers that were registered for exclusion via setExcludeLayersFromTaskSnapshot. */ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.MANAGE_ACTIVITY_TASKS)") void clearExcludeLayersFromTaskSnapshot(in WindowContainerToken task); } core/java/android/window/TaskOrganizer.java +31 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,37 @@ public class TaskOrganizer extends WindowOrganizer { } } /** * Set layers to be excluded when taking a task snapshot. * * Warning: MUST NOT pass layers that are managed by the Window Manager (e.g., from a Task or * Activity). Doing so may cause the corresponding layer to be destroyed when * clearExcludeLayersFromTaskSnapshot is called. * @hide */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public void setExcludeLayersFromTaskSnapshot(@NonNull WindowContainerToken task, SurfaceControl[] layers) { try { mTaskOrganizerController.setExcludeLayersFromTaskSnapshot(task, layers); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Clears all layers that were set for exclusion via setExcludeLayersFromTaskSnapshot. * @hide */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public void clearExcludeLayersFromTaskSnapshot(@NonNull WindowContainerToken task) { try { mTaskOrganizerController.clearExcludeLayersFromTaskSnapshot(task); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the executor to run callbacks on. * @hide Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,6 @@ import java.util.function.BiFunction; public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearLayout> { private final Handler mHandler; private final @ShellMainThread ShellExecutor mMainExecutor; private final @ShellBackgroundThread ShellExecutor mBgExecutor; private final Choreographer mChoreographer; private final SyncTransactionQueue mSyncQueue; private final DesktopConfig mDesktopConfig; Loading Loading @@ -111,10 +110,9 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL @NonNull WindowDecorViewHostSupplier<WindowDecorViewHost> windowDecorViewHostSupplier, DesktopConfig desktopConfig) { super(context, handler, transitions, userContext, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorViewHostSupplier); taskInfo, taskSurface, windowDecorViewHostSupplier, bgExecutor); mHandler = handler; mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mChoreographer = choreographer; mSyncQueue = syncQueue; mDesktopConfig = desktopConfig; Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CarWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import com.android.wm.shell.windowdecor.common.viewhost.WindowDecorViewHostSuppl */ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayout> { private WindowDecorLinearLayout mRootView; private @ShellBackgroundThread final ShellExecutor mBgExecutor; private final View.OnClickListener mClickListener; private final RelayoutParams mRelayoutParams = new RelayoutParams(); private final RelayoutResult<WindowDecorLinearLayout> mResult = new RelayoutResult<>(); Loading @@ -66,8 +65,7 @@ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayou WindowDecorViewHostSupplier<WindowDecorViewHost> windowDecorViewHostSupplier, View.OnClickListener clickListener) { super(context, handler, transitions, userContext, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorViewHostSupplier); mBgExecutor = bgExecutor; taskInfo, taskSurface, windowDecorViewHostSupplier, bgExecutor); mClickListener = clickListener; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -159,7 +159,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final @ShellMainThread MainCoroutineDispatcher mMainDispatcher; private final @ShellMainThread CoroutineScope mMainScope; private final @ShellBackgroundThread CoroutineScope mBgScope; private final @ShellBackgroundThread ShellExecutor mBgExecutor; private final Transitions mTransitions; private final Choreographer mChoreographer; private final SyncTransactionQueue mSyncQueue; Loading Loading @@ -335,14 +334,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin taskInfo, taskSurface, surfaceControlBuilderSupplier, surfaceControlTransactionSupplier, windowContainerTransactionSupplier, surfaceControlSupplier, surfaceControlViewHostFactory, windowDecorViewHostSupplier, desktopModeEventLogger); desktopModeEventLogger, bgExecutor); mSplitScreenController = splitScreenController; mHandler = handler; mMainExecutor = mainExecutor; mMainDispatcher = mainDispatcher; mMainScope = mainScope; mBgScope = bgScope; mBgExecutor = bgExecutor; mTransitions = transitions; mChoreographer = choreographer; mSyncQueue = syncQueue; Loading Loading
core/java/android/window/ITaskOrganizerController.aidl +20 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.window.ITaskOrganizer; import android.window.TaskAppearedInfo; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import android.view.SurfaceControl; /** @hide */ interface ITaskOrganizerController { Loading Loading @@ -69,4 +70,23 @@ interface ITaskOrganizerController { * Restarts the top activity in the given task by killing its process if it is visible. */ void restartTaskTopActivityProcessIfVisible(in WindowContainerToken task); /** * Set layers to be excluded when taking a task snapshot. * * Warning: MUST NOT pass layers that are managed by the Window Manager (e.g., from a Task or * Activity). Doing so may cause the corresponding layer to be destroyed when * clearExcludeLayersFromTaskSnapshot is called. */ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.MANAGE_ACTIVITY_TASKS)") void setExcludeLayersFromTaskSnapshot(in WindowContainerToken task, in SurfaceControl[] layers); /** * Clears all layers that were registered for exclusion via setExcludeLayersFromTaskSnapshot. */ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.MANAGE_ACTIVITY_TASKS)") void clearExcludeLayersFromTaskSnapshot(in WindowContainerToken task); }
core/java/android/window/TaskOrganizer.java +31 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,37 @@ public class TaskOrganizer extends WindowOrganizer { } } /** * Set layers to be excluded when taking a task snapshot. * * Warning: MUST NOT pass layers that are managed by the Window Manager (e.g., from a Task or * Activity). Doing so may cause the corresponding layer to be destroyed when * clearExcludeLayersFromTaskSnapshot is called. * @hide */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public void setExcludeLayersFromTaskSnapshot(@NonNull WindowContainerToken task, SurfaceControl[] layers) { try { mTaskOrganizerController.setExcludeLayersFromTaskSnapshot(task, layers); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Clears all layers that were set for exclusion via setExcludeLayersFromTaskSnapshot. * @hide */ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public void clearExcludeLayersFromTaskSnapshot(@NonNull WindowContainerToken task) { try { mTaskOrganizerController.clearExcludeLayersFromTaskSnapshot(task); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the executor to run callbacks on. * @hide Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,6 @@ import java.util.function.BiFunction; public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearLayout> { private final Handler mHandler; private final @ShellMainThread ShellExecutor mMainExecutor; private final @ShellBackgroundThread ShellExecutor mBgExecutor; private final Choreographer mChoreographer; private final SyncTransactionQueue mSyncQueue; private final DesktopConfig mDesktopConfig; Loading Loading @@ -111,10 +110,9 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL @NonNull WindowDecorViewHostSupplier<WindowDecorViewHost> windowDecorViewHostSupplier, DesktopConfig desktopConfig) { super(context, handler, transitions, userContext, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorViewHostSupplier); taskInfo, taskSurface, windowDecorViewHostSupplier, bgExecutor); mHandler = handler; mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mChoreographer = choreographer; mSyncQueue = syncQueue; mDesktopConfig = desktopConfig; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CarWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import com.android.wm.shell.windowdecor.common.viewhost.WindowDecorViewHostSuppl */ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayout> { private WindowDecorLinearLayout mRootView; private @ShellBackgroundThread final ShellExecutor mBgExecutor; private final View.OnClickListener mClickListener; private final RelayoutParams mRelayoutParams = new RelayoutParams(); private final RelayoutResult<WindowDecorLinearLayout> mResult = new RelayoutResult<>(); Loading @@ -66,8 +65,7 @@ public class CarWindowDecoration extends WindowDecoration<WindowDecorLinearLayou WindowDecorViewHostSupplier<WindowDecorViewHost> windowDecorViewHostSupplier, View.OnClickListener clickListener) { super(context, handler, transitions, userContext, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorViewHostSupplier); mBgExecutor = bgExecutor; taskInfo, taskSurface, windowDecorViewHostSupplier, bgExecutor); mClickListener = clickListener; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +1 −3 Original line number Diff line number Diff line Loading @@ -159,7 +159,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final @ShellMainThread MainCoroutineDispatcher mMainDispatcher; private final @ShellMainThread CoroutineScope mMainScope; private final @ShellBackgroundThread CoroutineScope mBgScope; private final @ShellBackgroundThread ShellExecutor mBgExecutor; private final Transitions mTransitions; private final Choreographer mChoreographer; private final SyncTransactionQueue mSyncQueue; Loading Loading @@ -335,14 +334,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin taskInfo, taskSurface, surfaceControlBuilderSupplier, surfaceControlTransactionSupplier, windowContainerTransactionSupplier, surfaceControlSupplier, surfaceControlViewHostFactory, windowDecorViewHostSupplier, desktopModeEventLogger); desktopModeEventLogger, bgExecutor); mSplitScreenController = splitScreenController; mHandler = handler; mMainExecutor = mainExecutor; mMainDispatcher = mainDispatcher; mMainScope = mainScope; mBgScope = bgScope; mBgExecutor = bgExecutor; mTransitions = transitions; mChoreographer = choreographer; mSyncQueue = syncQueue; Loading