Loading packages/SystemUI/src/com/android/systemui/wm/DisplayImeController.java +45 −5 Original line number Diff line number Diff line Loading @@ -228,19 +228,43 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged mHandler.post(() -> { final Point lastSurfacePosition = mImeSourceControl != null ? mImeSourceControl.getSurfacePosition() : null; final boolean positionChanged = !activeControl.getSurfacePosition().equals(lastSurfacePosition); final boolean leashChanged = !haveSameLeash(mImeSourceControl, activeControl); mImeSourceControl = activeControl; if (!activeControl.getSurfacePosition().equals(lastSurfacePosition) && mAnimation != null) { if (mAnimation != null) { if (positionChanged) { startAnimation(mImeShowing, true /* forceRestart */); } else if (!mImeShowing) { } } else { if (leashChanged) { applyVisibilityToLeash(); } if (!mImeShowing) { removeImeSurface(); } } }); } } } } private void applyVisibilityToLeash() { SurfaceControl leash = mImeSourceControl.getLeash(); if (leash != null) { SurfaceControl.Transaction t = mTransactionPool.acquire(); if (mImeShowing) { t.show(leash); } else { t.hide(leash); } t.apply(); mTransactionPool.release(t); } } @Override public void showInsets(int types, boolean fromIme) { if ((types & WindowInsets.Type.ime()) == 0) { Loading Loading @@ -492,4 +516,20 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged return IInputMethodManager.Stub.asInterface( ServiceManager.getService(Context.INPUT_METHOD_SERVICE)); } private static boolean haveSameLeash(InsetsSourceControl a, InsetsSourceControl b) { if (a == b) { return true; } if (a == null || b == null) { return false; } if (a.getLeash() == b.getLeash()) { return true; } if (a.getLeash() == null || b.getLeash() == null) { return false; } return a.getLeash().isSameSurface(b.getLeash()); } } services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -6187,7 +6187,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (inputMethodControlTarget != null) { pw.print(" inputMethodControlTarget in display# "); pw.print(displayId); pw.print(' '); pw.println(inputMethodControlTarget.getWindow()); pw.print(' '); pw.println(inputMethodControlTarget); } }); pw.print(" mInTouchMode="); pw.println(mInTouchMode); Loading Loading
packages/SystemUI/src/com/android/systemui/wm/DisplayImeController.java +45 −5 Original line number Diff line number Diff line Loading @@ -228,19 +228,43 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged mHandler.post(() -> { final Point lastSurfacePosition = mImeSourceControl != null ? mImeSourceControl.getSurfacePosition() : null; final boolean positionChanged = !activeControl.getSurfacePosition().equals(lastSurfacePosition); final boolean leashChanged = !haveSameLeash(mImeSourceControl, activeControl); mImeSourceControl = activeControl; if (!activeControl.getSurfacePosition().equals(lastSurfacePosition) && mAnimation != null) { if (mAnimation != null) { if (positionChanged) { startAnimation(mImeShowing, true /* forceRestart */); } else if (!mImeShowing) { } } else { if (leashChanged) { applyVisibilityToLeash(); } if (!mImeShowing) { removeImeSurface(); } } }); } } } } private void applyVisibilityToLeash() { SurfaceControl leash = mImeSourceControl.getLeash(); if (leash != null) { SurfaceControl.Transaction t = mTransactionPool.acquire(); if (mImeShowing) { t.show(leash); } else { t.hide(leash); } t.apply(); mTransactionPool.release(t); } } @Override public void showInsets(int types, boolean fromIme) { if ((types & WindowInsets.Type.ime()) == 0) { Loading Loading @@ -492,4 +516,20 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged return IInputMethodManager.Stub.asInterface( ServiceManager.getService(Context.INPUT_METHOD_SERVICE)); } private static boolean haveSameLeash(InsetsSourceControl a, InsetsSourceControl b) { if (a == b) { return true; } if (a == null || b == null) { return false; } if (a.getLeash() == b.getLeash()) { return true; } if (a.getLeash() == null || b.getLeash() == null) { return false; } return a.getLeash().isSameSurface(b.getLeash()); } }
services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -6187,7 +6187,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (inputMethodControlTarget != null) { pw.print(" inputMethodControlTarget in display# "); pw.print(displayId); pw.print(' '); pw.println(inputMethodControlTarget.getWindow()); pw.print(' '); pw.println(inputMethodControlTarget); } }); pw.print(" mInTouchMode="); pw.println(mInTouchMode); Loading