mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
* fix: dual-screen launcher keeps the update prompt on screen and stays out of Recents as home; Quest panel opens landscape Outside screens the launcher opens (the update prompt, Settings, pickers) now hold the top screen when the bottom screen is touched, so a bottom-screen tap no longer buries the Android install prompt and leaves updates stuck waiting for confirmation (DD-368). When DroidDeck is the home app its launcher task is excluded from Recents, so it can no longer be swiped closed; a running game session is still listed (DD-377). The launcher declares a 1024x640 dp default panel size so Meta Quest opens it landscape again after the orientation manifest change in #1606 (DD-360). * fix: Recents exclusion follows the top DroidDeck activity and only undoes its own change The launcher task is hidden from Recents only while FrontEndActivity is on top, DroidDeck is home and no session runs; the file manager and a running session show it again, the check repeats when the launcher pauses, and tasks hidden by someone else are left alone. * fix: Recents ownership survives process death and never claims a task someone else excluded
81 lines
4.5 KiB
Kotlin
81 lines
4.5 KiB
Kotlin
package com.droiddeck.launcher
|
|
|
|
import android.app.Application
|
|
import com.droiddeck.launcher.runtime.BwrapSpawner
|
|
import com.droiddeck.launcher.session.CrashHandler
|
|
import com.droiddeck.launcher.session.GpuClockPin
|
|
|
|
class App : Application() {
|
|
override fun attachBaseContext(base: android.content.Context) =
|
|
super.attachBaseContext(com.droiddeck.launcher.core.AppLanguage.wrap(base))
|
|
|
|
override fun onConfigurationChanged(newConfig: android.content.res.Configuration) {
|
|
super.onConfigurationChanged(newConfig)
|
|
com.droiddeck.launcher.core.AppLanguage.systemChanged(newConfig)
|
|
}
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
com.droiddeck.launcher.ui.Themes.loadGradient(this)
|
|
com.droiddeck.launcher.ui.BuildWatermark.install(this)
|
|
HomeApp.trackRecents(this)
|
|
// Helper processes must not initialize the main USB provider or guest graphics context.
|
|
val process = if (android.os.Build.VERSION.SDK_INT >= 28) Application.getProcessName()
|
|
else (getSystemService(ACTIVITY_SERVICE) as android.app.ActivityManager)
|
|
.runningAppProcesses?.firstOrNull { it.pid == android.os.Process.myPid() }?.processName
|
|
if (process == "$packageName:xboxlogin") {
|
|
if (android.os.Build.VERSION.SDK_INT >= 28) android.webkit.WebView.setDataDirectorySuffix("xbox")
|
|
return
|
|
}
|
|
if (process == "$packageName:xboxcloud") {
|
|
if (android.os.Build.VERSION.SDK_INT >= 28) android.webkit.WebView.setDataDirectorySuffix("xboxcloud")
|
|
return
|
|
}
|
|
if (process == "$packageName:xcloudnative") {
|
|
// The native cloud player: the stores log and nothing that touches the Linux session.
|
|
com.droiddeck.launcher.stores.StoresState.init(this)
|
|
return
|
|
}
|
|
if (process == "$packageName:vr_recovery" || process == "$packageName:rgb_diagnostic" ||
|
|
process == "$packageName:shortcuts_sync") return
|
|
CrashHandler.install(this)
|
|
com.droiddeck.launcher.core.SteamIntegration.syncShortcutsListing(this)
|
|
com.droiddeck.launcher.session.QuestExperimental.initialize(this)
|
|
com.droiddeck.launcher.session.SessionPrefs.applyNtsyncDefault(this)
|
|
com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this)
|
|
com.droiddeck.launcher.update.AppUpdates.init(this)
|
|
com.droiddeck.launcher.core.DownloadSource.init(this)
|
|
prefetchAddonPacks()
|
|
GpuClockPin.clearLeftover(this)
|
|
com.droiddeck.launcher.glasses.Glasses.init(this)
|
|
com.droiddeck.launcher.glasses.GlassesMenuMirror.initialize(this)
|
|
BwrapSpawner.start(this)
|
|
com.droiddeck.launcher.runtime.RootSpawner.start(this)
|
|
com.droiddeck.launcher.frontend.GameFileSync.start(this)
|
|
com.droiddeck.launcher.stores.StoresState.init(this)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.gog.GogBackend)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.epic.EpicBackend)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.amazon.AmazonBackend)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.itch.ItchBackend)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.xbox.XboxBackend)
|
|
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.battlenet.BattleNetBackend)
|
|
}
|
|
|
|
/** 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()
|
|
}
|
|
}
|