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

Commit f014d01c authored by Tony Mak's avatar Tony Mak Committed by Android (Google) Code Review
Browse files

Merge changes from topic "action-intent"

* changes:
  Update ExtService to use suggestConversationActions
  Support intent configuration for actions
parents 40c96fbc e1a27ac0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -53565,7 +53565,7 @@ package android.view.textclassifier {
    method @NonNull public java.util.List<android.view.textclassifier.ConversationActions.Message> getConversation();
    method @Nullable public String getConversationId();
    method @Nullable public java.util.List<java.lang.String> getHints();
    method @IntRange(from=0) public int getMaxSuggestions();
    method @IntRange(from=0xffffffff) public int getMaxSuggestions();
    method @NonNull public android.view.textclassifier.TextClassifier.EntityConfig getTypeConfig();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.ConversationActions.Request> CREATOR;
@@ -53578,7 +53578,7 @@ package android.view.textclassifier {
    method @NonNull public android.view.textclassifier.ConversationActions.Request build();
    method @NonNull public android.view.textclassifier.ConversationActions.Request.Builder setConversationId(@Nullable String);
    method public android.view.textclassifier.ConversationActions.Request.Builder setHints(@Nullable java.util.List<java.lang.String>);
    method @NonNull public android.view.textclassifier.ConversationActions.Request.Builder setMaxSuggestions(@IntRange(from=0) int);
    method @NonNull public android.view.textclassifier.ConversationActions.Request.Builder setMaxSuggestions(@IntRange(from=0xffffffff) int);
    method @NonNull public android.view.textclassifier.ConversationActions.Request.Builder setTypeConfig(@Nullable android.view.textclassifier.TextClassifier.EntityConfig);
  }
+2 −0
Original line number Diff line number Diff line
@@ -5752,6 +5752,8 @@ package android.provider {
  public static interface DeviceConfig.NotificationAssistant {
    field public static final String GENERATE_ACTIONS = "generate_actions";
    field public static final String GENERATE_REPLIES = "generate_replies";
    field public static final String MAX_MESSAGES_TO_EXTRACT = "max_messages_to_extract";
    field public static final String MAX_SUGGESTIONS = "max_suggestions";
    field public static final String NAMESPACE = "notification_assistant";
  }
+4 −0
Original line number Diff line number Diff line
@@ -147,6 +147,10 @@ public final class DeviceConfig {
         * Whether the Notification Assistant should generate contextual actions for notifications.
         */
        String GENERATE_ACTIONS = "generate_actions";

        String MAX_MESSAGES_TO_EXTRACT = "max_messages_to_extract";

        String MAX_SUGGESTIONS = "max_suggestions";
    }

    /**
+7 −7
Original line number Diff line number Diff line
@@ -393,9 +393,10 @@ public final class ConversationActions implements Parcelable {
        }

        /**
         * Return the maximal number of suggestions the caller wants, value 0 means no restriction.
         * Return the maximal number of suggestions the caller wants, value -1 means no restriction
         * and this is the default.
         */
        @IntRange(from = 0)
        @IntRange(from = -1)
        public int getMaxSuggestions() {
            return mMaxSuggestions;
        }
@@ -443,7 +444,7 @@ public final class ConversationActions implements Parcelable {
            private List<Message> mConversation;
            @Nullable
            private TextClassifier.EntityConfig mTypeConfig;
            private int mMaxSuggestions;
            private int mMaxSuggestions = -1;
            @Nullable
            private String mConversationId;
            @Nullable
@@ -477,12 +478,11 @@ public final class ConversationActions implements Parcelable {
            }

            /**
             * Sets the maximum number of suggestions you want.
             * <p>
             * Value 0 means no restriction.
             * Sets the maximum number of suggestions you want. Value -1 means no restriction and
             * this is the default.
             */
            @NonNull
            public Builder setMaxSuggestions(@IntRange(from = 0) int maxSuggestions) {
            public Builder setMaxSuggestions(@IntRange(from = -1) int maxSuggestions) {
                mMaxSuggestions = Preconditions.checkArgumentNonnegative(maxSuggestions);
                return this;
            }
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ public interface IntentFactory {
                new Intent(Intent.ACTION_TRANSLATE)
                        // TODO: Probably better to introduce a "translate" scheme instead of
                        // using EXTRA_TEXT.
                        .putExtra(Intent.EXTRA_TEXT, text),
                        .putExtra(Intent.EXTRA_TEXT, text)
                        .putExtra(TextClassifier.EXTRA_FROM_TEXT_CLASSIFIER, true),
                text.hashCode()));
    }
}
Loading