Loading core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_FINISH_SESSION = 110; private static final int DO_VIEW_CLICKED = 115; private static final int DO_NOTIFY_IME_HIDDEN = 120; private static final int DO_REMOVE_IME_SURFACE = 130; @UnsupportedAppUsage HandlerCaller mCaller; Loading Loading @@ -136,6 +137,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.notifyImeHidden(); return; } case DO_REMOVE_IME_SURFACE: { mInputMethodSession.removeImeSurface(); return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -183,6 +188,11 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_NOTIFY_IME_HIDDEN)); } @Override public void removeImeSurface() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_REMOVE_IME_SURFACE)); } @Override public void updateCursor(Rect newCursor) { mCaller.executeOrSendMessage( Loading core/java/android/inputmethodservice/InputMethodService.java +15 −0 Original line number Diff line number Diff line Loading @@ -814,6 +814,13 @@ public class InputMethodService extends AbstractInputMethodService { onPreRenderedWindowVisibilityChanged(false /* setVisible */); } private void removeImeSurface() { if (!mShowInputRequested && !mWindowVisible) { // hiding a window removes its surface. mWindow.hide(); } } private void setImeWindowStatus(int visibilityFlags, int backDisposition) { mPrivOps.setImeWindowStatus(visibilityFlags, backDisposition); } Loading Loading @@ -932,6 +939,14 @@ public class InputMethodService extends AbstractInputMethodService { public final void notifyImeHidden() { InputMethodService.this.notifyImeHidden(); } /** * Notify IME that surface can be now removed. * @hide */ public final void removeImeSurface() { InputMethodService.this.removeImeSurface(); } } /** Loading core/java/android/inputmethodservice/MultiClientInputMethodClientCallbackAdaptor.java +6 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,12 @@ final class MultiClientInputMethodClientCallbackAdaptor { // no-op for multi-session since IME is responsible controlling navigation bar buttons. reportNotSupported(); } @Override public void removeImeSurface() { // no-op for multi-session reportNotSupported(); } } private static final class MultiClientInputMethodSessionImpl Loading core/java/android/view/ImeInsetsSourceConsumer.java +14 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.toPublicType; import android.annotation.Nullable; import android.inputmethodservice.InputMethodService; Loading Loading @@ -99,6 +98,15 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer { } } @Override void hide(boolean animationFinished) { super.hide(); if (animationFinished) { // remove IME surface as IME has finished hide animation. removeSurface(); } } /** * Request {@link InputMethodManager} to show the IME. * @return @see {@link android.view.InsetsSourceConsumer.ShowResult}. Loading Loading @@ -127,6 +135,11 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer { getImm().notifyImeHidden(); } @Override public void removeSurface() { getImm().removeImeSurface(); } @Override public void setControl(@Nullable InsetsSourceControl control, int[] showTypes, int[] hideTypes) { Loading core/java/android/view/InsetsController.java +4 −4 Original line number Diff line number Diff line Loading @@ -694,7 +694,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (shown) { showDirectly(controller.getTypes()); } else { hideDirectly(controller.getTypes()); hideDirectly(controller.getTypes(), true /* animationFinished */); } } Loading Loading @@ -852,10 +852,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation : LAYOUT_INSETS_DURING_ANIMATION_HIDDEN); } private void hideDirectly(@InsetsType int types) { private void hideDirectly(@InsetsType int types, boolean animationFinished) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).hide(); getSourceConsumer(internalTypes.valueAt(i)).hide(animationFinished); } } Loading Loading @@ -887,7 +887,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (layoutDuringAnimation == LAYOUT_INSETS_DURING_ANIMATION_SHOWN) { showDirectly(types); } else { hideDirectly(types); hideDirectly(types, false /* animationFinished */); } if (mViewRoot.mView == null) { return; Loading Loading
core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_FINISH_SESSION = 110; private static final int DO_VIEW_CLICKED = 115; private static final int DO_NOTIFY_IME_HIDDEN = 120; private static final int DO_REMOVE_IME_SURFACE = 130; @UnsupportedAppUsage HandlerCaller mCaller; Loading Loading @@ -136,6 +137,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.notifyImeHidden(); return; } case DO_REMOVE_IME_SURFACE: { mInputMethodSession.removeImeSurface(); return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -183,6 +188,11 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_NOTIFY_IME_HIDDEN)); } @Override public void removeImeSurface() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_REMOVE_IME_SURFACE)); } @Override public void updateCursor(Rect newCursor) { mCaller.executeOrSendMessage( Loading
core/java/android/inputmethodservice/InputMethodService.java +15 −0 Original line number Diff line number Diff line Loading @@ -814,6 +814,13 @@ public class InputMethodService extends AbstractInputMethodService { onPreRenderedWindowVisibilityChanged(false /* setVisible */); } private void removeImeSurface() { if (!mShowInputRequested && !mWindowVisible) { // hiding a window removes its surface. mWindow.hide(); } } private void setImeWindowStatus(int visibilityFlags, int backDisposition) { mPrivOps.setImeWindowStatus(visibilityFlags, backDisposition); } Loading Loading @@ -932,6 +939,14 @@ public class InputMethodService extends AbstractInputMethodService { public final void notifyImeHidden() { InputMethodService.this.notifyImeHidden(); } /** * Notify IME that surface can be now removed. * @hide */ public final void removeImeSurface() { InputMethodService.this.removeImeSurface(); } } /** Loading
core/java/android/inputmethodservice/MultiClientInputMethodClientCallbackAdaptor.java +6 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,12 @@ final class MultiClientInputMethodClientCallbackAdaptor { // no-op for multi-session since IME is responsible controlling navigation bar buttons. reportNotSupported(); } @Override public void removeImeSurface() { // no-op for multi-session reportNotSupported(); } } private static final class MultiClientInputMethodSessionImpl Loading
core/java/android/view/ImeInsetsSourceConsumer.java +14 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.toPublicType; import android.annotation.Nullable; import android.inputmethodservice.InputMethodService; Loading Loading @@ -99,6 +98,15 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer { } } @Override void hide(boolean animationFinished) { super.hide(); if (animationFinished) { // remove IME surface as IME has finished hide animation. removeSurface(); } } /** * Request {@link InputMethodManager} to show the IME. * @return @see {@link android.view.InsetsSourceConsumer.ShowResult}. Loading Loading @@ -127,6 +135,11 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer { getImm().notifyImeHidden(); } @Override public void removeSurface() { getImm().removeImeSurface(); } @Override public void setControl(@Nullable InsetsSourceControl control, int[] showTypes, int[] hideTypes) { Loading
core/java/android/view/InsetsController.java +4 −4 Original line number Diff line number Diff line Loading @@ -694,7 +694,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (shown) { showDirectly(controller.getTypes()); } else { hideDirectly(controller.getTypes()); hideDirectly(controller.getTypes(), true /* animationFinished */); } } Loading Loading @@ -852,10 +852,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation : LAYOUT_INSETS_DURING_ANIMATION_HIDDEN); } private void hideDirectly(@InsetsType int types) { private void hideDirectly(@InsetsType int types, boolean animationFinished) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).hide(); getSourceConsumer(internalTypes.valueAt(i)).hide(animationFinished); } } Loading Loading @@ -887,7 +887,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (layoutDuringAnimation == LAYOUT_INSETS_DURING_ANIMATION_SHOWN) { showDirectly(types); } else { hideDirectly(types); hideDirectly(types, false /* animationFinished */); } if (mViewRoot.mView == null) { return; Loading