diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt index 3540c697ee..34786fed0f 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt @@ -12,6 +12,7 @@ import android.content.DialogInterface import android.content.Intent import android.graphics.Typeface import android.os.Bundle +import android.os.StrictMode import android.speech.RecognizerIntent import android.text.style.StyleSpan import android.view.LayoutInflater @@ -470,11 +471,13 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler { private fun isSpeechAvailable(): Boolean = speechIntent.resolveActivity(requireContext().packageManager) != null private fun setShortcutsChangedListener(preferenceFileName: String) { - requireContext().getSharedPreferences( - preferenceFileName, - Context.MODE_PRIVATE - ).registerOnSharedPreferenceChangeListener(viewLifecycleOwner) { _, _ -> - awesomeBarView.update(store.state) + requireComponents.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) { + requireContext().getSharedPreferences( + preferenceFileName, + Context.MODE_PRIVATE + ).registerOnSharedPreferenceChangeListener(viewLifecycleOwner) { _, _ -> + awesomeBarView.update(store.state) + } } }