Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43646,6 +43646,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList(); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -46008,6 +46008,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList(); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43662,6 +43662,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList(); core/java/android/view/inputmethod/BaseInputConnection.java +3 −17 Original line number Diff line number Diff line Loading @@ -195,7 +195,6 @@ public class BaseInputConnection implements InputConnection { public boolean commitText(CharSequence text, int newCursorPosition) { if (DEBUG) Log.v(TAG, "commitText " + text); replaceText(text, newCursorPosition, false); mIMM.notifyUserAction(); sendCurrentText(); return true; } Loading Loading @@ -450,7 +449,6 @@ public class BaseInputConnection implements InputConnection { public boolean setComposingText(CharSequence text, int newCursorPosition) { if (DEBUG) Log.v(TAG, "setComposingText " + text); replaceText(text, newCursorPosition, true); mIMM.notifyUserAction(); return true; } Loading Loading @@ -523,18 +521,7 @@ public class BaseInputConnection implements InputConnection { * attached to the input connection's view. */ public boolean sendKeyEvent(KeyEvent event) { synchronized (mIMM.mH) { ViewRootImpl viewRootImpl = mTargetView != null ? mTargetView.getViewRootImpl() : null; if (viewRootImpl == null) { if (mIMM.mServedView != null) { viewRootImpl = mIMM.mServedView.getViewRootImpl(); } } if (viewRootImpl != null) { viewRootImpl.dispatchKeyFromIme(event); } } mIMM.notifyUserAction(); mIMM.dispatchKeyEventFromInputMethod(mTargetView, event); return false; } Loading @@ -542,7 +529,6 @@ public class BaseInputConnection implements InputConnection { * Updates InputMethodManager with the current fullscreen mode. */ public boolean reportFullscreenMode(boolean enabled) { mIMM.setFullscreenMode(enabled); return true; } Loading core/java/android/view/inputmethod/InputMethodManager.java +42 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.internal.view.IInputMethodSession; import com.android.internal.view.InputBindResult; import com.android.internal.view.InputMethodClient; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.content.Context; import android.graphics.Rect; Loading Loading @@ -548,6 +550,16 @@ public final class InputMethodManager { mActive = false; } @Override protected void onUserAction() { mParentInputMethodManager.notifyUserAction(); } @Override protected void onReportFullscreenMode(boolean enabled) { mParentInputMethodManager.setFullscreenMode(enabled); } @Override public String toString() { return "ControlledInputConnectionWrapper{mActive=" + mActive Loading Loading @@ -1813,6 +1825,34 @@ public final class InputMethodManager { return DISPATCH_NOT_HANDLED; } /** * Provides the default implementation of {@link InputConnection#sendKeyEvent(KeyEvent)}, which * is expected to dispatch an keyboard event sent from the IME to an appropriate event target * depending on the given {@link View} and the current focus state. * * <p>CAUTION: This method is provided only for the situation where * {@link InputConnection#sendKeyEvent(KeyEvent)} needs to be implemented without relying on * {@link BaseInputConnection}. Do not use this API for anything else.</p> * * @param targetView the default target view. If {@code null} is specified, then this method * tries to find a good event target based on the current focus state. * @param event the key event to be dispatched. */ public void dispatchKeyEventFromInputMethod(@Nullable View targetView, @NonNull KeyEvent event) { synchronized (mH) { ViewRootImpl viewRootImpl = targetView != null ? targetView.getViewRootImpl() : null; if (viewRootImpl == null) { if (mServedView != null) { viewRootImpl = mServedView.getViewRootImpl(); } } if (viewRootImpl != null) { viewRootImpl.dispatchKeyFromIme(event); } } } // Must be called on the main looper void sendInputEventAndReportResultOnMainLooper(PendingEvent p) { final boolean handled; Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43646,6 +43646,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList();
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -46008,6 +46008,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList();
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43662,6 +43662,7 @@ package android.view.inputmethod { } public final class InputMethodManager { method public void dispatchKeyEventFromInputMethod(android.view.View, android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype(); method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList();
core/java/android/view/inputmethod/BaseInputConnection.java +3 −17 Original line number Diff line number Diff line Loading @@ -195,7 +195,6 @@ public class BaseInputConnection implements InputConnection { public boolean commitText(CharSequence text, int newCursorPosition) { if (DEBUG) Log.v(TAG, "commitText " + text); replaceText(text, newCursorPosition, false); mIMM.notifyUserAction(); sendCurrentText(); return true; } Loading Loading @@ -450,7 +449,6 @@ public class BaseInputConnection implements InputConnection { public boolean setComposingText(CharSequence text, int newCursorPosition) { if (DEBUG) Log.v(TAG, "setComposingText " + text); replaceText(text, newCursorPosition, true); mIMM.notifyUserAction(); return true; } Loading Loading @@ -523,18 +521,7 @@ public class BaseInputConnection implements InputConnection { * attached to the input connection's view. */ public boolean sendKeyEvent(KeyEvent event) { synchronized (mIMM.mH) { ViewRootImpl viewRootImpl = mTargetView != null ? mTargetView.getViewRootImpl() : null; if (viewRootImpl == null) { if (mIMM.mServedView != null) { viewRootImpl = mIMM.mServedView.getViewRootImpl(); } } if (viewRootImpl != null) { viewRootImpl.dispatchKeyFromIme(event); } } mIMM.notifyUserAction(); mIMM.dispatchKeyEventFromInputMethod(mTargetView, event); return false; } Loading @@ -542,7 +529,6 @@ public class BaseInputConnection implements InputConnection { * Updates InputMethodManager with the current fullscreen mode. */ public boolean reportFullscreenMode(boolean enabled) { mIMM.setFullscreenMode(enabled); return true; } Loading
core/java/android/view/inputmethod/InputMethodManager.java +42 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.internal.view.IInputMethodSession; import com.android.internal.view.InputBindResult; import com.android.internal.view.InputMethodClient; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.content.Context; import android.graphics.Rect; Loading Loading @@ -548,6 +550,16 @@ public final class InputMethodManager { mActive = false; } @Override protected void onUserAction() { mParentInputMethodManager.notifyUserAction(); } @Override protected void onReportFullscreenMode(boolean enabled) { mParentInputMethodManager.setFullscreenMode(enabled); } @Override public String toString() { return "ControlledInputConnectionWrapper{mActive=" + mActive Loading Loading @@ -1813,6 +1825,34 @@ public final class InputMethodManager { return DISPATCH_NOT_HANDLED; } /** * Provides the default implementation of {@link InputConnection#sendKeyEvent(KeyEvent)}, which * is expected to dispatch an keyboard event sent from the IME to an appropriate event target * depending on the given {@link View} and the current focus state. * * <p>CAUTION: This method is provided only for the situation where * {@link InputConnection#sendKeyEvent(KeyEvent)} needs to be implemented without relying on * {@link BaseInputConnection}. Do not use this API for anything else.</p> * * @param targetView the default target view. If {@code null} is specified, then this method * tries to find a good event target based on the current focus state. * @param event the key event to be dispatched. */ public void dispatchKeyEventFromInputMethod(@Nullable View targetView, @NonNull KeyEvent event) { synchronized (mH) { ViewRootImpl viewRootImpl = targetView != null ? targetView.getViewRootImpl() : null; if (viewRootImpl == null) { if (mServedView != null) { viewRootImpl = mServedView.getViewRootImpl(); } } if (viewRootImpl != null) { viewRootImpl.dispatchKeyFromIme(event); } } } // Must be called on the main looper void sendInputEventAndReportResultOnMainLooper(PendingEvent p) { final boolean handled; Loading