1/*
2 * Copyright (C) 2022 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
17syntax = "proto2";
18
19package android.os.statsd.agif;
20
21import "frameworks/proto_logging/stats/atom_field_options.proto";
22import "frameworks/proto_logging/stats/enums/app/app_enums.proto";
23
24option java_package = "com.android.os.agif";
25option java_multiple_files = true;
26
27/**
28 * Logs information related to Android Game Intervention Framework (AGIF).
29 */
30
31/*
32 * Logs changes to game mode.
33 *  Logged from:
34 *   frameworks/base/services/core/java/com/android/server/app/GameManagerService.java
35 */
36message GameModeChanged {
37  // UID of the game package.
38  optional int32 game_uid = 1 [(is_uid) = true];
39
40  // UID the caller package who made the game mode change.
41  optional int32 caller_uid = 2 [(is_uid) = true];
42
43  // Game mode previously set to.
44  optional android.app.GameMode game_mode_from = 3;
45
46  // Game mode currently set to.
47  optional android.app.GameMode game_mode_to = 4;
48}
49
50/*
51 * Logs changes to game mode configuration.
52 *  Logged from:
53 *   frameworks/base/services/core/java/com/android/server/app/GameManagerService.java
54 */
55message GameModeConfigurationChanged {
56  // UID of the game package.
57  optional int32 game_uid = 1 [(is_uid) = true];
58
59  // UID the caller package who made the game mode config change.
60  optional int32 caller_uid = 2 [(is_uid) = true];
61
62  // Game mode of the configuration.
63  optional android.app.GameMode game_mode = 3;
64
65  // Scaling factor previously set for this game mode.
66  optional float scaling_factor_from = 4;
67
68  // Scaling factor currently set to for this game mode.
69  optional float scaling_factor_to = 5;
70
71  // FPS override previously set for this game mode.
72  optional int32 fps_override_from = 6;
73
74  // FPS override currently set for this game mode.
75  optional int32 fps_override_to = 7;
76}
77
78/*
79 * Logs the current available game modes' information for a game.
80 *  Logged from:
81 *   frameworks/base/services/core/java/com/android/server/app/GameManagerService.java
82 */
83message GameModeInfo {
84  // UID of the game package.
85  optional int32 game_uid = 1 [(is_uid) = true];
86
87  // Game modes currently overridden by the game.
88  repeated android.app.GameMode overridden_game_modes = 2;
89
90  // Game modes available to user for the game.
91  repeated android.app.GameMode available_game_modes = 3;
92}
93
94/*
95 * Logs the current game mode configuration for a game's specific game mode.
96 *  Logged from:
97 *   frameworks/base/services/core/java/com/android/server/app/GameManagerService.java
98 */
99message GameModeConfiguration {
100  // UID of the game package.
101  optional int32 game_uid = 1 [(is_uid) = true];
102
103  // Game mode of the configuration.
104  optional android.app.GameMode game_mode = 2;
105
106  // FPS override previously set for this game mode.
107  optional int32 fps_override = 3;
108
109  // Scaling factor currently set to for this game mode.
110  optional float scaling_factor = 4;
111}
112
113/*
114 * Logs the current registered game mode listener information.
115 *  Logged from:
116 *   frameworks/base/services/core/java/com/android/server/app/GameManagerService.java
117 */
118message GameModeListener {
119  // Number of listeners currently registered in GameManagerService.
120  optional int32 count = 1;
121}
122