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/atom_field_options.proto";
22import "frameworks/proto_logging/stats/enums/app/media_output_enum.proto";
23import "frameworks/proto_logging/stats/enums/hardware/sensor/assist/enums.proto";
24import "frameworks/proto_logging/stats/enums/stats/launcher/launcher.proto";
25
26option java_package = "com.android.os.sysui";
27option java_multiple_files = true;
28
29/**
30 * Logs keyguard state. The keyguard is the lock screen.
31 *
32 * Logged from:
33 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
34 */
35message KeyguardStateChanged {
36    enum State {
37        UNKNOWN = 0;
38        // The keyguard is hidden when the phone is unlocked.
39        HIDDEN = 1;
40        // The keyguard is shown when the phone is locked (screen turns off).
41        SHOWN= 2;
42        // The keyguard is occluded when something is overlaying the keyguard.
43        // Eg. Opening the camera while on the lock screen.
44        OCCLUDED = 3;
45    }
46    optional State state = 1;
47}
48
49/**
50 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
51 * prompts the user to enter a password (pattern, pin, etc).
52 *
53 * Logged from:
54 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
55 */
56message KeyguardBouncerStateChanged {
57    enum State {
58        UNKNOWN = 0;
59        // Bouncer is hidden, either as a result of successfully entering the
60        // password, screen timing out, or user going back to lock screen.
61        HIDDEN = 1;
62        // The user is being prompted to enter the password and the keyguard is NOT in one
63        // handed mode.
64        SHOWN = 2;
65        // The user is being prompted to enter the password and the keyguard shows in one
66        // handed mode and left aligned.
67        SHOWN_LEFT = 3;
68        // The user is being prompted to enter the password and the keyguard shows in one
69        // handed mode and right aligned.
70        SHOWN_RIGHT = 4;
71        // The keyguard switches to the left side while it is in one handed mode.
72        SWITCH_LEFT = 5;
73        // The keyguard switches to the right side while it is in one handed mode.
74        SWITCH_RIGHT = 6;
75    }
76    optional State state = 1;
77}
78
79/**
80 * Logs the result of entering a password into the keyguard bouncer.
81 *
82 * Logged from:
83 *   frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
84 */
85message KeyguardBouncerPasswordEntered {
86    enum BouncerResult {
87        UNKNOWN = 0;
88        // The password entered was incorrect.
89        FAILURE = 1;
90        // The password entered was correct.
91        SUCCESS = 2;
92    }
93    optional BouncerResult result = 1;
94
95    enum BouncerSide {
96        DEFAULT = 0;
97        LEFT = 1;
98        RIGHT = 2;
99    }
100    optional BouncerSide side = 2;
101}
102
103message BackGesture {
104    enum BackType {
105        DEFAULT_BACK_TYPE = 0;
106        COMPLETED = 1;
107        COMPLETED_REJECTED = 2; // successful because coming from rejected area
108        INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
109        INCOMPLETE = 4;  // Unsuccessful, for reasons other than below.
110        INCOMPLETE_FAR_FROM_EDGE = 5;  // Unsuccessful, far from the edge.
111        INCOMPLETE_MULTI_TOUCH = 6;  // Unsuccessful, multi touch.
112        INCOMPLETE_LONG_PRESS = 7;  // Unsuccessful, long press.
113        INCOMPLETE_VERTICAL_MOVE = 8;  // Unsuccessful, move vertically.
114    }
115    optional BackType type = 1;
116
117    optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
118    optional int32 start_x = 4;  // X coordinate for ACTION_DOWN event.
119    optional int32 start_y = 5;  // Y coordinate for ACTION_DOWN event.
120    optional int32 end_x = 6;   // X coordinate for ACTION_MOVE event.
121    optional int32 end_y = 7;  // Y coordinate for ACTION_MOVE event.
122    optional int32 left_boundary = 8;  // left edge width + left inset
123    optional int32 right_boundary = 9;  // screen width - (right edge width + right inset)
124    // The score between 0 and 1 which is the prediction output for the Back Gesture model.
125    optional float ml_model_score = 10;
126    optional string package_name = 11;  // The name of the top 100 most used package by all users.
127
128    // Specifies the input type of the event.
129    enum InputType {
130        UNKNOWN = 0;
131        TOUCH = 1;
132        TRACKPAD = 2;
133    }
134    optional InputType input_type = 12;
135
136    enum WindowHorizontalLocation {
137        DEFAULT_LOCATION = 0;
138        LEFT = 1;
139        RIGHT = 2;
140    }
141    optional WindowHorizontalLocation x_location = 3 [deprecated = true];
142}
143
144/**
145 * Logs when IME is on.
146 *
147 * Logged from: /packages/SystemUI/src/com/android/systemui/
148                statusbar/phone/NavigationBarView.java
149 *
150 */
151message ImeTouchReported {
152    optional int32 x_coordinate = 1;  // X coordinate for ACTION_DOWN event.
153    optional int32 y_coordinate = 2;  // Y coordinate for ACTION_DOWN event.
154}
155
156/**
157 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
158 *
159 * Logged from:
160 *   packages/apps/Launcher3
161 */
162message LauncherUIChanged {
163    optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
164    optional android.stats.launcher.LauncherState src_state = 2;
165    optional android.stats.launcher.LauncherState dst_state = 3;
166    optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
167    optional bool is_swipe_up_enabled = 5 [deprecated = true];
168
169    // The event id (e.g., app launch, drag and drop, long press)
170    optional int32 event_id = 6;
171    // The event's source or target id (e.g., icon, task, button)
172    optional int32 target_id = 7;
173    // If the target needs to be tracked, use this id field
174    optional int32 instance_id = 8;
175    optional int32 uid = 9 [(is_uid) = true];
176    optional string package_name = 10;
177    optional string component_name = 11;
178
179    // (x, y) coordinate and the index information of the target on the container
180    optional int32 grid_x = 12 [default = -1];
181    optional int32 grid_y = 13 [default = -1];
182    optional int32 page_id = 14 [default = -2];
183
184    // e.g., folder icon's (x, y) location and index information on the workspace
185    optional int32 grid_x_parent = 15 [default = -1];
186    optional int32 grid_y_parent = 16 [default = -1];
187    optional int32 page_id_parent = 17 [default = -2];
188
189    // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
190    optional int32 hierarchy = 18;
191
192    // deprecated, use user_type field instead
193    optional bool is_work_profile = 19 [deprecated = true];
194
195    // Used to store the predicted rank of the target
196    optional int32 rank = 20 [default = -1];
197
198    // e.g., folderLabelState can be captured in the following two fields
199    optional int32 from_state = 21;
200    optional int32 to_state = 22;
201
202    // e.g., autofilled or suggested texts that are not user entered
203    optional string edittext = 23;
204
205    // e.g., number of contents inside a container (e.g., icons inside a folder)
206    optional int32 cardinality = 24;
207
208    // Used to store features of the target (e.g. widget is reconfigurable, etc)
209    optional int32 features = 25;
210
211    // Used to store on-device search related features of the target
212    // (e.g. spell-corrected query etc)
213    optional int32 search_attributes = 26;
214
215    // List of attributes attached to the event.
216    optional LauncherAttributes attributes = 27 [(log_mode) = MODE_BYTES];
217
218    // Specifies the input type of the event.
219    enum InputType {
220        UNKNOWN = 0;
221        TOUCH = 1;
222        TRACKPAD = 2;
223    }
224    optional InputType input_type = 28;
225
226    // Specifies the type of the user the event connected with
227    enum UserType {
228         TYPE_UNKNOWN = 0;
229         TYPE_MAIN = 1;
230         TYPE_WORK = 2;
231         TYPE_CLONED = 3;
232         TYPE_PRIVATE = 4;
233    }
234    optional UserType user_type = 29;
235
236    // Indicates the current rotation of the display. Uses android.view.Surface values.
237    enum DisplayRotation {
238         ROTATION_0 = 0;
239         ROTATION_90 = 1;
240         ROTATION_180 = 2;
241         ROTATION_270 = 3;
242    }
243    optional DisplayRotation display_rotation = 30;
244
245    enum RecentsOrientationHandler {
246        PORTRAIT = 0;
247        LANDSCAPE = 1;
248        SEASCAPE = 2;
249    }
250    optional RecentsOrientationHandler recents_orientation_handler = 31;
251}
252
253message LauncherAttributes {
254  // Integer value of item attribute enum
255  // (e.g. SUGGESTED_LABEL, ALL_APPS_SEARCH_RESULT_SETTING etc)
256  repeated int32 item_attributes = 1;
257}
258
259message SmartSpaceCardReported {
260    // Different SmartSpace cards.
261    // DEPRECATED CardType enum. Use SmartspaceTarget.mFeatureType, which matches the list from:
262    // google3/java/com/google/android/apps/miphone/aiai/echo/smartspace/Constants.kt
263    enum CardType {
264        option deprecated = true;
265        UNKNOWN_CARD = 0;
266        COMMUTE = 1;
267        CALENDAR = 2;
268        FLIGHT = 3;
269        WEATHER = 4;
270        WEATHER_ALERT = 5;
271        AT_A_STORE_SHOPPING_LIST = 6;
272        AT_A_STORE_LOYALTY_CARD = 7;
273        HEADPHONE_RESUME_MEDIA = 8;
274        HEADPHONE_MEDIA_RECOMMENDATIONS = 9;
275        TIMER = 10;
276        STOPWATCH = 11;
277        FITNESS_ACTIVITY = 12;
278        UPCOMING_REMINDER = 13;
279        UPCOMING_BEDTIME = 14;
280        TIME_TO_LEAVE = 15;
281        PACKAGE_DELIVERED = 16;
282        TIPS = 17;
283        DOORBELL = 18;
284        CROSS_DEVICE_TIMER = 19;
285    }
286
287    // The surface that SmartSpace card is shown.
288    enum DisplaySurface {
289        DEFAULT_SURFACE = 0;
290        HOMESCREEN = 1;
291        LOCKSCREEN = 2;
292        AOD = 3;
293        SHADE = 4;
294        DREAM_OVERLAY = 5;
295    }
296
297    // The event id (e.g., impression, click, longpress, dismiss)
298    optional int32 event_id = 1;
299    // Uniquely identifies a card. Should persist through updates.
300    optional int32 instance_id = 2;
301    // Uniquely identifies one of the possible types of the SmartSpace cards.
302    // Deprecated. Please read card_type_id instead.
303    optional CardType card_type = 3 [deprecated = true];
304    // Location of the card when the event occurred.
305    optional DisplaySurface display_surface = 4;
306    // The position of the card in the carousel when the event occurred.
307    optional int32 rank = 5;
308    // The number of cards shown to the user.
309    optional int32 cardinality = 6;
310    // Uniquely identifies one of the possible types of the SmartSpace cards.
311    // To replace card_type. See go/smartspace-aster-metrics#card-type-id.
312    optional int32 card_type_id = 7;
313    // The app that the Smartspace card is tied to.
314    optional int32 uid = 8 [(is_uid) = true];
315    // This represents the interacted subaction for the given card.
316    optional int32 interacted_subcard_rank = 9;
317    // This represents the number of displayed subactions on the given card when a subaction click
318    // occurred.
319    optional int32 interacted_subcard_cardinality = 10;
320    // The time it takes in ms from smartspace target is created to sysui receives
321    // the target.
322    optional int32 received_latency_millis = 11;
323    // The sub cards.
324    optional SmartSpaceSubcards subcards_info = 12 [(log_mode) = MODE_BYTES];
325    // Holds all the dimensions for this event. See go/ss-dimensional-logging for details.
326    optional SmartspaceCardDimensionalInfo dimensional_info = 13 [(log_mode) = MODE_BYTES];
327}
328
329// Holds all the dimensions tied to a Smartspace event.
330message SmartspaceCardDimensionalInfo {
331    repeated SmartspaceFeatureDimension feature_dimensions = 1;
332}
333
334message SmartspaceFeatureDimension {
335    // This maps to an enum value in Android System Intelligence.
336    optional int32 feature_dimension_id = 1;
337
338    // The value for this dimension.
339    optional int32 feature_dimension_value = 2;
340}
341
342/**
343 * This message represents information about any SmartSpace subcards.
344 * Logged from
345 *   vendor/unbundled_google/packages/SystemUIGoogle/bcsmartspace/src/com/google/android/systemui/smartspace/BcSmartspaceLogger.java
346 *   vendor/unbundled_google/packages/NexusLauncher/src/com/google/android/apps/nexuslauncher/qsb/SmartspaceViewContainer.java
347 * Next Tag: 3
348 */
349message SmartSpaceSubcards {
350    // List of subcards.
351    repeated SmartSpaceCardMetadata subcards = 1;
352    // The index of the clicked subcard, if applicable.
353    // This index is 1 indexed as opposed to 0 indexed due to sint32 encoding
354    // limitation when using -1 as a default.
355    // Default will be 0 to denote that no subcard was clicked.
356    // Please note this has no information about whether the primary card was
357    // clicked or not. Basically if this has the value 0, just ignore this field.
358    optional int32 clicked_subcard_index = 2;
359}
360
361/**
362 * This message represents metadata for a SmartSpace card.
363 * Logged from
364 *   vendor/unbundled_google/packages/SystemUIGoogle/bcsmartspace/src/com/google/android/systemui/smartspace/BcSmartspaceLogger.java
365 *   vendor/unbundled_google/packages/NexusLauncher/src/com/google/android/apps/nexuslauncher/qsb/SmartspaceViewContainer.java
366 * Next Tag: 3
367 */
368message SmartSpaceCardMetadata {
369    // Uniquely identifies a card. Should persist through updates.
370    optional int32 instance_id = 1;
371    // The type of the card.
372    optional int32 card_type_id = 2;
373}
374
375/**
376 * Used for snapshot of the HomeScreen UI elements
377 *
378 * Logged from:
379 *   packages/apps/Launcher3
380 */
381message LauncherStaticLayout {
382    // The event id (e.g., snapshot, drag and drop)
383    optional int32 event_id = 1;
384    // The event's source or target id (e.g., icon, shortcut, widget)
385    optional int32 target_id = 2;
386    // If the target needs to be tracked, use this id field
387    optional int32 instance_id = 3;
388    optional int32 uid = 4 [(is_uid) = true];
389    optional string package_name = 5;
390    optional string component_name = 6;
391
392    // (x, y) coordinate and the index information of the target on the container
393    optional int32 grid_x = 7 [default = -1];
394    optional int32 grid_y = 8 [default = -1];
395    optional int32 page_id = 9 [default = -2];
396
397    // e.g., folder icon's (x, y) location and index information on the workspace
398    // e.g., when used with widgets target, use these values for (span_x, span_y)
399    optional int32 grid_x_parent = 10 [default = -1];
400    optional int32 grid_y_parent = 11 [default = -1];
401    optional int32 page_id_parent = 12 [default = -2];
402
403    // UNKNOWN = 0
404    // HOTSEAT = 1
405    // WORKSPACE = 2
406    // FOLDER_HOTSEAT = 3
407    // FOLDER_WORKSPACE = 4
408    optional int32 hierarchy = 13;
409
410    optional bool is_work_profile = 14;
411
412    // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
413    optional int32 origin = 15;
414
415    // e.g., number of icons inside a folder
416    optional int32 cardinality = 16;
417
418    // e.g., (x, y) span of the widget inside homescreen grid system
419    optional int32 span_x = 17 [default = 1];
420    optional int32 span_y = 18 [default = 1];
421
422    // Used to store features of the target (e.g. widget is reconfigurable, etc)
423    optional int32 features = 19;
424
425    // List of attributes attached to the event.
426    optional LauncherAttributes attributes = 20 [(log_mode) = MODE_BYTES];
427}
428
429/**
430 * Used for logging launcher static elements using pulled atom.
431 *
432 * Logged from:
433 *   packages/apps/Launcher3
434 */
435message LauncherLayoutSnapshot {
436  // The event id (e.g., snapshot, drag and drop)
437  optional int32 event_id = 1;
438  // The event's source or target id (e.g., icon, shortcut, widget)
439  optional int32 item_id = 2;
440  // If the target needs to be tracked, use this id field
441  optional int32 instance_id = 3;
442  optional int32 uid = 4 [(is_uid) = true];
443  optional string package_name = 5;
444  optional string component_name = 6;
445
446  // (x, y) coordinate and the index information of the target on the container
447  optional int32 grid_x = 7 [default = -1];
448  optional int32 grid_y = 8 [default = -1];
449  optional int32 page_id = 9 [default = -2];
450
451  // e.g., folder icon's (x, y) location and index information on the workspace
452  // e.g., when used with widgets target, use these values for (span_x, span_y)
453  optional int32 grid_x_parent = 10 [default = -1];
454  optional int32 grid_y_parent = 11 [default = -1];
455  optional int32 page_id_parent = 12 [default = -2];
456
457  // UNKNOWN = 0
458  // HOTSEAT = 1
459  // WORKSPACE = 2
460  // FOLDER_HOTSEAT = 3
461  // FOLDER_WORKSPACE = 4
462  optional int32 container_id = 13;
463
464  optional bool is_work_profile = 14;
465
466  // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
467  optional int32 attribute_id = 15;
468
469  // e.g., number of icons inside a folder
470  optional int32 cardinality = 16;
471
472  // e.g., (x, y) span of the widget inside homescreen grid system
473  optional int32 span_x = 17 [default = 1];
474  optional int32 span_y = 18 [default = 1];
475
476  // List of attributes attached to the event.
477  optional LauncherAttributes attributes = 19 [(log_mode) = MODE_BYTES];
478
479  optional bool is_kids_mode = 20;
480}
481
482/**
483 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
484 *
485 * Logged from:
486 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
487 */
488message NotificationPanelReported {
489    // The event_id (as for UiEventReported).
490    optional int32 event_id = 1;
491    optional int32 num_notifications = 2;
492    // The notifications in the panel, in the order that they appear there.
493    optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
494}
495
496message Notification {
497    // The notifying app's uid and package.
498    optional int32 uid = 1 [(is_uid) = true];
499    optional string package_name = 2;
500    // A small system-assigned identifier for the notification.
501    optional int32 instance_id = 3;
502
503    // Grouping information.
504    optional int32 group_instance_id = 4;
505    optional bool is_group_summary = 5;
506
507    // The section of the shade that the notification is in.
508    // See SystemUI Notifications.proto.
509    enum NotificationSection {
510        SECTION_UNKNOWN = 0;
511        SECTION_HEADS_UP = 1;
512        SECTION_MEDIA_CONTROLS = 2;
513        SECTION_PEOPLE = 3;
514        SECTION_ALERTING = 4;
515        SECTION_SILENT = 5;
516        SECTION_FOREGROUND_SERVICE = 6;
517    }
518    optional NotificationSection section = 6;
519}
520
521message NotificationList {
522    repeated Notification notifications = 1;  // An ordered sequence of notifications.
523}
524
525/**
526 * Snapshot of notification memory use aggregated per-package and per-style.
527 * One message for each notification style of each package showing notifications.
528 * Logged from
529 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
530 */
531message NotificationMemoryUse {
532    // UID if the application (can be mapped to package and version)
533    optional int32 uid = 1;
534    // Integer enum value showing aggregated notification style.
535    optional int32 style = 2;
536    // Number of notifications that were aggregated into this metric.
537    optional int32 count = 3;
538    // Number of notifications with actually inflated views in this metric.
539    optional int32 countWithInflatedViews = 4;
540    // Memory use of small icon Bitmaps in KB.
541    optional int32 smallIconObject = 5;
542    // Count of notifications with small icons as bitmaps.
543    optional int32 smallIconBitmapCount = 6;
544    // Memory use of large icon Bitmaps in KB.
545    optional int32 largeIconObject = 7;
546    // Count of notifications with large icons as bitmaps.
547    optional int32 largeIconBitmapCount = 8;
548    // Memory use of big picture style Bitmaps in KB.
549    optional int32 bigPictureObject = 9;
550    // Count of notifications with big picture images as bitmaps.
551    optional int32 bigPictureBitmapCount = 10;
552    // Complete memory use of extras in Notification object, in KB.
553    optional int32 extras = 11;
554    // Memory use of extenders in KB.
555    optional int32 extenders = 12;
556    // Combined memory use of small icon drawables in views, in KB.
557    optional int32 smallIconViews = 13;
558    // Combined memory use of large icon drawables in views, in KB.
559    optional int32 largeIconViews = 14;
560    // Combined memory use of system icon drawables in views, in KB.
561    optional int32 systemIconViews = 15;
562    // Combined memory use of style drawables (e.g. BigPicture) in views, in KB.
563    optional int32 styleViews = 16;
564    // Combined memory use of custom view drawables in views, in KB.
565    optional int32 customViews = 17;
566    // Extra memory used due to usage of software bitmaps, in KB.
567    optional int32 softwareBitmaps = 18;
568    // How many notifications were actually ever shown to the user.
569    optional int32 seenCount = 19;
570}
571
572/**
573 * Logs when accessibility floating menu changed its position by user.
574 *
575 * Logged from:
576 *   frameworks/base/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu
577 */
578message AccessibilityFloatingMenuUIChanged {
579    // Normalized screen position of the accessibility floating menu. The range is between 0 and 1.
580    optional float normalized_x_position = 1;
581    optional float normalized_y_position = 2;
582
583    enum Orientation {
584        UNKNOWN = 0;
585        PORTRAIT = 1;
586        LANDSCAPE = 2;
587    }
588    // Orientation of the device when accessibility floating menu changed.
589    optional Orientation orientation = 3;
590}
591
592/*
593 * Logs when the Media Output Switcher finishes a media switch operation.
594 *
595 * Logged from:
596 *  packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
597 */
598message MediaOutputOpSwitchReported {
599    // Source medium type before switching.
600    optional android.app.settings.mediaoutput.MediumType source = 1;
601
602    // Target medium type after switching.
603    optional android.app.settings.mediaoutput.MediumType target = 2;
604
605    // The result of switching.
606    optional android.app.settings.mediaoutput.SwitchResult result = 3;
607
608    // The detail code of a switching result.
609    optional android.app.settings.mediaoutput.SubResult subresult = 4;
610
611    /*
612     * The package name of a pre-installed app, whose media session is being switched.
613     */
614    optional string media_session_package_name = 5;
615
616    // The amount of available wired devices when a switching is being performed.
617    optional int32 available_wired_device_count = 6;
618
619    // The amount of available Bluetooth devices a switching is being performed.
620    optional int32 available_bt_device_count = 7;
621
622    // The amount of available remote devices when a switching is being performed.
623    optional int32 available_remote_device_count = 8;
624
625    // The amount of applied devices within a remote dynamic group after a switching is done.
626    optional int32 applied_device_count_within_remote_group = 9;
627
628    // Indicate target device is suggested route
629    optional bool target_is_suggested = 10;
630
631    // Indicate target device has ongoing session or not
632    optional bool target_has_ongoing_session = 11;
633}
634
635/*
636 * Logs when the user interact with Media Output Switcher.
637 *
638 * Logged from:
639 *  packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
640 */
641message MediaOutputOpInteractionReported {
642    /** * The type of interaction with the output switch dialog. */
643    enum InteractionType {
644        EXPANSION = 0;
645        ADJUST_VOLUME = 1;
646        STOP_CASTING = 2;
647        MUTE = 3;
648        UNMUTE = 4;
649    }
650
651    // Type of interaction.
652    optional InteractionType interaction_type = 1;
653
654    // Type of device that interaction with.
655    optional android.app.settings.mediaoutput.MediumType target = 2;
656
657    // The package name of an application whose media session is being switched.
658    optional string media_session_package_name= 3;
659
660    // Indicate target device is suggested route
661    optional bool target_is_suggested = 4;
662}
663
664/**
665 * Logs the gesture stage changed event.
666 *
667 * Logged from:
668 *   frameworks/base/packages/SystemUI/
669 */
670message AssistGestureStageReported {
671    optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
672}
673
674/**
675 * Logs the feedback type.
676 *
677 * Logged from:
678 *   frameworks/base/packages/SystemUI/
679 */
680message AssistGestureFeedbackReported {
681    // Whether or not the gesture was used.
682    optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
683}
684
685/**
686 * Logs the progress.
687 *
688 * Logged from:
689 *   frameworks/base/packages/SystemUI/
690 */
691message AssistGestureProgressReported {
692    // [0,100] progress for the assist gesture.
693    optional int32 progress = 1;
694}
695
696/*
697 * Reports a device controls user interaction
698 *
699 * Logged from:
700 *   frameworks/base/packages/SystemUI/src/com/android/systemui/controls/ControlsMetricsLoggerImpl.kt
701 */
702message DeviceControlChanged {
703    // The event_id
704    optional int32 event_id = 1;
705    // An identifier to tie together multiple logs relating to the same controls session
706    optional int32 instance_id = 2;
707    // The type of device the user has interacted with (android.service.controls.DeviceTypes)
708    optional int32 device_type = 3;
709    // The service app uid.
710    optional int32 uid = 4 [(is_uid) = true];
711    // Is the device locked while the action started
712    optional bool is_locked = 5;
713}
714
715/**
716 * Logs for Launcher latency. Uses KLL to reduce the data pression
717 *
718 * Logged from:
719 *      vendor/unbundled_google/packages/NexusLauncher
720 */
721message LauncherLatency {
722    // The event id generated from go/uievents
723    optional int32 event_id = 1;
724    // The instance id to track multiple partial durations or parellel running durations
725    optional int32 instance_id = 2;
726    optional int32 package_id = 3;
727    optional int64 latency_in_millis = 4;
728    optional int32 type = 5;
729    optional int32 query_length = 6 [default = -1];
730    optional int32 sub_event_type = 7;
731    // Size of work to complete within the latency duration. E.g. number of workspace items to initialize during launcher startup.
732    optional int32 cardinality = 8 [default = -1];
733}
734
735/**
736 * Logs for Launcher Impression logging.
737 *
738 * Logged from:
739 *      vendor/unbundled_google/packages/NexusLauncher
740 */
741message LauncherImpressionEvent {
742    // The event id generated from go/uievents
743    optional int32 event_id = 1;
744    // The instance id to track multiple partial impression event.
745    optional int32 instance_id = 2;
746
747    // The state defines the surface where the impression is being logged.
748    optional int32 state = 3;
749    optional int32 query_length = 4 [default = -1];
750
751    // ResultType of the search result as defined in frameworks/libs/systemui/searchuilib/src/com/android/app/search/ResultType.java
752    repeated int32 result_type = 5;
753
754    // Number of results of corresponding result_type.
755    repeated int32 result_count = 6;
756
757    // If the corresponding result_type is above or below keyboard.
758    // If 50% of result is visible, then is_above_keyboard = true
759    repeated bool is_above_keyboard = 7;
760
761    // UID of the application (can be mapped to package name) corresponding to the result_type.
762    // The default value of uid entry will be -1 to indicate package name is not
763    // found.
764    repeated int32 uid = 8 [(is_uid) = true];
765}
766
767/**
768 * Logs for task manager events
769 *
770 * Logged from SystemUI
771 */
772message TaskManagerEventReported {
773
774    enum Event {
775        VIEWED = 1;
776        STOPPED = 2;
777    }
778
779    optional int32 uid = 1 [(is_uid) = true];
780
781    optional Event event = 2;
782
783    optional int64 time_running_ms = 3;
784}
785