|
1 | | -// SPDX-FileCopyrightText: 2015 - 2024 Rime community |
2 | | -// |
3 | | -// SPDX-License-Identifier: GPL-3.0-or-later |
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: 2015 - 2025 Rime community |
| 3 | + * SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | + */ |
4 | 5 |
|
5 | 6 | package com.osfans.trime.ime.core |
6 | 7 |
|
@@ -45,6 +46,7 @@ import com.osfans.trime.daemon.RimeSession |
45 | 46 | import com.osfans.trime.data.prefs.AppPrefs |
46 | 47 | import com.osfans.trime.data.prefs.PreferenceDelegate |
47 | 48 | import com.osfans.trime.data.prefs.PreferenceDelegateProvider |
| 49 | +import com.osfans.trime.data.soundeffect.SoundEffectManager |
48 | 50 | import com.osfans.trime.data.theme.ColorManager |
49 | 51 | import com.osfans.trime.data.theme.Theme |
50 | 52 | import com.osfans.trime.data.theme.ThemeManager |
@@ -177,20 +179,13 @@ open class TrimeInputMethodService : LifecycleInputMethodService() { |
177 | 179 | ThemeManager.init(resources.configuration) |
178 | 180 | ThemeManager.addOnChangedListener(onThemeChangeListener) |
179 | 181 | ColorManager.addOnChangedListener(onColorChangeListener) |
| 182 | + SoundEffectManager.init() |
| 183 | + InputFeedbackManager.init(this) |
| 184 | + registerReceiver() |
180 | 185 | super.onCreate() |
| 186 | + Timber.d("onCreate") |
181 | 187 | decorView = window.window!!.decorView |
182 | 188 | contentView = decorView.findViewById(android.R.id.content) |
183 | | - // MUST WRAP all code within Service onCreate() in try..catch to prevent any crash loops |
184 | | - try { |
185 | | - // Additional try..catch wrapper as the event listeners chain or the super.onCreate() method |
186 | | - // could crash |
187 | | - // and lead to a crash loop |
188 | | - Timber.d("onCreate") |
189 | | - InputFeedbackManager.init(this) |
190 | | - registerReceiver() |
191 | | - } catch (e: Exception) { |
192 | | - Timber.e(e) |
193 | | - } |
194 | 189 | } |
195 | 190 |
|
196 | 191 | private fun handleRimeMessage(it: RimeMessage<*>) { |
|
0 commit comments