• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 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.sysui;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23import "frameworks/proto_logging/stats/enums/telephony/enums.proto";
24import "frameworks/proto_logging/stats/enums/os/enums.proto";
25
26extend Atom {
27  optional LockscreenShortcutSelected lockscreen_shortcut_selected = 611 [(module) = "sysui"];
28  optional LockscreenShortcutTriggered lockscreen_shortcut_triggered = 612 [(module) = "sysui"];
29  optional LauncherImpressionEventV2 launcher_impression_event_v2 = 716 [(module) = "sysui"];
30  optional DisplaySwitchLatencyTracked display_switch_latency_tracked = 753 [(module) = "sysui"];
31  optional NotificationListenerService notification_listener_service = 829 [(module) = "sysui"];
32  optional NavHandleTouchPoints nav_handle_touch_points = 869 [(module) = "sysui"];
33}
34
35/**
36 * Pushes when a lockscreen shortcut is selected
37 *
38 * Logged From:
39 *    frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/shared/quickaffordance/KeyguardQuickAffordancesMetricsLogger.kt
40 */
41message LockscreenShortcutSelected {
42  // Id of the shortcut slot
43  optional string slot_id = 1;
44
45  // Id of the lockscreen shortcut
46  optional string affordance_id = 2;
47}
48
49/**
50 * Pushes when a lockscreen shortcut is triggered
51 *
52 * Logged From:
53 *    frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/shared/quickaffordance/KeyguardQuickAffordancesMetricsLogger.kt
54 */
55message LockscreenShortcutTriggered {
56  // Id of the shortcut slot
57  optional string slot_id = 1;
58
59  // Id of the lockscreen shortcut
60  optional string affordance_id = 2;
61}
62
63/**
64 * Logs for Launcher Impression logging version2.
65 *
66 * Logged from:
67 *      vendor/unbundled_google/packages/NexusLauncher/src/com/google/android/apps/nexuslauncher/logging/SearchImpressionLogManager.java
68 *
69 * Next Tag: 9
70 */
71message LauncherImpressionEventV2 {
72    // The event id generated from go/uievents
73    optional int32 event_id = 1;
74    // The instance id to track multiple partial impression event.
75    optional int32 instance_id = 2;
76
77    // The state defines the surface where the impression is being logged.
78    optional int32 state = 3;
79    optional int32 query_length = 4 [default = -1];
80
81    // ResultType of the search result as defined in vendor/unbundled_google/libraries/searchuilib/src/com/android/app/search/ResultType.java
82    optional int32 result_type = 5;
83
84    // True if at least 50% of the item is not hidden (ex: hidden behind the keyboard).
85    optional bool is_visible = 6;
86
87    // https://developer.android.com/reference/android/os/Process#INVALID_UID
88    // The default value of uid entry will be -1 to indicate package name
89    // doesn't match any of the installed apps. So assign the default value of UID to -1.
90    optional int32 uid = 7 [(is_uid) = true];
91
92    // The result source of the search result as defined in vendor/unbundled_google/libraries/searchuilib/src/com/android/app/search/SearchTargetExtras.java
93    optional int32 result_source = 8;
94}
95
96/**
97 * Logs for Display Switch Latency Tracking.
98 *
99 * Next Tag: 22
100*/
101message DisplaySwitchLatencyTracked {
102
103    // Latency tracked between device state change is received in SysUI and the switched display
104    // being unblocked and turned on (onScreenTurnedOn received in sysui from power manager)
105    optional int32 latency_ms = 1;
106
107    // The state of device before the Display Switch event.
108    // This field defines the fold-state of the device.
109    optional android.telephony.FoldState from_foldable_device_state = 2;
110    // This field provides additional information about device state
111    optional StateEnum from_state = 3;
112    // This field will store the uid of the top running task(app only).
113    optional int32 from_focused_app_uid = 4 [(is_uid) = true];
114    // This field will have the uid of the app being used in picture-in-picture mode. The value
115    // will be -1 if no picture-in-picture is ongoing*/
116    optional int32 from_pip_app_uid = 5 [(is_uid) = true];
117    // At the moment of Display Switch if screen_state is equal to
118    // SPLIT_SCREEN_APPS/ OVERVIEW/ FREEFORM_APPS or pip_app_uid is not -1, then this field will
119    // store the uids of apps present in split-screen mode.
120    repeated int32 from_visible_apps_uid = 6 [(is_uid) = true];
121    // Density of the display for the device being tracked in dpi.
122    optional int32 from_density_dpi = 7;
123
124    // The state of the device after the Display Switch event.
125    optional StateEnum to_state = 8;
126    optional android.telephony.FoldState to_foldable_device_state = 9;
127    optional int32 to_focused_app_uid = 10 [(is_uid) = true];
128    optional int32 to_pip_app_uid = 11 [(is_uid) = true];
129    repeated int32 to_visible_apps_uid = 12 [(is_uid) = true];
130    optional int32 to_density_dpi = 13;
131
132    // Additional data useful for analyzing latency issues
133    // Total number of notifications present in Notification panel during Display Switch event.
134    optional int32 notification_count = 14;
135    // Number of TYPE_EXTERNAL displays at the moment of Display Switch.
136    optional int32 external_display_count = 15;
137    // Throttling level at the moment of Display Switch provided by thermal api.
138    optional android.os.ThrottlingSeverityEnum throttling_level = 16;
139    // Virtual-skin temperature in Celsius of the device at the moment of Display Switch.
140    optional int32 vskin_temperature_c = 17;
141
142    // Fields tracking time elapsed between relevant events in milliseconds. Default values of
143    // below fields will be -1 in case they are not tracked.
144    // The time elapsed between the hall sensor unfold event and the first hinge angle event.
145    optional int32 hall_sensor_to_first_hinge_angle_change_ms = 18;
146    // The time elapsed between the hall sensor unfold/fold event and the device state change
147    // event.
148    optional int32 hall_sensor_to_device_state_change_ms = 19;
149    // The time elapsed between the onScreenTurningOn call and the onDrawn callback in SystemUI.
150    optional int32 onscreenturningon_to_ondrawn_ms = 20;
151    // The time elapsed between the onDrawn callback and the onScreenTurnedOn call in SystemUI.
152    optional int32 ondrawn_to_onscreenturnedon_ms = 21;
153
154    enum StateEnum {
155      // The device is in none of the above mentioned states.
156      UNKNOWN = 0;
157      // When the device is sleeping with AOD enabled (Always on display).
158      AOD = 1;
159      // Device folded/unfolded when on lockscreen.
160      LOCKSCREEN = 2;
161      // Notification shade is open currently.
162      NOTIFICATION_SHADE = 3;
163      // When an app is being used in full-screen mode.
164      FULL_SCREEN_APP = 4;
165      // When 2 apps are being used in split-screen mode.
166      SPLIT_SCREEN_APPS = 5;
167      // Launcher app is being displayed currently.
168      LAUNCHER = 6;
169      // Overview/Recent apps screen is being displayed on the screen
170      // currently
171      OVERVIEW = 7;
172      // Freeform apps are currently being used, i.e. single or multiple apps are being
173      // displayed on screen in which the window size of each app is resizable.
174      FREEFORM_APPS = 8;
175      // Screen is off currently.
176      SCREEN_OFF = 9;
177    }
178
179}
180
181/*
182 * Denotes that a new notification service has been enabled or disabled.
183 *
184 * Logs from :
185 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerImpl.java
186 * frameworks/base/services/core/java/com/android/server/SensitiveContentProtectionManagerService.java
187 */
188message NotificationListenerService {
189     optional int32 uid = 1 [(is_uid) = true];
190     optional bool is_enabled = 2;
191     optional bool is_preinstalled = 3;
192     optional bool is_pregranted = 4;
193}
194
195/**
196 * Logs for Launcher Nav Handle Touch Points.
197 *
198 * Logged from:
199 *      packages/apps/Launcher3/quickstep/src/com/android/quickstep/TouchInteractionService.java
200 *
201 * Next Tag: 7
202 */
203
204message NavHandleTouchPoints {
205    // The event id generated from go/uievents
206    // The event ids should indicate gesture type like HOME, OVERVIEW, QUICK_SWITCH, TASKBAR, LPNH etc.
207    optional int32 gesture_event_id = 1;
208
209    // The instance id to track the next gesture event if needed.
210    optional int32 instance_id = 2;
211
212    // Touch points that triggered the gesture
213    // This is set of downsampled touch points
214    repeated int32 x_points = 3;
215    repeated int32 y_points = 4;
216    // This is the delay between consecutive motion events. Delay will be 0 for the first motion event.
217    repeated int32 delay = 5;
218    // This is the motion action event associated with (x,y) touch. See https://developer.android.com/reference/android/view/MotionEvent#constants_1 for the motion events code.
219    repeated int32 action = 6;
220}
221