@@ -101,38 +101,38 @@ private class VoiceInputActionWindow(
101
101
val context = manager.getContext()
102
102
103
103
private var shouldPlaySounds: Boolean = false
104
- private suspend fun loadSettings (): RecognizerViewSettings = coroutineScope {
105
- val enableSound = async { context.getSetting(ENABLE_SOUND ) }
106
- val verboseFeedback = async { context.getSetting(VERBOSE_PROGRESS ) }
107
- val disallowSymbols = async { context.getSetting(DISALLOW_SYMBOLS ) }
108
- val useBluetoothAudio = async { context.getSetting(PREFER_BLUETOOTH ) }
109
- val requestAudioFocus = async { context.getSetting(AUDIO_FOCUS ) }
110
- val canExpandSpace = async { context.getSetting(CAN_EXPAND_SPACE ) }
104
+ private fun loadSettings (): RecognizerViewSettings {
105
+ val enableSound = context.getSetting(ENABLE_SOUND )
106
+ val verboseFeedback = context.getSetting(VERBOSE_PROGRESS )
107
+ val disallowSymbols = context.getSetting(DISALLOW_SYMBOLS )
108
+ val useBluetoothAudio = context.getSetting(PREFER_BLUETOOTH )
109
+ val requestAudioFocus = context.getSetting(AUDIO_FOCUS )
110
+ val canExpandSpace = context.getSetting(CAN_EXPAND_SPACE )
111
111
112
112
val primaryModel = model
113
113
val languageSpecificModels = mutableMapOf<Language , ModelLoader >()
114
114
val allowedLanguages = listOf (
115
115
getLanguageFromWhisperString(locale.language)
116
116
).filterNotNull().toSet()
117
117
118
- shouldPlaySounds = enableSound.await()
118
+ shouldPlaySounds = enableSound
119
119
120
- return @coroutineScope RecognizerViewSettings (
120
+ return RecognizerViewSettings (
121
121
shouldShowInlinePartialResult = false ,
122
- shouldShowVerboseFeedback = verboseFeedback.await() ,
122
+ shouldShowVerboseFeedback = verboseFeedback,
123
123
modelRunConfiguration = MultiModelRunConfiguration (
124
124
primaryModel = primaryModel,
125
125
languageSpecificModels = languageSpecificModels
126
126
),
127
127
decodingConfiguration = DecodingConfiguration (
128
128
glossary = state.userDictionaryObserver.getWords().map { it.word },
129
129
languages = allowedLanguages,
130
- suppressSymbols = disallowSymbols.await()
130
+ suppressSymbols = disallowSymbols
131
131
),
132
132
recordingConfiguration = RecordingSettings (
133
- preferBluetoothMic = useBluetoothAudio.await() ,
134
- requestAudioFocus = requestAudioFocus.await() ,
135
- canExpandSpace = canExpandSpace.await()
133
+ preferBluetoothMic = useBluetoothAudio,
134
+ requestAudioFocus = requestAudioFocus,
135
+ canExpandSpace = canExpandSpace
136
136
)
137
137
)
138
138
}
@@ -142,9 +142,7 @@ private class VoiceInputActionWindow(
142
142
143
143
private val initJob = manager.getLifecycleScope().launch {
144
144
yield ()
145
- val settings = withContext(Dispatchers .IO ) {
146
- loadSettings()
147
- }
145
+ val settings = loadSettings()
148
146
149
147
yield ()
150
148
val recognizerView = try {
0 commit comments