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

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

Suggesting at most three smart actions

Removed Notification.MAX_ACTION_BUTTONS check as we no longer
show smart actions as normal actions. Instead, suggesting at most
3 smart actions.

BUG: 111437455
Test: Manual, observes smart action even the notification always have
     three normal actions.

Change-Id: I9238ef8b74c4f030979cb36cc87eaeff8c777682
parent afafd66d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class SmartActionsHelper {
                    | Notification.FLAG_NO_CLEAR;
    private static final int MAX_ACTION_EXTRACTION_TEXT_LENGTH = 400;
    private static final int MAX_ACTIONS_PER_LINK = 1;
    private static final int MAX_SMART_ACTIONS = Notification.MAX_ACTION_BUTTONS;
    private static final int MAX_SMART_ACTIONS = 3;
    private static final int MAX_SUGGESTED_REPLIES = 3;

    private static final ConversationActions.TypeConfig TYPE_CONFIG =
@@ -81,12 +81,9 @@ public class SmartActionsHelper {
        if (tcm == null) {
            return EMPTY_ACTION_LIST;
        }
        Notification.Action[] actions = entry.getNotification().actions;
        int numOfExistingActions = actions == null ? 0: actions.length;
        int maxSmartActions = MAX_SMART_ACTIONS - numOfExistingActions;
        return suggestActionsFromText(
                tcm,
                getMostSalientActionText(entry.getNotification()), maxSmartActions);
                getMostSalientActionText(entry.getNotification()), MAX_SMART_ACTIONS);
    }

    ArrayList<CharSequence> suggestReplies(