1 /*
2 ** Copyright 2021, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
17 package android.app;
18 
19 import android.app.GameModeConfiguration;
20 import android.app.GameModeInfo;
21 import android.app.GameState;
22 import android.app.IGameModeListener;
23 import android.app.IGameStateListener;
24 
25 /**
26  * @hide
27  */
28 interface IGameManagerService {
getGameMode(String packageName, int userId)29     int getGameMode(String packageName, int userId);
30     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
setGameMode(String packageName, int gameMode, int userId)31     void setGameMode(String packageName, int gameMode, int userId);
32     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
getAvailableGameModes(String packageName, int userId)33     int[] getAvailableGameModes(String packageName, int userId);
34     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
isAngleEnabled(String packageName, int userId)35     boolean isAngleEnabled(String packageName, int userId);
36     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
notifyGraphicsEnvironmentSetup(String packageName, int userId)37     void notifyGraphicsEnvironmentSetup(String packageName, int userId);
setGameState(String packageName, in GameState gameState, int userId)38     void setGameState(String packageName, in GameState gameState, int userId);
39     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
getGameModeInfo(String packageName, int userId)40     GameModeInfo getGameModeInfo(String packageName, int userId);
41     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.SET_GAME_SERVICE)")
setGameServiceProvider(String packageName)42     void setGameServiceProvider(String packageName);
43     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
updateResolutionScalingFactor(String packageName, int gameMode, float scalingFactor, int userId)44     void updateResolutionScalingFactor(String packageName, int gameMode, float scalingFactor, int userId);
45     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
getResolutionScalingFactor(String packageName, int gameMode, int userId)46     float getResolutionScalingFactor(String packageName, int gameMode, int userId);
47     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
updateCustomGameModeConfiguration(String packageName, in GameModeConfiguration gameModeConfig, int userId)48     void updateCustomGameModeConfiguration(String packageName, in GameModeConfiguration gameModeConfig, int userId);
49     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
addGameModeListener(IGameModeListener gameModeListener)50     void addGameModeListener(IGameModeListener gameModeListener);
51     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_MODE)")
removeGameModeListener(IGameModeListener gameModeListener)52     void removeGameModeListener(IGameModeListener gameModeListener);
addGameStateListener(IGameStateListener gameStateListener)53     void addGameStateListener(IGameStateListener gameStateListener);
removeGameStateListener(IGameStateListener gameStateListener)54     void removeGameStateListener(IGameStateListener gameStateListener);
55     @EnforcePermission("MANAGE_GAME_MODE")
toggleGameDefaultFrameRate(boolean isEnabled)56     void toggleGameDefaultFrameRate(boolean isEnabled);
57 }
58