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

Commit 6e139493 authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Modify EmbeddedWindow InputTarget to work with IME

EmbeddedWindow implements InputTarget to allow IME to work for embedded
windows. However, a few methods need to be modified to allow IME to
work.

1. shouldControlIme should return true if there's a host WindowState.
   This doesn't meant the embedded window will control the IME, but
   rather the host for embedded will control the IME. This is needed
   to ensure the IME is reparented to the correct Activity and uses
   the parent WindowState to when determining inset controller.

2. getImeControlTarget should return the host WindowState's control
   target. This ensures the IME has the correct target information and
   not the fallback.

3. getActivityRecord should return the host ActivityRecord. This tells
   IME where to reparent the layer so it's a child of the
   ActivityRecord. Othewise, the IME layer is left where it was
   previously.

Test: SurfaceControlViewHostTests
Bug: 230340812
Change-Id: I8407c3ec7ed6372ed3484f25117db45944855a22
parent 13f25d78
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ class EmbeddedWindowController {

        @Override
        public boolean shouldControlIme() {
            return false;
            return mHostWindowState != null;
        }

        @Override
@@ -336,6 +336,9 @@ class EmbeddedWindowController {

        @Override
        public InsetsControlTarget getImeControlTarget() {
            if (mHostWindowState != null) {
                return mHostWindowState.getImeControlTarget();
            }
            return mWmService.getDefaultDisplayContentLocked().mRemoteInsetsControlTarget;
        }

@@ -346,7 +349,7 @@ class EmbeddedWindowController {

        @Override
        public ActivityRecord getActivityRecord() {
            return null;
            return mHostActivityRecord;
        }

        @Override