Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/main/java/app/gamenative/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ class MainActivity : ComponentActivity() {
// Initialize the controller management system
ControllerManager.getInstance().init(getApplicationContext())

// Start services
SteamService.start(this)
if (GOGService.hasStoredCredentials(this)) GOGService.start(this)
if (app.gamenative.service.epic.EpicService.hasStoredCredentials(this)) app.gamenative.service.epic.EpicService.start(this)

ContainerUtils.setContainerDefaults(applicationContext)

handleLaunchIntent(intent)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/app/gamenative/PrefManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ object PrefManager {
private val LIBRARY_FILTER = intPreferencesKey("library_filter")
var libraryFilter: EnumSet<AppFilter>
get() {
val value = getPref(LIBRARY_FILTER, AppFilter.toFlags(EnumSet.of(AppFilter.GAME, AppFilter.SHARED)))
val value = getPref(LIBRARY_FILTER, AppFilter.toFlags(EnumSet.of(AppFilter.GAME, AppFilter.INSTALLED, AppFilter.SHARED)))
return AppFilter.fromFlags(value)
}
set(value) {
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/app/gamenative/service/SteamService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,18 @@ class SteamService : Service(), IChallengeUrlChanged {
isWaitingForQRAuth = false
}

fun start(context: Context) {
Timber.tag("Steam").i("[SteamService.start] Called. isRunning=$isRunning")
if (!isRunning) {
Timber.tag("Steam").i("[SteamService.start] Starting foreground service...")
val intent = Intent(context, SteamService::class.java)
context.startForegroundService(intent)
Timber.tag("Steam").i("[SteamService.start] startForegroundService called")
} else {
Timber.tag("Steam").i("[SteamService.start] Service already running, skipping")
}
}

fun stopService() {
instance?.let {
Timber.i("Stopping service.")
Expand Down
18 changes: 11 additions & 7 deletions app/src/main/java/app/gamenative/ui/PluviaMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ fun PluviaMain(

if (navController.currentDestination?.route != PluviaScreen.Home.route) {
navController.navigate(PluviaScreen.Home.route) {
popUpTo(PluviaScreen.LoginUser.route) {
inclusive = true
navController.graph.findNode(PluviaScreen.LoginUser.route)?.let {
popUpTo(it.id) {
inclusive = true
}
}
}
}
Expand All @@ -284,11 +286,13 @@ fun PluviaMain(
onSuccess = viewModel::launchApp,
)
}
} else if (PluviaApp.xEnvironment == null) {
} else if (PluviaApp.xEnvironment == null && navController.currentDestination?.route == PluviaScreen.LoginUser.route) {
Timber.i("Navigating to library")
navController.navigate(PluviaScreen.Home.route) {
popUpTo(PluviaScreen.LoginUser.route) {
inclusive = true
navController.graph.findNode(PluviaScreen.LoginUser.route)?.let {
popUpTo(it.id) {
inclusive = true
}
}
}

Expand Down Expand Up @@ -922,7 +926,7 @@ fun PluviaMain(

NavHost(
navController = navController,
startDestination = PluviaScreen.LoginUser.route,
startDestination = PluviaScreen.Home.route,
) {
/** Login **/
/** Login **/
Expand Down Expand Up @@ -1004,7 +1008,7 @@ fun PluviaMain(
SteamService.logOut()
},
onGoOnline = {
navController.navigate(PluviaScreen.LoginUser.route)
navController.navigate(PluviaScreen.Settings.route)
},
isOffline = isOffline,
)
Expand Down
Loading
Loading