Skip to content

Commit 7827e0d

Browse files
committed
Remove InputWindowManager#ensureThread
1 parent 9f41be7 commit 7827e0d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

app/src/main/java/org/fcitx/fcitx5/android/input/wm/InputWindowManager.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.fcitx.fcitx5.android.input.broadcast.InputBroadcastReceiver
1515
import org.fcitx.fcitx5.android.input.broadcast.InputBroadcaster
1616
import org.fcitx.fcitx5.android.input.dependency.UniqueViewComponent
1717
import org.fcitx.fcitx5.android.input.dependency.context
18-
import org.fcitx.fcitx5.android.utils.isUiThread
1918
import org.mechdancer.dependency.DynamicScope
2019
import org.mechdancer.dependency.manager.must
2120
import org.mechdancer.dependency.minusAssign
@@ -67,7 +66,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
6766
window: R,
6867
createView: Boolean = false
6968
) where R : W, R : E {
70-
ensureThread()
7169
if (window.key in essentialWindows) {
7270
if (essentialWindows[window.key]!!.first === window)
7371
Timber.d("Skip adding essential window $window")
@@ -90,7 +88,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
9088
* Moreover, [attachWindow] can also add the essential window with key.
9189
*/
9290
fun attachWindow(windowKey: EssentialWindow.Key) {
93-
ensureThread()
9491
essentialWindows[windowKey]?.let { (window, _) ->
9592
attachWindow(window)
9693
} ?: throw IllegalStateException("$windowKey is not a known essential window key")
@@ -116,7 +113,6 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
116113
* [attachWindow] includes the operation done by [addEssentialWindow].
117114
*/
118115
fun attachWindow(window: InputWindow) {
119-
ensureThread()
120116
if (window === currentWindow)
121117
Timber.d("Skip attaching $window")
122118
val newView = if (window is EssentialWindow) {
@@ -168,10 +164,5 @@ class InputWindowManager : UniqueViewComponent<InputWindowManager, FrameLayout>(
168164
this.scope = scope
169165
}
170166

171-
private fun ensureThread() {
172-
if (!isUiThread())
173-
throw IllegalThreadStateException("Window manager must be operated in main thread!")
174-
}
175-
176167
fun isAttached(window: InputWindow) = currentWindow === window
177168
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy