Game State API

Released:

Android 13 (API Level 33) - Java

With Game State API, you can let the system know what the game is currently doing (for example: loading levels, intense networked gameplay, rendering in-game menu, showing ads, etc). With this valuable information, the system is be able to optimize resources and power accordingly.

Java

if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.S){
// Get GameManager from SystemService
GameManagergameManager=
Context.getSystemService(GameManager.class);
GameStategameState=newGameState(false,
GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE);
gameManager.setGameState(gameState);
}

Check out the modes you can notify the system in the documentation Summary. It is possible that the list will grow when different resource consumption patterns is discovered in the future.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026年02月26日 UTC.