Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d5d89ad authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Support common methods of caption window decoration in wrapper

Avoid crashing when using caption window decoration.

Bug: 409648813
Flag: com.android.window.flags.enable_window_decoration_refactor
Test: Enable non-desktop freeform mode.
      Drag to resize a freeform task.
      No exception from onDragPositioningStart
       -> mWindowDecoration.getDisplay()
Change-Id: I2e1a9a99b85589ebd8008588ba5cdb15ca5d7f2e
parent 15cce63c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ private constructor(
            when {
                defaultWindowDecor != null -> requireDefaultWindowDecor().taskSurface
                desktopWindowDecor != null -> requireDesktopWindowDecor().mTaskSurface
                captionWindowDecoration != null -> requireCaptionWindowDecor().mTaskSurface
                else -> error("Expected Non-null window decoration")
            }

@@ -85,6 +86,7 @@ private constructor(
            when {
                defaultWindowDecor != null -> requireDefaultWindowDecor().user
                desktopWindowDecor != null -> requireDesktopWindowDecor().user
                captionWindowDecoration != null -> requireCaptionWindowDecor().mUserContext.user
                else -> error("Expected Non-null default or desktop window decoration")
            }

@@ -114,6 +116,7 @@ private constructor(
            when {
                defaultWindowDecor != null -> requireDefaultWindowDecor().display
                desktopWindowDecor != null -> requireDesktopWindowDecor().mDisplay
                captionWindowDecoration != null -> requireCaptionWindowDecor().mDisplay
                else -> error("Expected Non-null default or desktop window decoration")
            }

@@ -133,6 +136,7 @@ private constructor(
            when {
                defaultWindowDecor != null -> requireDefaultWindowDecor().context
                desktopWindowDecor != null -> requireDesktopWindowDecor().mContext
                captionWindowDecoration != null -> requireCaptionWindowDecor().mContext
                else -> error("Expected Non-null default or desktop window decoration")
            }

@@ -142,6 +146,7 @@ private constructor(
            when {
                defaultWindowDecor != null -> requireDefaultWindowDecor().hasGlobalFocus
                desktopWindowDecor != null -> requireDesktopWindowDecor().isFocused
                captionWindowDecoration != null -> requireCaptionWindowDecor().mHasGlobalFocus
                else -> error("Expected Non-null default or desktop window decoration")
            }