Skip to content
Open
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
18 changes: 12 additions & 6 deletions app/src/main/java/com/limelight/utils/UiHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ public class UiHelper {

private static void setGameModeStatus(Context context, boolean streaming, boolean interruptible) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
GameManager gameManager = context.getSystemService(GameManager.class);
try {
GameManager gameManager = context.getSystemService(GameManager.class);
if (gameManager == null) {
return; // Not supported on this device (e.g., Meta Quest)
}

if (streaming) {
gameManager.setGameState(new GameState(false, interruptible ? GameState.MODE_GAMEPLAY_INTERRUPTIBLE : GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE));
}
else {
gameManager.setGameState(new GameState(false, GameState.MODE_NONE));
if (streaming) {
gameManager.setGameState(new GameState(false, interruptible ? GameState.MODE_GAMEPLAY_INTERRUPTIBLE : GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE));
} else {
gameManager.setGameState(new GameState(false, GameState.MODE_NONE));
}
} catch (Throwable t) {
// Swallow any failure. Some OEM builds ship partial/incompatible GameManager impls.
}
}
}
Expand Down