diff options
| author | 2023-01-30 14:00:30 -0800 | |
|---|---|---|
| committer | 2023-01-31 12:47:26 -0800 | |
| commit | 545db773d14a92af7c5f19cfb8f5b2228d238591 (patch) | |
| tree | 880fcd60d577bc7975442e2c2ae309a4cae9e103 | |
| parent | 796e1c4c3700936ab8c017b982e603ca3181973a (diff) | |
Create TaskOperations when shell transition is off
Legacy captions need to work without shell transitions as of now.
Desktop mode captions don't need to work without shell transitions.
Bug: 267220928
Test: SystemUI stopped crashing.
Change-Id: I92e26d115ec95de0a46416a26150f606c341aba3
2 files changed, 6 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java index 476a7ec0fdc2..2981f5e160f6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java @@ -36,6 +36,7 @@ import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; +import com.android.wm.shell.transition.Transitions; /** * View model for the window decoration with a caption and shadows. Works with @@ -65,6 +66,9 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel { mTaskOrganizer = taskOrganizer; mDisplayController = displayController; mSyncQueue = syncQueue; + if (!Transitions.ENABLE_SHELL_TRANSITIONS) { + mTaskOperations = new TaskOperations(null, mContext, mSyncQueue); + } } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java index 907977c661f8..3734487e8f4b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecorViewModel.java @@ -29,7 +29,8 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; */ public interface WindowDecorViewModel { /** - * Sets the transition starter that starts freeform task transitions. + * Sets the transition starter that starts freeform task transitions. Only called when + * {@link com.android.wm.shell.transition.Transitions#ENABLE_SHELL_TRANSITIONS} is {@code true}. * * @param transitionStarter the transition starter that starts freeform task transitions */ |