Loading services/core/java/com/android/server/app/GameManagerShellCommand.java +69 −60 Original line number Diff line number Diff line Loading @@ -36,7 +36,9 @@ import android.app.GameManager; import android.app.IGameManagerService; import android.compat.Compatibility; import android.content.Context; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager.ServiceNotFoundException; import android.os.ShellCommand; import android.util.ArraySet; Loading Loading @@ -116,7 +118,7 @@ public class GameManagerShellCommand extends ShellCommand { pw.println("Enable downscaling ratio for " + packageName + " to " + ratio); } break; return 0; } case "mode": { /** The "mode" command allows setting a package's current game mode outside of Loading @@ -128,6 +130,18 @@ public class GameManagerShellCommand extends ShellCommand { * <PACKAGE_NAME> <CONFIG_STRING>` * see: {@link GameManagerServiceTests#mockDeviceConfigAll()} */ return runGameMode(pw); } default: return handleDefaultCommands(cmd); } } catch (Exception e) { pw.println("Error: " + e); } return -1; } private int runGameMode(PrintWriter pw) throws ServiceNotFoundException, RemoteException { final String option = getNextOption(); String userIdStr = null; if (option != null && option.equals("--user")) { Loading Loading @@ -160,6 +174,7 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; case "2": Loading @@ -170,6 +185,7 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; case "3": Loading @@ -180,22 +196,15 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; default: pw.println("Invalid game mode: " + gameMode); break; } break; } default: return handleDefaultCommands(cmd); } } catch (Exception e) { pw.println("Error: " + e); } return -1; } return 0; } @Override Loading Loading
services/core/java/com/android/server/app/GameManagerShellCommand.java +69 −60 Original line number Diff line number Diff line Loading @@ -36,7 +36,9 @@ import android.app.GameManager; import android.app.IGameManagerService; import android.compat.Compatibility; import android.content.Context; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager.ServiceNotFoundException; import android.os.ShellCommand; import android.util.ArraySet; Loading Loading @@ -116,7 +118,7 @@ public class GameManagerShellCommand extends ShellCommand { pw.println("Enable downscaling ratio for " + packageName + " to " + ratio); } break; return 0; } case "mode": { /** The "mode" command allows setting a package's current game mode outside of Loading @@ -128,6 +130,18 @@ public class GameManagerShellCommand extends ShellCommand { * <PACKAGE_NAME> <CONFIG_STRING>` * see: {@link GameManagerServiceTests#mockDeviceConfigAll()} */ return runGameMode(pw); } default: return handleDefaultCommands(cmd); } } catch (Exception e) { pw.println("Error: " + e); } return -1; } private int runGameMode(PrintWriter pw) throws ServiceNotFoundException, RemoteException { final String option = getNextOption(); String userIdStr = null; if (option != null && option.equals("--user")) { Loading Loading @@ -160,6 +174,7 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; case "2": Loading @@ -170,6 +185,7 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; case "3": Loading @@ -180,22 +196,15 @@ public class GameManagerShellCommand extends ShellCommand { } else { pw.println("Game mode: " + gameMode + " not supported by " + packageName); return -1; } break; default: pw.println("Invalid game mode: " + gameMode); break; } break; } default: return handleDefaultCommands(cmd); } } catch (Exception e) { pw.println("Error: " + e); } return -1; } return 0; } @Override Loading