@@ -15,7 +15,6 @@ import org.fcitx.fcitx5.android.input.broadcast.InputBroadcastReceiver
15
15
import org.fcitx.fcitx5.android.input.broadcast.InputBroadcaster
16
16
import org.fcitx.fcitx5.android.input.dependency.UniqueViewComponent
17
17
import org.fcitx.fcitx5.android.input.dependency.context
18
- import org.fcitx.fcitx5.android.utils.isUiThread
19
18
import org.mechdancer.dependency.DynamicScope
20
19
import org.mechdancer.dependency.manager.must
21
20
import org.mechdancer.dependency.minusAssign
@@ -67,7 +66,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
67
66
window : R ,
68
67
createView : Boolean = false
69
68
) where R : W, R : E {
70
- ensureThread()
71
69
if (window.key in essentialWindows) {
72
70
if (essentialWindows[window.key]!! .first == = window)
73
71
Timber .d(" Skip adding essential window $window " )
@@ -90,7 +88,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
90
88
* Moreover, [attachWindow] can also add the essential window with key.
91
89
*/
92
90
fun attachWindow (windowKey : EssentialWindow .Key ) {
93
- ensureThread()
94
91
essentialWindows[windowKey]?.let { (window, _) ->
95
92
attachWindow(window)
96
93
} ? : throw IllegalStateException (" $windowKey is not a known essential window key" )
@@ -116,7 +113,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
116
113
* [attachWindow] includes the operation done by [addEssentialWindow].
117
114
*/
118
115
fun attachWindow (window : InputWindow ) {
119
- ensureThread()
120
116
if (window == = currentWindow)
121
117
Timber .d(" Skip attaching $window " )
122
118
val newView = if (window is EssentialWindow ) {
@@ -168,10 +164,5 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
168
164
this .scope = scope
169
165
}
170
166
171
- private fun ensureThread () {
172
- if (! isUiThread())
173
- throw IllegalThreadStateException (" Window manager must be operated in main thread!" )
174
- }
175
-
176
167
fun isAttached (window : InputWindow ) = currentWindow == = window
177
168
}
0 commit comments