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

Commit fcf5da1a authored by Steve Elliott's avatar Steve Elliott Committed by Android (Google) Code Review
Browse files

Merge "Fix incorrect RemoteInput result source" into tm-dev

parents 3a6360c1 4c1d687b
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -299,10 +299,7 @@ class RemoteInputViewControllerImpl @Inject constructor(
        view.clearAttachment()
        view.clearAttachment()
        entry.remoteInputUri = null
        entry.remoteInputUri = null
        entry.remoteInputMimeType = null
        entry.remoteInputMimeType = null
        val resultSource = entry.editedSuggestionInfo
        RemoteInput.setResultsSource(fillInIntent, remoteInputResultsSource)
                ?.let { RemoteInput.SOURCE_FREE_FORM_INPUT }
                ?: RemoteInput.SOURCE_CHOICE
        RemoteInput.setResultsSource(fillInIntent, resultSource)
        return fillInIntent
        return fillInIntent
    }
    }


@@ -332,10 +329,12 @@ class RemoteInputViewControllerImpl @Inject constructor(
        entry.remoteInputText = fullText
        entry.remoteInputText = fullText


        // mirror prepareRemoteInputFromText for text input
        // mirror prepareRemoteInputFromText for text input
        val resultSource = entry.editedSuggestionInfo
        RemoteInput.setResultsSource(fillInIntent, remoteInputResultsSource)
                ?.let { RemoteInput.SOURCE_FREE_FORM_INPUT }
                ?: RemoteInput.SOURCE_CHOICE
        RemoteInput.setResultsSource(fillInIntent, resultSource)
        return fillInIntent
        return fillInIntent
    }
    }

    private val remoteInputResultsSource
        get() = entry.editedSuggestionInfo
                ?.let { RemoteInput.SOURCE_CHOICE }
                ?: RemoteInput.SOURCE_FREE_FORM_INPUT
}
}