diff options
| author | 2019-04-02 15:10:00 +0100 | |
|---|---|---|
| committer | 2019-04-03 14:51:28 +0100 | |
| commit | f29f2d4adab511e6b43ac05e32526274d9f26db2 (patch) | |
| tree | 3997b19cc09881131212f84bfa7f3abc378c3095 | |
| parent | 2a127a77fe2e85d98c6a2ab0997c7ab6fdbb9f32 (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index 1e090630efdb..c1950a21d10f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -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); - RemoteInput.setResultsSource(fillInIntent, RemoteInput.SOURCE_FREE_FORM_INPUT); + 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); |