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

Commit 03f759e8 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Add InputConnection#insertContent()." into nyc-mr1-dev

parents 3d66bdb5 152944f4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -44706,6 +44706,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44800,6 +44801,7 @@ package android.view.inputmethod {
    field public static final int IME_NULL = 0; // 0x0
    field public int actionId;
    field public java.lang.CharSequence actionLabel;
    field public java.lang.String[] contentMimeTypes;
    field public android.os.Bundle extras;
    field public int fieldId;
    field public java.lang.String fieldName;
@@ -44871,6 +44873,7 @@ package android.view.inputmethod {
    method public abstract java.lang.CharSequence getSelectedText(int);
    method public abstract java.lang.CharSequence getTextAfterCursor(int, int);
    method public abstract java.lang.CharSequence getTextBeforeCursor(int, int);
    method public abstract boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public abstract boolean performContextMenuAction(int);
    method public abstract boolean performEditorAction(int);
    method public abstract boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44904,6 +44907,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44916,6 +44920,17 @@ package android.view.inputmethod {
    method public void setTarget(android.view.inputmethod.InputConnection);
  }
  public class InputContentInfo implements android.os.Parcelable {
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription);
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
  public abstract interface InputMethod {
    method public abstract void attachToken(android.os.IBinder);
    method public abstract void bindInput(android.view.inputmethod.InputBinding);
+15 −0
Original line number Diff line number Diff line
@@ -47709,6 +47709,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -47803,6 +47804,7 @@ package android.view.inputmethod {
    field public static final int IME_NULL = 0; // 0x0
    field public int actionId;
    field public java.lang.CharSequence actionLabel;
    field public java.lang.String[] contentMimeTypes;
    field public android.os.Bundle extras;
    field public int fieldId;
    field public java.lang.String fieldName;
@@ -47874,6 +47876,7 @@ package android.view.inputmethod {
    method public abstract java.lang.CharSequence getSelectedText(int);
    method public abstract java.lang.CharSequence getTextAfterCursor(int, int);
    method public abstract java.lang.CharSequence getTextBeforeCursor(int, int);
    method public abstract boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public abstract boolean performContextMenuAction(int);
    method public abstract boolean performEditorAction(int);
    method public abstract boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -47907,6 +47910,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -47919,6 +47923,17 @@ package android.view.inputmethod {
    method public void setTarget(android.view.inputmethod.InputConnection);
  }
  public class InputContentInfo implements android.os.Parcelable {
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription);
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
  public abstract interface InputMethod {
    method public abstract void attachToken(android.os.IBinder);
    method public abstract void bindInput(android.view.inputmethod.InputBinding);
+15 −0
Original line number Diff line number Diff line
@@ -44786,6 +44786,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44880,6 +44881,7 @@ package android.view.inputmethod {
    field public static final int IME_NULL = 0; // 0x0
    field public int actionId;
    field public java.lang.CharSequence actionLabel;
    field public java.lang.String[] contentMimeTypes;
    field public android.os.Bundle extras;
    field public int fieldId;
    field public java.lang.String fieldName;
@@ -44951,6 +44953,7 @@ package android.view.inputmethod {
    method public abstract java.lang.CharSequence getSelectedText(int);
    method public abstract java.lang.CharSequence getTextAfterCursor(int, int);
    method public abstract java.lang.CharSequence getTextBeforeCursor(int, int);
    method public abstract boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public abstract boolean performContextMenuAction(int);
    method public abstract boolean performEditorAction(int);
    method public abstract boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44984,6 +44987,7 @@ package android.view.inputmethod {
    method public java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean insertContent(android.view.inputmethod.InputContentInfo, android.os.Bundle);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.String, android.os.Bundle);
@@ -44996,6 +45000,17 @@ package android.view.inputmethod {
    method public void setTarget(android.view.inputmethod.InputConnection);
  }
  public class InputContentInfo implements android.os.Parcelable {
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription);
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
  public abstract interface InputMethod {
    method public abstract void attachToken(android.os.IBinder);
    method public abstract void bindInput(android.view.inputmethod.InputBinding);
+5 −0
Original line number Diff line number Diff line
@@ -851,4 +851,9 @@ public class BaseInputConnection implements InputConnection {
        
        endBatchEdit();
    }

    /**
     * The default implementation does nothing.
     */
    public boolean insertContent(InputContentInfo inputContentInfo, Bundle opts) { return false; }
}
+17 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import android.text.InputType;
import android.text.TextUtils;
import android.util.Printer;

import java.util.Arrays;

/**
 * An EditorInfo describes several attributes of a text editing object
 * that an input method is communicating with (typically an EditText), most
@@ -363,6 +365,18 @@ public class EditorInfo implements InputType, Parcelable {
    @Nullable
    public LocaleList hintLocales = null;


    /**
     * List of acceptable MIME types for
     * {@link InputConnection#insertContent(InputContentInfo, Bundle)}.
     *
     * <p>{@code null} or an empty array means that
     * {@link InputConnection#insertContent(InputContentInfo, Bundle)} is not supported in this
     * editor.</p>
     */
    @Nullable
    public String[] contentMimeTypes = null;

    /**
     * Ensure that the data in this EditorInfo is compatible with an application
     * that was developed against the given target API version.  This can
@@ -418,6 +432,7 @@ public class EditorInfo implements InputType, Parcelable {
                + " fieldName=" + fieldName);
        pw.println(prefix + "extras=" + extras);
        pw.println(prefix + "hintLocales=" + hintLocales);
        pw.println(prefix + "contentMimeTypes=" + Arrays.toString(contentMimeTypes));
    }

    /**
@@ -446,6 +461,7 @@ public class EditorInfo implements InputType, Parcelable {
        } else {
            LocaleList.getEmptyLocaleList().writeToParcel(dest, flags);
        }
        dest.writeStringArray(contentMimeTypes);
    }

    /**
@@ -471,6 +487,7 @@ public class EditorInfo implements InputType, Parcelable {
                    res.extras = source.readBundle();
                    LocaleList hintLocales = LocaleList.CREATOR.createFromParcel(source);
                    res.hintLocales = hintLocales.isEmpty() ? null : hintLocales;
                    res.contentMimeTypes = source.readStringArray();
                    return res;
                }

Loading