Performance boost for games

Starting with Android 14 a new power mode named GAME in the Android Dynamic Performance Framework (ADPF) enables customization of phone performance during game use. GAME indicates to the Power HAL that a game app is in the foreground. This indication allows the Power HAL to adopt power management strategies when a game is being played, so that the user experiences a stable and improved performance.

To provide an improvement on a game’s loading time, Android 13 introduces a new power mode named GAME_LOADING in ADPF. GAME_LOADING indicates if a game app is in the loading state so that the Power HAL can provide a loading boost. This indication allows the Power HAL to provide performance boosting measures that can speed up the game loading time.

This page describes how the game app passes the game state to the Power HAL, explains how to configure Power HAL in order to take advantage of it in your devices, as well as how to test your Power HAL implementation.

Power mode detection and notification

This section describes how the Power Manager handles the GAME and GAME_LOADING modes.

GAME power mode

The new power mode GAME in Android 14 indicates to the Power Manager Service that the user is playing a game. When the Power HAL is notified of the GAME mode, it can adjust power to enhance performance, lower temperature and extend battery life, while the game is being played.

The following figure explains the flow of information to the Power HAL to indicate the GAME power mode:

game-mode

Figure 1. Information flow to indicate that a game is being played.

The GAME power mode is always set for apps with an appCategory of GAME in AndroidManifest.xml.

GAME_LOADING power mode

The loading boost mode works by detecting when a game app is in a loading state and notifying the Power HAL. Android 13 introduces a new game state called isLoading in the developer-facing API. This game state uses the new GAME_LOADING power mode in the Power Manager Service to notify the Power HAL about the top level game state. Once the Power HAL is notified of the game loading state, it can adjust the platform's performance settings and CPU clock rate, which results in improved load times.

To indicate that a game is loading, the game app uses the Game Dashboard to set an isLoading state in the Game Manager. The Game Manager passes this state to the Game Manager Service, which uses setPowerMode with the new GAME_LOADING power mode to invoke the Power Manager Service. The GAME_LOADING power mode indicates to the Power HAL that the game is in a loading state so that the Power HAL can provide a loading boost.

The following figure explains the flow of information from the app to the Power HAL to indicate the loading state:

loading-boost

Figure 2. Information flow to indicate that a game is in a loading state.

The game dashboard allows users to turn the loading boost feature on or off with the Performance Setting. The Performance Setting always defaults to off.

Customize Power HAL using GAME and GAME_LOADING

To take advantage of the GAME and GAME_LOADING modes, OEMs must customize their implementation of the Power HAL. As power management and performance boosting is hardware specific, no reference implementations for the GAME or GAME_LOADING modes are made available until a reference implementation for the Google Pixel device is released.

To enhance performance in a GAME and GAME_LOADING mode, OEMs can choose to implement a combination of the following measures:

  • Stabilize frame rate
  • Increase CPU clock speed
  • Temporarily reduce temperature throttling
  • Assign a higher CPU priority to the foreground game app
  • Reduce CPU boost tuned for regular, non-game apps
  • Optimize the thermal-related power distribution strategy

Test GAME mode implementation

To test the implementation of the GAME mode, use tests prefixed with testGamePowerMode_ in GameManagerServiceTests.java.

Test GAME_LOADING implementation

To test the implementation of the GAME_LOADING mode, use android.gamemanager.cts.GameManagerTest#testSetGameContext. This test verifies if GameManager::setGameContext() with an isLoading context invokes the game loading mode on the Power HAL in performance mode.