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

Commit 835e1207 authored by Nikita Dubrovsky's avatar Nikita Dubrovsky
Browse files

Add SOURCE_APP to OnReceiveContentCallback.Payload

Bug: 170191676
Bug: 152068298
Test: Will update CTS tests in a separate CL once all API council
feedback is addressed

Change-Id: I6e6f160020042ad19c4a7a8ae6fd0f090b301837
parent 4924e209
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -53709,11 +53709,12 @@ package android.view {
    method @Nullable public android.net.Uri getLinkUri();
    method public int getSource();
    field public static final int FLAG_CONVERT_TO_PLAIN_TEXT = 1; // 0x1
    field public static final int SOURCE_AUTOFILL = 3; // 0x3
    field public static final int SOURCE_CLIPBOARD = 0; // 0x0
    field public static final int SOURCE_DRAG_AND_DROP = 2; // 0x2
    field public static final int SOURCE_INPUT_METHOD = 1; // 0x1
    field public static final int SOURCE_PROCESS_TEXT = 4; // 0x4
    field public static final int SOURCE_APP = 0; // 0x0
    field public static final int SOURCE_AUTOFILL = 4; // 0x4
    field public static final int SOURCE_CLIPBOARD = 1; // 0x1
    field public static final int SOURCE_DRAG_AND_DROP = 3; // 0x3
    field public static final int SOURCE_INPUT_METHOD = 2; // 0x2
    field public static final int SOURCE_PROCESS_TEXT = 5; // 0x5
  }
  public static final class OnReceiveContentCallback.Payload.Builder {
+16 −8
Original line number Diff line number Diff line
@@ -134,46 +134,52 @@ public interface OnReceiveContentCallback<T extends View> {
    final class Payload {

        /**
         * Specifies the UI through which content is being inserted.
         * Specifies the UI through which content is being inserted. Future versions of Android may
         * support additional values.
         *
         * @hide
         */
        @IntDef(prefix = {"SOURCE_"}, value = {SOURCE_CLIPBOARD, SOURCE_INPUT_METHOD,
        @IntDef(prefix = {"SOURCE_"}, value = {SOURCE_APP, SOURCE_CLIPBOARD, SOURCE_INPUT_METHOD,
                SOURCE_DRAG_AND_DROP, SOURCE_AUTOFILL, SOURCE_PROCESS_TEXT})
        @Retention(RetentionPolicy.SOURCE)
        public @interface Source {}

        /**
         * Specifies that the operation was triggered by the app that contains the target view.
         */
        public static final int SOURCE_APP = 0;

        /**
         * Specifies that the operation was triggered by a paste from the clipboard (e.g. "Paste" or
         * "Paste as plain text" action in the insertion/selection menu).
         */
        public static final int SOURCE_CLIPBOARD = 0;
        public static final int SOURCE_CLIPBOARD = 1;

        /**
         * Specifies that the operation was triggered from the soft keyboard (also known as input
         * method editor or IME). See https://developer.android.com/guide/topics/text/image-keyboard
         * for more info.
         */
        public static final int SOURCE_INPUT_METHOD = 1;
        public static final int SOURCE_INPUT_METHOD = 2;

        /**
         * Specifies that the operation was triggered by the drag/drop framework. See
         * https://developer.android.com/guide/topics/ui/drag-drop for more info.
         */
        public static final int SOURCE_DRAG_AND_DROP = 2;
        public static final int SOURCE_DRAG_AND_DROP = 3;

        /**
         * Specifies that the operation was triggered by the autofill framework. See
         * https://developer.android.com/guide/topics/text/autofill for more info.
         */
        public static final int SOURCE_AUTOFILL = 3;
        public static final int SOURCE_AUTOFILL = 4;

        /**
         * Specifies that the operation was triggered by a result from a
         * {@link android.content.Intent#ACTION_PROCESS_TEXT PROCESS_TEXT} action in the selection
         * menu.
         */
        public static final int SOURCE_PROCESS_TEXT = 4;
        public static final int SOURCE_PROCESS_TEXT = 5;

        /**
         * Returns the symbolic name of the given source.
@@ -182,6 +188,7 @@ public interface OnReceiveContentCallback<T extends View> {
         */
        static String sourceToString(@Source int source) {
            switch (source) {
                case SOURCE_APP: return "SOURCE_APP";
                case SOURCE_CLIPBOARD: return "SOURCE_CLIPBOARD";
                case SOURCE_INPUT_METHOD: return "SOURCE_INPUT_METHOD";
                case SOURCE_DRAG_AND_DROP: return "SOURCE_DRAG_AND_DROP";
@@ -252,7 +259,8 @@ public interface OnReceiveContentCallback<T extends View> {
        }

        /**
         * The source of the operation. See {@code SOURCE_} constants.
         * The source of the operation. See {@code SOURCE_} constants. Future versions of Android
         * may pass additional values.
         */
        public @Source int getSource() {
            return mSource;
+6 −5
Original line number Diff line number Diff line
@@ -51838,11 +51838,12 @@ package android.view {
    method @Nullable public android.net.Uri getLinkUri();
    method public int getSource();
    field public static final int FLAG_CONVERT_TO_PLAIN_TEXT = 1; // 0x1
    field public static final int SOURCE_AUTOFILL = 3; // 0x3
    field public static final int SOURCE_CLIPBOARD = 0; // 0x0
    field public static final int SOURCE_DRAG_AND_DROP = 2; // 0x2
    field public static final int SOURCE_INPUT_METHOD = 1; // 0x1
    field public static final int SOURCE_PROCESS_TEXT = 4; // 0x4
    field public static final int SOURCE_APP = 0; // 0x0
    field public static final int SOURCE_AUTOFILL = 4; // 0x4
    field public static final int SOURCE_CLIPBOARD = 1; // 0x1
    field public static final int SOURCE_DRAG_AND_DROP = 3; // 0x3
    field public static final int SOURCE_INPUT_METHOD = 2; // 0x2
    field public static final int SOURCE_PROCESS_TEXT = 5; // 0x5
  }
  public static final class OnReceiveContentCallback.Payload.Builder {