diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt index bd878750dfe16..f8451017b367b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt @@ -299,10 +299,7 @@ class RemoteInputViewControllerImpl @Inject constructor( view.clearAttachment() entry.remoteInputUri = null entry.remoteInputMimeType = null - val resultSource = entry.editedSuggestionInfo - ?.let { RemoteInput.SOURCE_FREE_FORM_INPUT } - ?: RemoteInput.SOURCE_CHOICE - RemoteInput.setResultsSource(fillInIntent, resultSource) + RemoteInput.setResultsSource(fillInIntent, remoteInputResultsSource) return fillInIntent } @@ -332,10 +329,12 @@ class RemoteInputViewControllerImpl @Inject constructor( entry.remoteInputText = fullText // mirror prepareRemoteInputFromText for text input - val resultSource = entry.editedSuggestionInfo - ?.let { RemoteInput.SOURCE_FREE_FORM_INPUT } - ?: RemoteInput.SOURCE_CHOICE - RemoteInput.setResultsSource(fillInIntent, resultSource) + RemoteInput.setResultsSource(fillInIntent, remoteInputResultsSource) return fillInIntent } + + private val remoteInputResultsSource + get() = entry.editedSuggestionInfo + ?.let { RemoteInput.SOURCE_CHOICE } + ?: RemoteInput.SOURCE_FREE_FORM_INPUT }