diff --git a/.github/workflows/publish-packs.yml b/.github/workflows/publish-packs.yml index ca8be6ea45..580b1c8188 100644 --- a/.github/workflows/publish-packs.yml +++ b/.github/workflows/publish-packs.yml @@ -71,7 +71,7 @@ jobs: notes="DroidDeck add-on pack \`$name\`, built by [Build APK run $BUILD_RUN]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$BUILD_RUN) from \`$commit\` with tools/packs/build.sh and published by [run $GITHUB_RUN_ID]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID). Size: $(stat -c %s "$file") bytes. SHA-256: $sha. APKs built in the same run pin this digest." - gh release create "$tag" -R "$REPO" --title "$tag" --notes "$notes" "$file" \ + gh release create "$tag" -R "$REPO" --title "$tag" --notes "$notes" --latest=false "$file" \ || echo "::warning::creating $tag failed; checking whether another run published it" digest=$(published_digest "$tag" "$name.tar.zst") fi diff --git a/app/src/main/java/com/droiddeck/launcher/App.kt b/app/src/main/java/com/droiddeck/launcher/App.kt index 5d11254678..68df13b2c1 100644 --- a/app/src/main/java/com/droiddeck/launcher/App.kt +++ b/app/src/main/java/com/droiddeck/launcher/App.kt @@ -30,10 +30,7 @@ class App : Application() { com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this) com.droiddeck.launcher.update.AppUpdates.init(this) com.droiddeck.launcher.core.DownloadSource.init(this) - if (com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(this).isDirectory) { - com.droiddeck.launcher.core.AddonPack.PROOT.ensure(this) - com.droiddeck.launcher.core.AddonPack.DIRECTAUDIO.ensure(this) - } + prefetchAddonPacks() GpuClockPin.clearLeftover(this) com.droiddeck.launcher.glasses.Glasses.init(this) com.droiddeck.launcher.glasses.GlassesMenuMirror.initialize(this) @@ -46,4 +43,21 @@ class App : Application() { com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.itch.ItchBackend) com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.xbox.XboxBackend) } + + /** Fetches the packs an existing setup already relies on, so the first use after an update does not wait. */ + private fun prefetchAddonPacks() { + val app = this + Thread({ + runCatching { + if (com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).isDirectory) { + com.droiddeck.launcher.core.AddonPack.PROOT.ensure(app) + com.droiddeck.launcher.core.AddonPack.DIRECTAUDIO.ensure(app) + } + if (com.droiddeck.launcher.stores.gog.GogComet.enabled(app)) com.droiddeck.launcher.core.AddonPack.COMET.ensure(app) + if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.XBOX) != null) + com.droiddeck.launcher.core.AddonPack.XBOX.ensure(app) + com.droiddeck.launcher.handtracking.HandTracking.load(app) + }.onFailure { android.util.Log.w("App", "add-on pack prefetch failed", it) } + }, "addon-packs").start() + } }