mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
chore: drop the comments this change added
This commit is contained in:
1 parent
2d9d4dbeb0
commit
4a57c6f6f1
8 files changed
-46
No files matched your search
@@ -131,10 +131,6 @@ class LoadingState(context: Context, private val steam: Boolean = true) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* What a Steam client download line says to show and how far it is: megabytes when the
|
||||
* runtime counts them ("<part> (2/17), 45 of 360 MB"), else the part and its number.
|
||||
*/
|
||||
internal fun clientDownload(line: String): Pair<String, Int>? {
|
||||
val count = INSTALL_COUNT.find(line) ?: return null
|
||||
val mb = INSTALL_MEGABYTES.find(line.substring(count.range.last + 1))
|
||||
|
||||
@@ -71,11 +71,6 @@ class SessionService : Service() {
|
||||
private val steamDownloadMonitor = SteamDownloadMonitor()
|
||||
private var downloadMonitorTask: Runnable? = null
|
||||
private var downloadActive = false
|
||||
/**
|
||||
* The runtime is fetching the Steam client itself (a first run, a repair), before anything is on
|
||||
* screen. That download keeps the session awake whatever the downloads setting says: paused, a
|
||||
* first run never gets as far as showing Steam.
|
||||
*/
|
||||
private var clientInstallActive = false
|
||||
@Volatile private var steamLibraryMounts = emptyMap<String, File>()
|
||||
private var suspendDownloadNow = false
|
||||
@@ -647,7 +642,6 @@ class SessionService : Service() {
|
||||
}
|
||||
},
|
||||
)
|
||||
// Watching first: a first run's client download must be known before anything is paused.
|
||||
updateDownloadMonitoring()
|
||||
mainHandler.post { updateSuspendPolicy() }
|
||||
}
|
||||
@@ -1863,15 +1857,10 @@ class SessionService : Service() {
|
||||
getSystemService(NotificationManager::class.java)?.notify(NOTIFICATION_ID, buildNotification())
|
||||
}
|
||||
|
||||
/** A download is under way that holds the session awake while it is out of sight. */
|
||||
private fun downloadsKeepAwake(): Boolean =
|
||||
downloadActive && (steamDownloadsInBackground || clientInstallActive) &&
|
||||
SessionState.mode == MODE_STEAM && suspendPolicy != SessionPrefs.SUSPEND_NEVER
|
||||
|
||||
/**
|
||||
* Steam's own downloads with the downloads setting on, and the Steam client's download until the
|
||||
* session shows its first frame whatever the setting: once Steam is on screen it was fetched.
|
||||
*/
|
||||
private fun downloadWatchWanted(): Boolean =
|
||||
SessionState.running && SessionState.mode == MODE_STEAM && suspendPolicy != SessionPrefs.SUSPEND_NEVER &&
|
||||
(steamDownloadsInBackground || !SessionState.firstFrameSeen)
|
||||
|
||||
@@ -139,11 +139,6 @@ internal class SteamDownloadMonitor {
|
||||
Regex("\"$key\"\\s+\"([^\"]*)\"").find(text)?.groupValues?.get(1)
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* The runtime has yet to fetch the Steam client: a first run, or a repair asked for or begun
|
||||
* (droiddeck-steam-install drops its stamp as it starts one). That download runs before
|
||||
* anything is on screen, and a paused session pauses it with the rest.
|
||||
*/
|
||||
fun clientInstallPending(runtimeRoot: File): Boolean {
|
||||
val home = File(runtimeRoot, "root")
|
||||
val steam = File(home, ".local/share/Steam")
|
||||
@@ -153,7 +148,6 @@ internal class SteamDownloadMonitor {
|
||||
}
|
||||
|
||||
private const val MANIFEST_PROGRESS_GRACE_MS = 8_000L
|
||||
// Longer than Steam's ~60 s between rate lines, for when no traffic counter is available.
|
||||
private const val CONTENT_ACTIVITY_GRACE_MS = 90_000L
|
||||
private const val MIN_RECEIVE_BYTES_PER_SEC = 64L * 1024L
|
||||
private val PATH = Regex("\"path\"\\s+\"([^\"]+)\"")
|
||||
|
||||
Reference in new issue
Block a user