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

Commit f29f2d4a authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Tell the app that a smart reply was used even when it has been edited.

The existing API RemoteInput.Source covers two scenarios for responding
to message notifications:
1. A user uses the 'reply' button and enters a response freely.
2. A user clicks a smart reply which is used as the response.

Before this CL the platform would notify the app of scenario nr. 1 in
the case where we use tap-to-edit smart replies (replies that can be
edited before being sent). With this CL we instead log scenario nr. 2
(since a smart reply was clicked).

Bug: 123407240
Test: use a test-app to ensure that a response created using smart
replies + tap-to-edit logs the correct @Source.
Change-Id: I3dc8169a3c440af106c4f244b72ddf7c9e450203
parent 2a127a77
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -146,7 +146,11 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        Intent fillInIntent = new Intent().addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        RemoteInput.addResultsToIntent(mRemoteInputs, fillInIntent,
                results);
        if (mEntry.editedSuggestionInfo == null) {
            RemoteInput.setResultsSource(fillInIntent, RemoteInput.SOURCE_FREE_FORM_INPUT);
        } else {
            RemoteInput.setResultsSource(fillInIntent, RemoteInput.SOURCE_CHOICE);
        }

        mEditText.setEnabled(false);
        mSendButton.setVisibility(INVISIBLE);