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

Commit c56cddb6 authored by Ben Lin's avatar Ben Lin
Browse files

Update WMWrapper when we get a new relayout call.

Or else previously we use the default WMWrapper (that has displayId
context = 0) and so the AppHandle input layer always get added to the
default display.

Bug: 397249815
Test: atest
Flag: com.android.window.flags.enable_bug_fixes_for_secondary_display
Change-Id: Iccf73790ca3be4bc8f922d399aa82b8be472210e
parent e98383ef
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -524,6 +524,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
            setCapturedLink(taskInfo.capturedLink, taskInfo.capturedLinkTimestamp);
        }

        if (DesktopExperienceFlags.ENABLE_BUG_FIXES_FOR_SECONDARY_DISPLAY.isTrue()) {
            final Context dc = mDisplayController.getDisplayContext(taskInfo.displayId);
            if (dc != null) {
                mWindowManagerWrapper.updateWindowManager(dc.getSystemService(WindowManager.class));
            }
        }

        if (isHandleMenuActive()) {
            mHandleMenu.relayout(
                    startT,
+5 −2
Original line number Diff line number Diff line
@@ -24,9 +24,8 @@ import android.view.WindowManager
 * decors more testable.
 */
class WindowManagerWrapper (
    private val windowManager: WindowManager
    private var windowManager: WindowManager
){

    fun addView(v: View, lp: WindowManager.LayoutParams) {
        windowManager.addView(v, lp)
    }
@@ -38,4 +37,8 @@ class WindowManagerWrapper (
    fun updateViewLayout(v: View, lp: WindowManager.LayoutParams) {
        windowManager.updateViewLayout(v, lp)
    }

    fun updateWindowManager(windowManager: WindowManager) {
        this.windowManager = windowManager
    }
}
 No newline at end of file