mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +00:00
fix(session): show the recorded reason when a session fails to start (#2841)
* fix(session): show the recorded reason when a session fails to start The ended screen now shows any recorded start-up failure message except a plain guest exit, not only PROOT_MISSING. The graphics runtime staging and game environment publish failures now record GRAPHICS_RUNTIME_FAILED and GAME_ENVIRONMENT_FAILED with their own messages instead of looking like a guest exit. * i18n(session): translate the start failure messages --------- Co-authored-by: Tapuuk <177422350+Tapuuk@users.noreply.github.com> Co-authored-by: maxjivi05 <maxjividen@gmail.com>
This commit is contained in:
36 files changed
+96
-3
No files matched your search
@@ -3304,8 +3304,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
}
|
||||
|
||||
private fun prootFailureHint(): EndHint? {
|
||||
if (SessionState.failureCode != "PROOT_MISSING") return null
|
||||
private fun startFailureHint(): EndHint? {
|
||||
val code = SessionState.failureCode ?: return null
|
||||
if (code == "GUEST_EXIT") return null
|
||||
val message = SessionState.failureMessage ?: return null
|
||||
return EndHint(message)
|
||||
}
|
||||
@@ -3315,7 +3316,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
private fun sessionExitHint(status: Int): EndHint? = if (status == 0) presentationFaultHint()
|
||||
else runtimeDamageHint() ?: sessionEndHint(SessionState.logFile) ?: prootFailureHint()
|
||||
else runtimeDamageHint() ?: sessionEndHint(SessionState.logFile) ?: startFailureHint()
|
||||
|
||||
private fun sessionEndHint(log: File?): EndHint? {
|
||||
presentationFaultHint()?.let { return it }
|
||||
|
||||
@@ -566,6 +566,7 @@ class SessionService : Service() {
|
||||
SessionFiles.stage(this, root, startsSession = true)
|
||||
} catch (error: Exception) {
|
||||
Log.e(TAG, "Could not prepare the session graphics runtime", error)
|
||||
failSession(gen, "GRAPHICS_RUNTIME_FAILED", getString(R.string.session_graphics_runtime_failed), -1)
|
||||
stopSession(-1, gen)
|
||||
return
|
||||
}
|
||||
@@ -589,6 +590,7 @@ class SessionService : Service() {
|
||||
SessionEvents.step("game-environment") { GameEnvironmentStore.publish(this) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "could not publish the game environment", e)
|
||||
failSession(gen, "GAME_ENVIRONMENT_FAILED", getString(R.string.session_game_environment_failed), -1)
|
||||
stopSession(-1, gen)
|
||||
abandonStart(gen, sessionDir)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user