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

Commit 75117954 authored by Steve Elliott's avatar Steve Elliott Committed by Automerger Merge Worker
Browse files

Merge "Fix incorrect RemoteInput result source" into tm-dev am: fcf5da1a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17206383

Change-Id: Ib0abb9e4cddd4cdf79cb7a9a3a39ed58c8d7e100
parents 8590bdea fcf5da1a
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -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
}