mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
Feat:Add per-game frame generation profiles (#2473)
This commit is contained in:
1 parent
b1b6ab7931
commit
b52ce7e4c5
46 files changed
+598
-43
No files matched your search
@@ -452,6 +452,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private var drawerDefaultProton by mutableStateOf<String?>(null)
|
||||
private val drawerComponentMenu by lazy { ComponentsMenu(this, uiHandler) }
|
||||
private var drawerGameProfileId by mutableStateOf<Long?>(null)
|
||||
private var drawerGameProfileSelectionMade = false
|
||||
private var fpsLimit by mutableStateOf(SessionState.fpsLimit)
|
||||
|
||||
private fun noSteamSession(): Boolean = (SessionState.mode == SessionService.MODE_RUN &&
|
||||
@@ -460,7 +461,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
com.droiddeck.launcher.session.NoSteamLaunch.BATTLENET,
|
||||
)) || SessionState.mode == SessionService.MODE_DESKTOP
|
||||
private val drawerGameInventory = GameProfileInventoryCache<Library.SteamGame>()
|
||||
private var drawerGameInventoryRevision = 0L
|
||||
@Volatile private var drawerGameInventoryRevision = 0L
|
||||
private var drawerGameFexPresetSaving by mutableStateOf(false)
|
||||
private var drawerGameNoSteamSaving by mutableStateOf(false)
|
||||
private val drawerGameProfileFollowState = GameProfileFollowState()
|
||||
@@ -556,8 +557,25 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { importLossless(it) }
|
||||
}
|
||||
private var frameGen by mutableStateOf(FrameGen.Mode.OFF)
|
||||
private var frameGenActiveGameId by mutableStateOf<Long?>(null)
|
||||
private var frameGenActiveGameName by mutableStateOf<String?>(null)
|
||||
private var frameGenHasGameOverride by mutableStateOf(false)
|
||||
private var frameGenPip = false
|
||||
private val frameGenRequests = java.util.concurrent.atomic.AtomicInteger()
|
||||
private val frameGenActivityGeneration = synchronized(frameGenGlobalLock) {
|
||||
frameGenGlobalGeneration.incrementAndGet()
|
||||
}
|
||||
@Volatile private var frameGenActivityActive = true
|
||||
private val frameGenForcePending = java.util.concurrent.atomic.AtomicBoolean()
|
||||
@Volatile private var frameGenInventoryIds: Set<Long>? = null
|
||||
@Volatile private var frameGenInventoryRevision = -1L
|
||||
private val frameGenInventoryLock = Any()
|
||||
@Volatile private var frameGenInventoryLastAttemptAt = 0L
|
||||
private val frameGenInventoryRetryScheduled = java.util.concurrent.atomic.AtomicBoolean()
|
||||
private val frameGenInventoryRefreshScheduled = java.util.concurrent.atomic.AtomicBoolean()
|
||||
|
||||
@Volatile private var appliedFrameGenMode: FrameGen.Mode? = null
|
||||
@Volatile private var appliedFrameGenHz: Float? = null
|
||||
private var fexPreset by mutableStateOf("")
|
||||
private var suspendPolicy by mutableStateOf(SessionPrefs.SUSPEND_MANUAL)
|
||||
private var steamDownloadsInBackground by mutableStateOf(false)
|
||||
@@ -859,7 +877,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
hud.attach(root, root.childCount)
|
||||
memoryHud = com.droiddeck.launcher.session.MemoryHud(this)
|
||||
hud.onPresentingWindowChanged = {
|
||||
if (FrameGen.engine(this) != FrameGen.ENGINE_OFF) CompositorHost.rearmFrameGen { applyFrameGen() }
|
||||
CompositorHost.rearmFrameGen { applyFrameGen(force = true) }
|
||||
}
|
||||
if (SessionState.running && SessionState.firstFrameSeen) {
|
||||
loading.visible = false
|
||||
@@ -892,8 +910,24 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
} }
|
||||
glassesScope.launch { com.droiddeck.launcher.handtracking.HandTracking.settings.collect { updateHandCamera() } }
|
||||
glassesScope.launch {
|
||||
var lastRunGameId: String? = null
|
||||
while (true) {
|
||||
updateTrackingRecovery()
|
||||
if (SessionState.mode == SessionService.MODE_RUN) {
|
||||
val gameId = SessionState.gameId
|
||||
?.takeIf { it.toLongOrNull() != null }
|
||||
?: intent.getStringExtra(SessionService.EXTRA_GAME_ID)
|
||||
?.takeIf { it.toLongOrNull() != null }
|
||||
if (gameId != lastRunGameId) {
|
||||
lastRunGameId = gameId
|
||||
if (drawerGameProfileFollowState.followsSteam) {
|
||||
loadFrameGenFor(gameId?.toLongOrNull())
|
||||
}
|
||||
applyFrameGen()
|
||||
}
|
||||
} else {
|
||||
lastRunGameId = null
|
||||
}
|
||||
kotlinx.coroutines.delay(100)
|
||||
}
|
||||
}
|
||||
@@ -956,7 +990,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
applyOutputPacing()
|
||||
if (pipUi != frameGenPip) {
|
||||
frameGenPip = pipUi
|
||||
if (FrameGen.engine(this@SessionActivity) != FrameGen.ENGINE_OFF && ::surfaceView.isInitialized) applyFrameGen()
|
||||
if (::surfaceView.isInitialized) applyFrameGen()
|
||||
}
|
||||
}
|
||||
androidx.compose.runtime.LaunchedEffect(AgentGuest.steamKeyboard) { updateOnScreenControls() }
|
||||
@@ -1032,7 +1066,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
window.setBackgroundDrawable(android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK))
|
||||
},
|
||||
)
|
||||
LaunchedEffect(AgentGuest.focusRevision, secondScreenDisplays.isNotEmpty()) {
|
||||
LaunchedEffect(AgentGuest.focusRevision, secondScreenDisplays.isNotEmpty(), drawerGameInventoryRevision) {
|
||||
val nextGame = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
|
||||
if (SessionState.mode == SessionService.MODE_RUN) SessionState.program?.let { "program:$it" }
|
||||
else {
|
||||
@@ -1045,11 +1079,40 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SessionState.mode == SessionService.MODE_STEAM) {
|
||||
val target = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
|
||||
val games = LibraryCache.load(this@SessionActivity)
|
||||
val cachedIds = games.mapNotNull { it.profileKey.toLongOrNull() }.toSet()
|
||||
val inventoryIds = synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryIds
|
||||
}.orEmpty()
|
||||
val id = AgentGuest.activeSteamAppId(
|
||||
this@SessionActivity, cachedIds + inventoryIds
|
||||
)
|
||||
val name = id?.let { activeId ->
|
||||
games.firstOrNull { it.profileKey == activeId.toString() }?.name
|
||||
}
|
||||
id to name
|
||||
}
|
||||
if (target.first != frameGenActiveGameId) {
|
||||
frameGenActiveGameId = target.first
|
||||
if (drawerGameProfileFollowState.followsSteam) {
|
||||
loadFrameGenFor(target.first)
|
||||
}
|
||||
}
|
||||
frameGenActiveGameName = target.second
|
||||
}
|
||||
if (nextGame != gestureGame) {
|
||||
if (nextGame != null) gameStarts++
|
||||
gestureGame = nextGame
|
||||
refreshGestureConfig()
|
||||
}
|
||||
if (
|
||||
SessionState.mode == SessionService.MODE_STEAM &&
|
||||
CompositorHost.isStarted
|
||||
) {
|
||||
applyFrameGen()
|
||||
}
|
||||
if (secondScreenDisplays.isNotEmpty()) kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
|
||||
runCatching { com.droiddeck.launcher.session.TelemetryOutput.applyAutomatic(this@SessionActivity, nextGame) }
|
||||
}
|
||||
@@ -1234,6 +1297,18 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
textureAnisotropy = if (drawerGameProfileId == null) textureAnisotropy else drawerTextureAnisotropy,
|
||||
textureLodBias = if (drawerGameProfileId == null) textureLodBias else drawerTextureLodBias,
|
||||
frameGen = frameGen,
|
||||
frameGenTargetGameId = frameGenTargetGameId()?.toString(),
|
||||
frameGenTargetGameName = when {
|
||||
!drawerGameProfileFollowState.followsSteam ->
|
||||
drawerGameProfileRefresh.data?.profiles
|
||||
?.firstOrNull { it.first == frameGenTargetGameId() }?.second
|
||||
SessionState.mode == SessionService.MODE_STEAM -> frameGenActiveGameName
|
||||
SessionState.mode == SessionService.MODE_RUN ->
|
||||
com.droiddeck.launcher.frontend.Library.nameForProgram(SessionState.program)
|
||||
else -> drawerGameProfileRefresh.data?.profiles
|
||||
?.firstOrNull { it.first == frameGenTargetGameId() }?.second
|
||||
},
|
||||
hasGameOverride = frameGenHasGameOverride,
|
||||
lossless = lossless,
|
||||
oscMode = oscMode, suspendPolicy = suspendPolicy,
|
||||
steamDownloadsInBackground = steamDownloadsInBackground, touchMode = touchMode,
|
||||
@@ -1293,9 +1368,22 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
applyOutputPacing()
|
||||
},
|
||||
onFrameGenPick = { mode ->
|
||||
FrameGen.set(this@SessionActivity, mode)
|
||||
val appId = frameGenTargetGameId()
|
||||
|
||||
if (appId == null) FrameGen.set(this@SessionActivity, mode)
|
||||
else FrameGen.setForGame(this@SessionActivity, appId.toString(), mode)
|
||||
loadFrameGenFor(appId)
|
||||
readPrefs()
|
||||
applyFrameGen()
|
||||
applyFrameGen(force = true)
|
||||
},
|
||||
onFrameGenReset = {
|
||||
val appId = frameGenTargetGameId()
|
||||
|
||||
if (appId == null) FrameGen.clearGlobal(this@SessionActivity)
|
||||
else FrameGen.clearGame(this@SessionActivity, appId.toString())
|
||||
loadFrameGenFor(appId)
|
||||
readPrefs()
|
||||
applyFrameGen(force = true)
|
||||
},
|
||||
onImportLossless = {
|
||||
pickLossless.launch(InAppFilePicker.buildIntent(
|
||||
@@ -1628,9 +1716,35 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}, "drawer-components").start()
|
||||
}
|
||||
|
||||
private fun frameGenTargetGameId(): Long? {
|
||||
if (!drawerGameProfileFollowState.followsSteam) {
|
||||
return drawerGameProfileId
|
||||
}
|
||||
if (SessionState.mode == SessionService.MODE_RUN) {
|
||||
return (
|
||||
SessionState.gameId?.toLongOrNull()
|
||||
?: intent.getStringExtra(SessionService.EXTRA_GAME_ID)?.toLongOrNull()
|
||||
)
|
||||
}
|
||||
if (SessionState.mode == SessionService.MODE_STEAM) {
|
||||
return frameGenActiveGameId
|
||||
}
|
||||
return drawerGameProfileId
|
||||
}
|
||||
|
||||
private fun loadFrameGenFor(appId: Long?) {
|
||||
val profileId = appId?.toString()
|
||||
frameGen = FrameGen.mode(this, profileId)
|
||||
frameGenHasGameOverride = appId?.let {
|
||||
FrameGen.hasGameOverride(this, it.toString())
|
||||
} == true
|
||||
}
|
||||
|
||||
private fun selectDrawerGameProfile(appId: Long?) {
|
||||
drawerGameProfileFollowState.selectManually()
|
||||
drawerGameProfileSelectionMade = true
|
||||
drawerGameProfileId = appId
|
||||
loadFrameGenFor(frameGenTargetGameId())
|
||||
drawerGameProfileRefresh = drawerGameProfileRefresh.retrying()
|
||||
readDrawerTextureFiltering(appId)
|
||||
refreshDrawerGameProfile()
|
||||
@@ -1703,6 +1817,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (refresh.followsSteam) {
|
||||
if (drawerGameProfileFollowState.followsSteam) {
|
||||
drawerGameProfileId = result.selectedAppId
|
||||
loadFrameGenFor(result.selectedAppId)
|
||||
readDrawerTextureFiltering(result.selectedAppId)
|
||||
}
|
||||
}
|
||||
@@ -1727,6 +1842,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
gameProtonId = ProtonDefault.gameSelectedId(this, game.profileKey, protons),
|
||||
gameComponents = ComponentsManager.gameComponents(this, game.profileKey),
|
||||
gameWindowsComponents = WinComponents.picks(this, game.profileKey),
|
||||
frameGenMode = FrameGen.mode(this, game.profileKey),
|
||||
frameGenInherited = !FrameGen.hasGameOverride(this, game.profileKey),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1970,7 +2087,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (routedTouchMode != nextRoutedTouchMode) gestureTouchStreamGate.reset()
|
||||
routedTouchMode = nextRoutedTouchMode
|
||||
requestRelativeMouse()
|
||||
frameGen = FrameGen.mode(this)
|
||||
loadFrameGenFor(frameGenTargetGameId())
|
||||
fexPreset = SessionPrefs.fexPreset(this)
|
||||
suspendPolicy = SessionPrefs.suspendPolicy(this, SessionState.mode)
|
||||
steamDownloadsInBackground = SessionPrefs.steamDownloadsInBackground(this)
|
||||
@@ -2257,7 +2374,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (resized) {
|
||||
cancelTouchGestures()
|
||||
Log.i(TAG, "surface resized to ${width}x$height - rebinding the compositor")
|
||||
CompositorHost.resize(holder.surface) { applyFrameGen() }
|
||||
CompositorHost.resize(holder.surface) { applyFrameGen(force = true) }
|
||||
resizeOutputForWindow(width, height)
|
||||
}
|
||||
}
|
||||
@@ -2398,17 +2515,161 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyFrameGen() {
|
||||
private fun frameGenModeForActiveGame(request: Int): FrameGen.Mode {
|
||||
if (SessionState.mode == SessionService.MODE_RUN) {
|
||||
val activeAppId = (
|
||||
SessionState.gameId?.takeIf { it.toLongOrNull() != null }
|
||||
?: intent.getStringExtra(SessionService.EXTRA_GAME_ID)
|
||||
)?.toLongOrNull()
|
||||
return FrameGen.mode(this, activeAppId?.toString())
|
||||
}
|
||||
|
||||
val cachedIds = LibraryCache.load(this)
|
||||
.mapNotNull { it.profileKey.toLongOrNull() }
|
||||
.toSet()
|
||||
|
||||
var inventoryRevision = drawerGameInventoryRevision
|
||||
var ids = synchronized(frameGenInventoryLock) {
|
||||
if (frameGenInventoryRevision != inventoryRevision) {
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryRevision = inventoryRevision
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
}
|
||||
frameGenInventoryIds
|
||||
}
|
||||
if (ids == null) {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
val shouldScan = synchronized(frameGenInventoryLock) {
|
||||
val currentRevision = drawerGameInventoryRevision
|
||||
if (frameGenInventoryRevision != currentRevision) {
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryRevision = currentRevision
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
}
|
||||
inventoryRevision = currentRevision
|
||||
if (frameGenInventoryIds != null) {
|
||||
false
|
||||
} else if (
|
||||
frameGenInventoryLastAttemptAt != 0L &&
|
||||
now - frameGenInventoryLastAttemptAt < 15_000L
|
||||
) {
|
||||
false
|
||||
} else {
|
||||
frameGenInventoryLastAttemptAt = now
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldScan) {
|
||||
val currentIds = runCatching {
|
||||
Library.launchableGames(this, strictRead = true)
|
||||
.mapNotNull { it.profileKey.toLongOrNull() }
|
||||
.toSet()
|
||||
}.getOrNull()
|
||||
|
||||
if (currentIds == null) {
|
||||
if (frameGenInventoryRetryScheduled.compareAndSet(false, true)) {
|
||||
uiHandler.postDelayed({
|
||||
frameGenInventoryRetryScheduled.set(false)
|
||||
val retry = synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryIds == null
|
||||
}
|
||||
if (retry && !isFinishing && !isDestroyed) {
|
||||
applyFrameGen()
|
||||
}
|
||||
}, 15_000L)
|
||||
}
|
||||
} else {
|
||||
var published = false
|
||||
synchronized(frameGenInventoryLock) {
|
||||
if (drawerGameInventoryRevision == inventoryRevision &&
|
||||
frameGenInventoryRevision == inventoryRevision
|
||||
) {
|
||||
ids = cachedIds + currentIds
|
||||
frameGenInventoryIds = ids
|
||||
published = true
|
||||
}
|
||||
}
|
||||
if (published) {
|
||||
if (frameGenInventoryRefreshScheduled.compareAndSet(false, true)) {
|
||||
uiHandler.postDelayed({
|
||||
frameGenInventoryRefreshScheduled.set(false)
|
||||
if (frameGenActivityActive && !isFinishing && !isDestroyed) {
|
||||
synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
}
|
||||
applyFrameGen()
|
||||
}
|
||||
}, 15_000L)
|
||||
}
|
||||
if (frameGenRequests.get() != request) {
|
||||
applyFrameGen()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ids == null) {
|
||||
ids = synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryIds
|
||||
} ?: emptySet()
|
||||
}
|
||||
}
|
||||
|
||||
val activeAppId = AgentGuest.activeSteamAppId(
|
||||
this, cachedIds + (ids ?: emptySet())
|
||||
)
|
||||
if (activeAppId == null) return FrameGen.Mode.OFF
|
||||
return FrameGen.mode(this, activeAppId.toString())
|
||||
}
|
||||
|
||||
private fun applyFrameGen(force: Boolean = false) {
|
||||
val request = synchronized(frameGenGlobalLock) {
|
||||
if (force) frameGenForcePending.set(true)
|
||||
frameGenRequests.incrementAndGet()
|
||||
}
|
||||
val hz = refreshHz()
|
||||
val pip = pipUi && mirrorRefreshLimit() <= 0
|
||||
val request = frameGenRequests.incrementAndGet()
|
||||
Thread({
|
||||
val problem = synchronized(frameGenRequests) {
|
||||
val mode = if (pip) FrameGen.Mode.OFF else frameGenModeForActiveGame(request)
|
||||
val needsApply = synchronized(frameGenGlobalLock) {
|
||||
if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@Thread
|
||||
if (request != frameGenRequests.get()) return@Thread
|
||||
if (pip) FrameGen.apply(this, FrameGen.Mode.OFF, hz) else FrameGen.apply(this, hz)
|
||||
if (!frameGenActivityActive || isFinishing || isDestroyed) return@Thread
|
||||
val lastAppliedHz = appliedFrameGenHz
|
||||
frameGenForcePending.get() || appliedFrameGenMode == null ||
|
||||
mode != appliedFrameGenMode || lastAppliedHz == null ||
|
||||
kotlin.math.abs(lastAppliedHz - hz) > 0.1f
|
||||
}
|
||||
val prepared = if (needsApply) FrameGen.prepareApply(this, mode) else null
|
||||
val problem = synchronized(frameGenGlobalLock) {
|
||||
if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@Thread
|
||||
if (request != frameGenRequests.get()) return@Thread
|
||||
if (!frameGenActivityActive || isFinishing || isDestroyed) return@Thread
|
||||
val forcePending = frameGenForcePending.get()
|
||||
val lastAppliedHz = appliedFrameGenHz
|
||||
if (!forcePending && appliedFrameGenMode != null && mode == appliedFrameGenMode &&
|
||||
lastAppliedHz != null && kotlin.math.abs(lastAppliedHz - hz) <= 0.1f
|
||||
) {
|
||||
null
|
||||
} else {
|
||||
val ready = prepared ?: return@Thread
|
||||
frameGenForcePending.set(false)
|
||||
FrameGen.applyPrepared(this, ready, hz).also { problem ->
|
||||
if (problem == null) {
|
||||
appliedFrameGenMode = mode
|
||||
appliedFrameGenHz = hz
|
||||
} else {
|
||||
appliedFrameGenMode = null
|
||||
appliedFrameGenHz = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val state = Lossless.state(this)
|
||||
runOnUiThread {
|
||||
if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@runOnUiThread
|
||||
lossless = state
|
||||
if (problem != null) Toast.makeText(this, problem, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
@@ -2425,12 +2686,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
|
||||
private fun importLossless(dll: File) {
|
||||
Thread({
|
||||
val message = Lossless.message(this, Lossless.import(this, dll))
|
||||
val result = Lossless.import(this, dll)
|
||||
val message = Lossless.message(this, result)
|
||||
val state = Lossless.state(this)
|
||||
runOnUiThread {
|
||||
lossless = state
|
||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
|
||||
if (FrameGen.engine(this) == FrameGen.ENGINE_LSFG) applyFrameGen()
|
||||
applyFrameGen(force = result == Lossless.ImportResult.UPDATED)
|
||||
}
|
||||
}, "lossless-import").start()
|
||||
}
|
||||
@@ -4708,12 +4970,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
drawerGameInventoryRevision++
|
||||
com.droiddeck.launcher.input.SystemKeyCapture.attach(this, { hasWindowFocus() && !appUiOwnsPointer() && CompositorHost.isStarted }) { event ->
|
||||
com.droiddeck.launcher.input.GuestKeys.send(event) { code, down -> sendGuestKey(code, down, 8) }
|
||||
}
|
||||
if (refreshActivityDisplayId() && started) {
|
||||
SessionService.setActivityDisplay(this, sessionActivityDisplayId)
|
||||
}
|
||||
if (CompositorHost.isStarted) applyFrameGen(force = true)
|
||||
applyFollowOrientation(resources.configuration)
|
||||
if (runtimeRemovalBlocked) return
|
||||
if (!SessionState.suspended) pausedFrame = null
|
||||
@@ -5391,6 +5655,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
synchronized(frameGenGlobalLock) {
|
||||
frameGenActivityActive = false
|
||||
frameGenRequests.incrementAndGet()
|
||||
}
|
||||
if (AgentGuest.readyListener === agentReadyListener) AgentGuest.readyListener = null
|
||||
com.droiddeck.launcher.input.HomeButtonShortcuts.detach(this)
|
||||
relativeMouseRequests.shutdownNow()
|
||||
@@ -5505,6 +5773,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private const val BOTTOM_RECOVERY_MS = 1_000L
|
||||
private const val BOTTOM_RECOVERY_TRIES = 3
|
||||
private const val TAG = "SessionActivity"
|
||||
private val frameGenGlobalLock = Any()
|
||||
private val frameGenGlobalGeneration = java.util.concurrent.atomic.AtomicLong(0L)
|
||||
private var startedScreens = 0
|
||||
@Volatile private var activeInstallWorker: Any? = null
|
||||
private const val FEX_MISSING = "droiddeck-fex: x86 Linux programs need"
|
||||
|
||||
Reference in new issue
Block a user