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

Commit 1c10a5c2 authored by Lan Wei's avatar Lan Wei
Browse files

Add unit tests for BaseInputConnection

Add basic unit tests for BaseInputConnection.
Also some trivial changes in BaseInputConnection:
  - Mark some files with @NonNull & @Nullable annotation.
  - Fix possible NPE in commitContent().
  - Marks public methods for overriding InputConnection interface with @Override.
  - Format file via google-java-format.py.

Bug: 240359838
Bug: 241503197
Test: atest FrameworksCoreTests:BaseInputConnectionTest
Test: atest FrameworksCoreTests:SurroundingTextTest
Test: atest CtsInputMethodTestCases:BaseInputConnectionTest

Change-Id: Idf77d69bcd4d84a48742e0d7a24398df3c0ae7f8
parent 1fd7ea10
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -52941,7 +52941,7 @@ package android.view.displayhash {
package android.view.inputmethod {
  public class BaseInputConnection implements android.view.inputmethod.InputConnection {
    ctor public BaseInputConnection(android.view.View, boolean);
    ctor public BaseInputConnection(@NonNull android.view.View, boolean);
    method public boolean beginBatchEdit();
    method public boolean clearMetaKeyStates(int);
    method @CallSuper public void closeConnection();
@@ -52953,24 +52953,24 @@ package android.view.inputmethod {
    method public boolean deleteSurroundingTextInCodePoints(int, int);
    method public boolean endBatchEdit();
    method public boolean finishComposingText();
    method public static int getComposingSpanEnd(android.text.Spannable);
    method public static int getComposingSpanStart(android.text.Spannable);
    method public static int getComposingSpanEnd(@NonNull android.text.Spannable);
    method public static int getComposingSpanStart(@NonNull android.text.Spannable);
    method public int getCursorCapsMode(int);
    method public android.text.Editable getEditable();
    method public android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method public android.os.Handler getHandler();
    method public CharSequence getSelectedText(int);
    method @Nullable public android.text.Editable getEditable();
    method @Nullable public android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method @Nullable public android.os.Handler getHandler();
    method @Nullable public CharSequence getSelectedText(int);
    method @Nullable public CharSequence getTextAfterCursor(@IntRange(from=0) int, int);
    method @Nullable public CharSequence getTextBeforeCursor(@IntRange(from=0) int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(String, android.os.Bundle);
    method public static final void removeComposingSpans(android.text.Spannable);
    method public static final void removeComposingSpans(@NonNull android.text.Spannable);
    method public boolean reportFullscreenMode(boolean);
    method public boolean requestCursorUpdates(int);
    method public boolean sendKeyEvent(android.view.KeyEvent);
    method public boolean setComposingRegion(int, int);
    method public static void setComposingSpans(android.text.Spannable);
    method public static void setComposingSpans(@NonNull android.text.Spannable);
    method public boolean setComposingText(CharSequence, int);
    method public boolean setSelection(int, int);
  }
+161 −116

File changed.

Preview size limit exceeded, changes collapsed.

+691 −0

File added.

Preview size limit exceeded, changes collapsed.

+84 −28

File changed.

Preview size limit exceeded, changes collapsed.