@@ -188,9 +188,9 @@ open class AnkiDroidApp :
188188 setWebContentsDebuggingEnabled(Prefs .isWebDebugEnabled)
189189
190190 setupContextMenus()
191- setupNotificationChannels(applicationContext)
192191
193192 setup(" makeBackendUsable" ) { makeBackendUsable(this ) }
193+ setupNotifications()
194194
195195 // Probe WebView availability before any other init touches it (#5794).
196196 if (! checkWebViewAvailable()) {
@@ -203,16 +203,6 @@ open class AnkiDroidApp :
203203
204204 initializeAnkiDroidDirectory()
205205
206- val context = this .withAppLocale()
207- if (Prefs .newReviewRemindersEnabled) {
208- Timber .i(" Setting review reminder notifications if they have not already been set" )
209- AlarmManagerService .scheduleAllNotifications(context)
210- } else {
211- // Register for notifications
212- Timber .i(" AnkiDroidApp: Starting Services" )
213- notifications.observeForever { NotificationService .triggerNotificationFor(context) }
214- }
215-
216206 // listen for day rollover: time + timezone changes
217207 DayRolloverHandler .listenForRolloverEvents(this )
218208 DayRolloverAlarm .scheduleNext(this )
@@ -324,6 +314,21 @@ open class AnkiDroidApp :
324314 )
325315 }
326316
317+ private fun setupNotifications () =
318+ setup(" setupNotifications" ) {
319+ setupNotificationChannels(applicationContext)
320+
321+ val context = this .withAppLocale()
322+ if (Prefs .newReviewRemindersEnabled) {
323+ Timber .i(" Setting review reminder notifications if they have not already been set" )
324+ AlarmManagerService .scheduleAllNotifications(context)
325+ } else {
326+ // Register for notifications
327+ Timber .i(" AnkiDroidApp: Starting Services" )
328+ notifications.observeForever { NotificationService .triggerNotificationFor(context) }
329+ }
330+ }
331+
327332 private fun setupLifecycleLogging () =
328333 setup(" setupLifecycleLogging" ) {
329334 registerActivityLifecycleCallbacks(
0 commit comments