mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Fix some cases when refresh rate switching didn't work/timed out (#901)
## Description An attempt to fix #769 1. Always fetch the `DisplayManager` when switching refresh rates 2. Use the Activity context instead of Application context ### Related issues Fixes #769 ### Testing I still haven't reproduced #769 myself, but this change works fine on my shield + LG C2 ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
0276c5f49b
commit
dc3c6dc739
3 changed files with 24 additions and 19 deletions
|
|
@ -409,7 +409,7 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
fun changeDisplayMode(modeId: Int) {
|
||||
lifecycleScope.launch(Dispatchers.Main + ExceptionHandler()) {
|
||||
lifecycleScope.launch(Dispatchers.Main + ExceptionHandler(autoToast = true)) {
|
||||
val attrs = window.attributes
|
||||
if (attrs.preferredDisplayModeId != modeId) {
|
||||
Timber.d("Switch preferredDisplayModeId to %s", modeId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue