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

Commit 4ae9eacc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Unhide InputMethodService#requestShowSelf()"

parents ff350a2f fbc2f7ac
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -20882,7 +20882,6 @@ package android.inputmethodservice {
    method public int getMaxWidth();
    method public java.lang.CharSequence getTextForImeAction(int);
    method public android.app.Dialog getWindow();
    method public void hideSoftInputFromInputMethod(int);
    method public void hideStatusIcon();
    method public void hideWindow();
    method public boolean isExtractViewShown();
@@ -20930,6 +20929,7 @@ package android.inputmethodservice {
    method public void onWindowHidden();
    method public void onWindowShown();
    method public void requestHideSelf(int);
    method public void requestShowSelf(int);
    method public boolean sendDefaultEditorAction(boolean);
    method public void sendDownUpKeyEvents(int);
    method public void sendKeyChar(char);
@@ -20942,7 +20942,6 @@ package android.inputmethodservice {
    method public void setInputMethodAndSubtype(java.lang.String, android.view.inputmethod.InputMethodSubtype);
    method public void setInputView(android.view.View);
    method public boolean shouldOfferSwitchingToNextInputMethod();
    method public void showSoftInputFromInputMethod(int);
    method public void showStatusIcon(int);
    method public void showWindow(boolean);
    method public void switchInputMethod(java.lang.String);
+19 −43
Original line number Diff line number Diff line
@@ -1081,33 +1081,6 @@ public class InputMethodService extends AbstractInputMethodService {
        mImm.setInputMethodAndSubtypeInternal(mToken, id, subtype);
    }

    /**
     * Close/hide the input method's soft input area, so the user no longer
     * sees it or can interact with it.  This can only be called
     * from the currently active input method, as validated by the given token.
     *
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link InputMethodManager#HIDE_IMPLICIT_ONLY},
     * {@link InputMethodManager#HIDE_NOT_ALWAYS} bit set.
     */
    public void hideSoftInputFromInputMethod(int flags) {
        mImm.hideSoftInputFromInputMethodInternal(mToken, flags);
    }

    /**
     * Show the input method's soft input area, so the user
     * sees the input method window and can interact with it.
     * This can only be called from the currently active input method,
     * as validated by the given token.
     *
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link InputMethodManager#SHOW_IMPLICIT} or
     * {@link InputMethodManager#SHOW_FORCED} bit set.
     */
    public void showSoftInputFromInputMethod(int flags) {
        mImm.showSoftInputFromInputMethodInternal(mToken, flags);
    }

    /**
     * Force switch to the last used input method and subtype. If the last input method didn't have
     * any subtypes, the framework will simply switch to the last input method with no subtype
@@ -1738,7 +1711,7 @@ public class InputMethodService extends AbstractInputMethodService {
            // Rethrow the exception to preserve the existing behavior.  Some IMEs may have directly
            // called this method and relied on this exception for some clean-up tasks.
            // TODO: Give developers a clear guideline of whether it's OK to call this method or
            // InputMethodManager#showSoftInputFromInputMethod() should always be used instead.
            // InputMethodService#requestShowSelf(int) should always be used instead.
            throw e;
        } finally {
            // TODO: Is it OK to set true when we get BadTokenException?
@@ -2060,25 +2033,28 @@ public class InputMethodService extends AbstractInputMethodService {

    /**
     * Close this input method's soft input area, removing it from the display.
     * The input method will continue running, but the user can no longer use
     * it to generate input by touching the screen.
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link InputMethodManager#HIDE_IMPLICIT_ONLY
     * InputMethodManager.HIDE_IMPLICIT_ONLY} bit set.
     *
     * The input method will continue running, but the user can no longer use it to generate input
     * by touching the screen.
     *
     * @see InputMethodManager#HIDE_IMPLICIT_ONLY
     * @see InputMethodManager#HIDE_NOT_ALWAYS
     * @param flags Provides additional operating flags.
     */
    public void requestHideSelf(int flags) {
        mImm.hideSoftInputFromInputMethod(mToken, flags);
        mImm.hideSoftInputFromInputMethodInternal(mToken, flags);
    }

    /**
     * Show the input method. This is a call back to the
     * IMF to handle showing the input method.
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link InputMethodManager#SHOW_FORCED
     * InputMethodManager.} bit set.
     * Show the input method's soft input area, so the user sees the input method window and can
     * interact with it.
     *
     * @see InputMethodManager#SHOW_IMPLICIT
     * @see InputMethodManager#SHOW_FORCED
     * @param flags Provides additional operating flags.
     */
    private void requestShowSelf(int flags) {
        mImm.showSoftInputFromInputMethod(mToken, flags);
    public void requestShowSelf(int flags) {
        mImm.showSoftInputFromInputMethodInternal(mToken, flags);
    }

    private boolean handleBack(boolean doIt) {
+10 −10
Original line number Diff line number Diff line
@@ -1082,15 +1082,15 @@ public final class InputMethodManager {
    }

    /**
     * Flag for {@link #hideSoftInputFromWindow} to indicate that the soft
     * input window should only be hidden if it was not explicitly shown
     * Flag for {@link #hideSoftInputFromWindow} and {@link InputMethodService#requestHideSelf(int)}
     * to indicate that the soft input window should only be hidden if it was not explicitly shown
     * by the user.
     */
    public static final int HIDE_IMPLICIT_ONLY = 0x0001;

    /**
     * Flag for {@link #hideSoftInputFromWindow} to indicate that the soft
     * input window should normally be hidden, unless it was originally
     * Flag for {@link #hideSoftInputFromWindow} and {@link InputMethodService#requestShowSelf(int)}
     * to indicate that the soft input window should normally be hidden, unless it was originally
     * shown with {@link #SHOW_FORCED}.
     */
    public static final int HIDE_NOT_ALWAYS = 0x0002;
@@ -1869,9 +1869,9 @@ public final class InputMethodManager {
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link #HIDE_IMPLICIT_ONLY},
     * {@link #HIDE_NOT_ALWAYS} bit set.
     * @deprecated Use {@link InputMethodService#hideSoftInputFromInputMethod(int)}
     * instead. This method was intended for IME developers who should be accessing APIs through
     * the service. APIs in this class are intended for app developers interacting with the IME.
     * @deprecated Use {@link InputMethodService#requestHideSelf(int)} instead. This method was
     * intended for IME developers who should be accessing APIs through the service. APIs in this
     * class are intended for app developers interacting with the IME.
     */
    @Deprecated
    public void hideSoftInputFromInputMethod(IBinder token, int flags) {
@@ -1901,9 +1901,9 @@ public final class InputMethodManager {
     * @param flags Provides additional operating flags.  Currently may be
     * 0 or have the {@link #SHOW_IMPLICIT} or
     * {@link #SHOW_FORCED} bit set.
     * @deprecated Use {@link InputMethodService#showSoftInputFromInputMethod(int)}
     * instead. This method was intended for IME developers who should be accessing APIs through
     * the service. APIs in this class are intended for app developers interacting with the IME.
     * @deprecated Use {@link InputMethodService#requestShowSelf(int)} instead. This method was
     * intended for IME developers who should be accessing APIs through the service. APIs in this
     * class are intended for app developers interacting with the IME.
     */
    @Deprecated
    public void showSoftInputFromInputMethod(IBinder token, int flags) {