From b0b9c9bc402548624654d10bf9aed87fc8f2d0d7 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Tue, 13 Oct 2026 06:58:37 -0400 Subject: [PATCH] Rebuilt open drivers reach phones: re-downloaded when their digest changes, release list hourly on non-Adreno The non-Adreno driver releases replace their assets in place (the PanVK kbase sync-file fd leak fix). A download is now remembered with its GitHub sha256, and an asset whose digest changed counts as not installed, so Auto fetches it again and the bundle replaces the old one; the release list is re-read after an hour instead of a day on a GPU that is not an Adreno. --- .../java/com/droiddeck/launcher/DriverMenus.kt | 4 +++- .../com/droiddeck/launcher/gpu/TurnipReleases.kt | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/DriverMenus.kt b/app/src/main/java/com/droiddeck/launcher/DriverMenus.kt index ed9cc6a40..dd678ea10 100644 --- a/app/src/main/java/com/droiddeck/launcher/DriverMenus.kt +++ b/app/src/main/java/com/droiddeck/launcher/DriverMenus.kt @@ -208,7 +208,9 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl autoStatus = activity.getString(R.string.drivers_checking_latest) Thread({ val cached = TurnipReleases.cached(activity) - val stale = cached == null || System.currentTimeMillis() - cached.checkedAt > 24 * 3_600_000L || + // The open non-Adreno drivers are rebuilt in place while they are tested: an hour. + val maxAge = if (DeviceSupport.adreno()) 24 * 3_600_000L else 3_600_000L + val stale = cached == null || System.currentTimeMillis() - cached.checkedAt > maxAge || cached.assets.none { it.pair.isNotEmpty() } || // A list checked before this device's open drivers were offered has none of them. (!DeviceSupport.adreno() && cached.assets.none { DriverPairs.isNonAdreno(it.pair) }) diff --git a/app/src/main/java/com/droiddeck/launcher/gpu/TurnipReleases.kt b/app/src/main/java/com/droiddeck/launcher/gpu/TurnipReleases.kt index fcbb21675..40fd957a1 100644 --- a/app/src/main/java/com/droiddeck/launcher/gpu/TurnipReleases.kt +++ b/app/src/main/java/com/droiddeck/launcher/gpu/TurnipReleases.kt @@ -187,8 +187,16 @@ object TurnipReleases { } /** The id an asset was installed as, when it was downloaded before and is still installed. */ - fun installedId(context: Context, asset: Asset, isInstalled: (String) -> Boolean): String? = - downloads(context).optString(asset.name, "").takeIf { it.isNotEmpty() && isInstalled(it) } + fun installedId(context: Context, asset: Asset, isInstalled: (String) -> Boolean): String? { + val d = downloads(context) + // The open non-Adreno drivers are rebuilt in place under the same asset name: one whose + // digest changed since it was downloaded counts as not installed, so it is fetched again. + if (DriverPairs.isNonAdreno(asset.pair) && asset.sha256.isNotEmpty() && + !asset.sha256.equals(d.optString(SHA_PREFIX + asset.name, asset.sha256), ignoreCase = true)) return null + return d.optString(asset.name, "").takeIf { it.isNotEmpty() && isInstalled(it) } + } + + private const val SHA_PREFIX = "sha256:" /** True when [id] came from a release download rather than a zip picked by hand. */ fun isDownloaded(context: Context, id: String): Boolean { @@ -197,7 +205,9 @@ object TurnipReleases { } fun recordDownload(context: Context, asset: Asset, id: String) { - prefs(context).edit().putString(KEY_DOWNLOADS, downloads(context).put(asset.name, id).toString()).apply() + val d = downloads(context).put(asset.name, id) + if (DriverPairs.isNonAdreno(asset.pair) && asset.sha256.isNotEmpty()) d.put(SHA_PREFIX + asset.name, asset.sha256) + prefs(context).edit().putString(KEY_DOWNLOADS, d.toString()).apply() } /** Forget a deleted driver, so its release offers the download again. */