Allow enabling ANGLE for GAME_MODE_STANDARD

For b/210469739, we need to be able to enable ANGLE by default for
games specified in the Game Dashboard phenotype. To do this, the
device config will be updated to include: mode=1,useAngle=true for the
necessary packages. This indicates to the GameManager that ANGLE is
enabled for GameManager.GAME_MODE_STANDARD.

Tested with:
    adb shell device_config put game_overlay $PACKAGE_NAME mode=1,useAngle=true

Bug: b/210686699
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: Ib723005a01109a74e597b5c06dd9f1a692967184
This commit is contained in:
Tim Van Patten
2021-12-14 11:48:11 -07:00
parent 2954689c4f
commit 02b892b12d
2 changed files with 5 additions and 10 deletions

View File

@@ -385,7 +385,8 @@ public final class GameManagerService extends IGameManagerService.Stub {
}
public boolean isValid() {
return mGameMode == GameManager.GAME_MODE_PERFORMANCE
return mGameMode == GameManager.GAME_MODE_STANDARD
|| mGameMode == GameManager.GAME_MODE_PERFORMANCE
|| mGameMode == GameManager.GAME_MODE_BATTERY;
}

View File

@@ -167,15 +167,9 @@ public class GameManagerShellCommand extends ShellCommand {
switch (gameMode.toLowerCase()) {
case "1":
case "standard":
// Standard should only be available if other game modes are.
if (batteryModeSupported || perfModeSupported) {
service.setGameMode(packageName, GameManager.GAME_MODE_STANDARD,
userId);
} else {
pw.println("Game mode: " + gameMode + " not supported by "
+ packageName);
return -1;
}
// Standard mode can be used to specify loading ANGLE as the default OpenGL ES
// driver, so it should always be available.
service.setGameMode(packageName, GameManager.GAME_MODE_STANDARD, userId);
break;
case "2":
case "performance":