Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −8 Original line number Diff line number Diff line Loading @@ -3506,22 +3506,21 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo * doesn't support IME/system decorations. * * @param target current IME target. * @return {@link WindowState} that can host IME. * @return {@link InsetsControlTarget} that can host IME. */ WindowState getImeHostOrFallback(WindowState target) { InsetsControlTarget getImeHostOrFallback(WindowState target) { if (target != null && target.getDisplayContent().canShowIme()) { return target; } return getImeFallback(); } WindowState getImeFallback() { InsetsControlTarget getImeFallback() { // host is in non-default display that doesn't support system decor, default to // default display's StatusBar to control IME. // TODO: (b/148234093)find a better host OR control IME animation/visibility directly // because it won't work when statusbar isn't available. return mWmService.getDefaultDisplayContentLocked().getDisplayPolicy().getStatusBar(); // default display's StatusBar to control IME (when available), else let system control it. WindowState statusBar = mWmService.getDefaultDisplayContentLocked().getDisplayPolicy().getStatusBar(); return statusBar != null ? statusBar : mRemoteInsetsControlTarget; } boolean canShowIme() { Loading services/core/java/com/android/server/wm/WindowManagerService.java +9 −3 Original line number Diff line number Diff line Loading @@ -7623,8 +7623,12 @@ public class WindowManagerService extends IWindowManager.Stub if (imeTarget == null) { return; } imeTarget = imeTarget.getImeControlTarget(); imeTarget.getDisplayContent().getInsetsStateController().getImeSourceProvider() imeTarget = imeTarget.getImeControlTarget().getWindow(); // If InsetsControlTarget doesn't have a window, its using remoteControlTarget which // is controlled by default display final DisplayContent dc = imeTarget != null ? imeTarget.getDisplayContent() : getDefaultDisplayContentLocked(); dc.getInsetsStateController().getImeSourceProvider() .scheduleShowImePostLayout(imeTarget); } } Loading @@ -7637,7 +7641,9 @@ public class WindowManagerService extends IWindowManager.Stub // The target window no longer exists. return; } final DisplayContent dc = imeTarget.getImeControlTarget().getDisplayContent(); imeTarget = imeTarget.getImeControlTarget().getWindow(); final DisplayContent dc = imeTarget != null ? imeTarget.getDisplayContent() : getDefaultDisplayContentLocked(); // If there was a pending IME show(), reset it as IME has been // requested to be hidden. dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout(); Loading services/core/java/com/android/server/wm/WindowState.java +2 −2 Original line number Diff line number Diff line Loading @@ -5404,10 +5404,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP * {@link android.view.inputmethod.InputMethodManager#showSoftInput(View, int)} is unknown, * use {@link DisplayContent#getImeControlTarget()} instead. * * @return {@link WindowState} of host that controls the IME. * @return {@link InsetsControlTarget} of host that controls the IME. * When window is doesn't have a parent, it is returned as-is. */ WindowState getImeControlTarget() { InsetsControlTarget getImeControlTarget() { final DisplayContent dc = getDisplayContent(); final WindowState parentWindow = dc.getParentWindow(); Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −8 Original line number Diff line number Diff line Loading @@ -3506,22 +3506,21 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo * doesn't support IME/system decorations. * * @param target current IME target. * @return {@link WindowState} that can host IME. * @return {@link InsetsControlTarget} that can host IME. */ WindowState getImeHostOrFallback(WindowState target) { InsetsControlTarget getImeHostOrFallback(WindowState target) { if (target != null && target.getDisplayContent().canShowIme()) { return target; } return getImeFallback(); } WindowState getImeFallback() { InsetsControlTarget getImeFallback() { // host is in non-default display that doesn't support system decor, default to // default display's StatusBar to control IME. // TODO: (b/148234093)find a better host OR control IME animation/visibility directly // because it won't work when statusbar isn't available. return mWmService.getDefaultDisplayContentLocked().getDisplayPolicy().getStatusBar(); // default display's StatusBar to control IME (when available), else let system control it. WindowState statusBar = mWmService.getDefaultDisplayContentLocked().getDisplayPolicy().getStatusBar(); return statusBar != null ? statusBar : mRemoteInsetsControlTarget; } boolean canShowIme() { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +9 −3 Original line number Diff line number Diff line Loading @@ -7623,8 +7623,12 @@ public class WindowManagerService extends IWindowManager.Stub if (imeTarget == null) { return; } imeTarget = imeTarget.getImeControlTarget(); imeTarget.getDisplayContent().getInsetsStateController().getImeSourceProvider() imeTarget = imeTarget.getImeControlTarget().getWindow(); // If InsetsControlTarget doesn't have a window, its using remoteControlTarget which // is controlled by default display final DisplayContent dc = imeTarget != null ? imeTarget.getDisplayContent() : getDefaultDisplayContentLocked(); dc.getInsetsStateController().getImeSourceProvider() .scheduleShowImePostLayout(imeTarget); } } Loading @@ -7637,7 +7641,9 @@ public class WindowManagerService extends IWindowManager.Stub // The target window no longer exists. return; } final DisplayContent dc = imeTarget.getImeControlTarget().getDisplayContent(); imeTarget = imeTarget.getImeControlTarget().getWindow(); final DisplayContent dc = imeTarget != null ? imeTarget.getDisplayContent() : getDefaultDisplayContentLocked(); // If there was a pending IME show(), reset it as IME has been // requested to be hidden. dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout(); Loading
services/core/java/com/android/server/wm/WindowState.java +2 −2 Original line number Diff line number Diff line Loading @@ -5404,10 +5404,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP * {@link android.view.inputmethod.InputMethodManager#showSoftInput(View, int)} is unknown, * use {@link DisplayContent#getImeControlTarget()} instead. * * @return {@link WindowState} of host that controls the IME. * @return {@link InsetsControlTarget} of host that controls the IME. * When window is doesn't have a parent, it is returned as-is. */ WindowState getImeControlTarget() { InsetsControlTarget getImeControlTarget() { final DisplayContent dc = getDisplayContent(); final WindowState parentWindow = dc.getParentWindow(); Loading