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

Commit a396be45 authored by Tony Mak's avatar Tony Mak
Browse files

Suggest ADD_CONTACT action by default

The model now generates add_contact action as well.

Test: Send myself a message with phone number. Observe add contact action.
Change-Id: Id5e02334f46f92ddac2834b9f508fc15ab6e29da
parent 580a7429
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ public final class ConversationAction implements Parcelable {
     */
    public static final String TYPE_SHARE_LOCATION = "share_location";

    /** @hide **/
    public static final String TYPE_ADD_CONTACT = "add_contact";

    public static final Creator<ConversationAction> CREATOR =
            new Creator<ConversationAction>() {
                @Override
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ public final class TextClassificationConstants {
                    .add(ConversationAction.TYPE_TRACK_FLIGHT)
                    .add(ConversationAction.TYPE_VIEW_CALENDAR)
                    .add(ConversationAction.TYPE_VIEW_MAP)
                    .add(ConversationAction.TYPE_ADD_CONTACT)
                    .toString();
    /**
     * < 0  : Not set. Use value from LangId model.
+4 −2
Original line number Diff line number Diff line
@@ -195,11 +195,13 @@ public class TextClassificationConstantsTest {
        assertWithMessage("in_app_conversation_action_types_default")
                .that(constants.getInAppConversationActionTypes())
                .containsExactly("text_reply", "create_reminder", "call_phone", "open_url",
                        "send_email", "send_sms", "track_flight", "view_calendar", "view_map");
                        "send_email", "send_sms", "track_flight", "view_calendar", "view_map",
                        "add_contact");
        assertWithMessage("notification_conversation_action_types_default")
                .that(constants.getNotificationConversationActionTypes())
                .containsExactly("text_reply", "create_reminder", "call_phone", "open_url",
                        "send_email", "send_sms", "track_flight", "view_calendar", "view_map");
                        "send_email", "send_sms", "track_flight", "view_calendar", "view_map",
                        "add_contact");
        assertWithMessage("lang_id_threshold_override")
                .that(constants.getLangIdThresholdOverride()).isWithin(EPSILON).of(-1f);
    }