Skip to content

Commit 1bcc20b

Browse files
david-allisoncriticalAY
authored andcommitted
refactor(startup): extract and profile setupTextToSpeech
Part of 20168
1 parent 7abc2c3 commit 1bcc20b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ open class AnkiDroidApp :
190190

191191
setupLifecycleLogging()
192192
activityAgnosticDialogs = ActivityAgnosticDialogs.register(this)
193-
TtsVoices.launchBuildLocalesJob()
194-
// enable {{tts-voices:}} field filter
195-
TtsVoicesFieldFilter.ensureApplied()
193+
setupTextToSpeech()
196194
}
197195

198196
/**
@@ -417,6 +415,14 @@ open class AnkiDroidApp :
417415
)
418416
}
419417

418+
private fun setupTextToSpeech() {
419+
setup("setupTextToSpeech") {
420+
TtsVoices.launchBuildLocalesJob()
421+
// enable {{tts-voices:}} field filter
422+
TtsVoicesFieldFilter.ensureApplied()
423+
}
424+
}
425+
420426
/**
421427
* @return the app version, OS version and device model, provided when syncing.
422428
*/

0 commit comments

Comments
 (0)