Fix incorrect RemoteInput result source
Conditional was accidentally flipped in a previous change. This change also de-dupes the problematic code. Test: atest RemoteInputViewTest Fixes: 224824265 Change-Id: I75fc4b77ea76b9166df0ef4f54a27d0381ba492a
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user