2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/15430: Fix StrictMode death on opening app from widget text search.

This commit is contained in:
mcarare 2020-10-27 16:24:47 +02:00 committed by Mihai Adrian Carare
parent 87ce122d03
commit c66ab231d5

View File

@ -12,6 +12,7 @@ import android.content.DialogInterface
import android.content.Intent import android.content.Intent
import android.graphics.Typeface import android.graphics.Typeface
import android.os.Bundle import android.os.Bundle
import android.os.StrictMode
import android.speech.RecognizerIntent import android.speech.RecognizerIntent
import android.text.style.StyleSpan import android.text.style.StyleSpan
import android.view.LayoutInflater import android.view.LayoutInflater
@ -470,6 +471,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
private fun isSpeechAvailable(): Boolean = speechIntent.resolveActivity(requireContext().packageManager) != null private fun isSpeechAvailable(): Boolean = speechIntent.resolveActivity(requireContext().packageManager) != null
private fun setShortcutsChangedListener(preferenceFileName: String) { private fun setShortcutsChangedListener(preferenceFileName: String) {
requireComponents.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
requireContext().getSharedPreferences( requireContext().getSharedPreferences(
preferenceFileName, preferenceFileName,
Context.MODE_PRIVATE Context.MODE_PRIVATE
@ -477,6 +479,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
awesomeBarView.update(store.state) awesomeBarView.update(store.state)
} }
} }
}
private fun updateClipboardSuggestion(searchState: SearchFragmentState, clipboardUrl: String?) { private fun updateClipboardSuggestion(searchState: SearchFragmentState, clipboardUrl: String?) {
val shouldShowView = searchState.showClipboardSuggestions && val shouldShowView = searchState.showClipboardSuggestions &&