Bundle replace only for open non-Adreno pairs; Adreno bundles keep their numbered copies

This commit is contained in:
The412Banner committed 2026-10-13 06:49:35 -04:00
1 parent 24dfa920b5
commit 92e4eecb58
1 file changed
+3 -3
@@ -86,10 +86,10 @@ object DriverBundle {
val manifest = File(work, MANIFEST).takeIf { it.isFile }
?.let { runCatching { parseManifest(JSONObject(FileUtils.readString(it))) }.getOrNull() }
?: throw IllegalArgumentException(context.getString(R.string.bundle_no_manifest))
// The same bundle again (a pair picked again after another one): replace it rather
// than keeping a "-2" copy whose drivers sit beside the old ones.
// The same open non-Adreno pair again (picked again after another one): replace it
// rather than keeping a "-2" copy beside the old one. Adreno bundles keep their copies.
val sameId = LinuxVulkanDriverManager.sanitizeId(manifest.tag.ifEmpty { "${manifest.name}-${manifest.version}" })
get(context, sameId)?.let { old ->
get(context, sameId)?.takeIf { DriverPairs.isNonAdreno(it.id) }?.let { old ->
Log.i(TAG, "replacing bundle ${old.id} (display ${old.androidId}, runtime ${old.linuxId})")
remove(context, old)
}