diff options
Diffstat (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/AbstractInputMethodService.java | 73 |
1 files changed, 29 insertions, 44 deletions
diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index b359465c4738..9db41c41c31c 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -25,13 +25,10 @@ import android.content.res.Configuration; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; -import android.util.proto.ProtoOutputStream; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.WindowManager; import android.view.WindowManagerGlobal; -import android.view.inputmethod.InputConnection; -import android.view.inputmethod.InputContentInfo; import android.view.inputmethod.InputMethod; import android.view.inputmethod.InputMethodSession; import android.window.WindowProviderService; @@ -216,16 +213,6 @@ public abstract class AbstractInputMethodService extends WindowProviderService public abstract AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface(); /** - * Dumps the internal state of IME to a protocol buffer output stream. - * - * @param proto ProtoOutputStream to dump data to. - * @param icProto {@link InputConnection} call data in proto format. - * @hide - */ - @SuppressWarnings("HiddenAbstractMethod") - public abstract void dumpProtoInternal(ProtoOutputStream proto, @Nullable byte[] icProto); - - /** * Implement this to handle {@link android.os.Binder#dump Binder.dump()} * calls on your input method. */ @@ -238,9 +225,36 @@ public abstract class AbstractInputMethodService extends WindowProviderService if (mInputMethod == null) { mInputMethod = onCreateInputMethodInterface(); } - return new IInputMethodWrapper(this, mInputMethod); + return new IInputMethodWrapper(createInputMethodServiceInternal(), mInputMethod); } - + + /** + * Used to inject custom {@link InputMethodServiceInternal}. + * + * @return the {@link InputMethodServiceInternal} to be used. + */ + @NonNull + InputMethodServiceInternal createInputMethodServiceInternal() { + return new InputMethodServiceInternal() { + /** + * {@inheritDoc} + */ + @NonNull + @Override + public Context getContext() { + return AbstractInputMethodService.this; + } + + /** + * {@inheritDoc} + */ + @Override + public void dump(FileDescriptor fd, PrintWriter fout, String[] args) { + AbstractInputMethodService.this.dump(fd, fout, args); + } + }; + } + /** * Implement this to handle trackball events on your input method. * @@ -263,35 +277,6 @@ public abstract class AbstractInputMethodService extends WindowProviderService return false; } - /** - * Allow the receiver of {@link InputContentInfo} to obtain a temporary read-only access - * permission to the content. - * - * <p>Default implementation does nothing.</p> - * - * @param inputContentInfo Content to be temporarily exposed from the input method to the - * application. - * This cannot be {@code null}. - * @param inputConnection {@link InputConnection} with which - * {@link InputConnection#commitContent(InputContentInfo, int, android.os.Bundle)} will be - * called. - * @return {@code false} if we cannot allow a temporary access permission. - * @hide - */ - public void exposeContent(@NonNull InputContentInfo inputContentInfo, - @NonNull InputConnection inputConnection) { - return; - } - - /** - * Called when the user took some actions that should be taken into consideration to update the - * MRU list for input method rotation. - * - * @hide - */ - public void notifyUserActionIfNecessary() { - } - // TODO(b/149463653): remove it in T. We missed the API deadline in S. /** @hide */ @Override |
