mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Fixes websocket subscription, date invalidation, & theme music (#616)
## Description Makes sure the `ServerEventListener` and `DatePlayedInvalidationService` are injected so that they run. This was broken in #538. Also fixes the a delayed stopping of theme music Also fixes for detecting a non-seamless refresh rate switch ### Related issues Fixes #615 Fixes #568
This commit is contained in:
parent
d15ffa13b8
commit
0958578082
8 changed files with 29 additions and 22 deletions
|
|
@ -95,13 +95,13 @@ class RefreshRateService
|
|||
} catch (ex: InterruptedException) {
|
||||
Timber.w(ex, "Exception waiting for refresh rate switch")
|
||||
}
|
||||
val targetRate = (targetMode.refreshRate * 100).roundToInt()
|
||||
val targetRate = (targetMode.refreshRate * 1000).roundToInt()
|
||||
val isSeamless =
|
||||
targetRate == (display.mode.refreshRate * 100).roundToInt() ||
|
||||
targetRate == (currentDisplayMode.refreshRate * 1000).roundToInt() ||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
display.mode.alternativeRefreshRates
|
||||
.map { (it * 100).roundToInt() }
|
||||
.any { targetRate % it == 0 }
|
||||
currentDisplayMode.alternativeRefreshRates
|
||||
.map { (it * 1000).roundToInt() }
|
||||
.any { it % targetRate == 0 }
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@ class ThemeSongPlayer
|
|||
}
|
||||
|
||||
fun stop() {
|
||||
Timber.v("Stopping theme song")
|
||||
player.stop()
|
||||
if (player.isPlaying) {
|
||||
Timber.v("Stopping theme song")
|
||||
player.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue