Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rime.getInstance() 使用 Main Thread 引起 ANR #1146

Closed
goofyz opened this issue Dec 13, 2023 · 0 comments · Fixed by #1152
Closed

Rime.getInstance() 使用 Main Thread 引起 ANR #1146

goofyz opened this issue Dec 13, 2023 · 0 comments · Fixed by #1152

Comments

@goofyz
Copy link
Collaborator

goofyz commented Dec 13, 2023

Describe the bug
呼叫 Rime.getInstance() 時會執行 Rime 相關的檢查和進行部署。取決於方案的大小和多寡,這是一個較費時的動作。正常來說,應該要在 background thread 中執行此動作,但因為同文在不同地方濫用 Rime.getInstance(),結果造成在 Main Thread 中執行,非常容易的引致 ANR (Android Not Responding)。
#949#849 基本上也是此問題引致。

To Reproduce
Steps to reproduce the bug:

  1. 先放 rime schema files 到 /storage/rime/
  2. 安裝 Trime
  3. 開啟 Trime,選擇 Trime 輸入法
  4. Trime 會自動部署,同時畫面沒有反應。隔一會後會出現「沒有回應,關閉程式」等字眼

Expected behavior
同文在背景 deploy,UI 在任何時候皆有回應

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant