1/* 2 * Copyright (C) 2024 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.desktopmode; 20option java_package = "com.android.os.desktopmode"; 21 22import "frameworks/proto_logging/stats/atoms.proto"; 23import "frameworks/proto_logging/stats/atom_field_options.proto"; 24 25extend Atom { 26 optional DesktopModeUIChanged desktop_mode_ui_changed = 818 [(module) = "framework"]; 27 optional DesktopModeSessionTaskUpdate desktop_mode_session_task_update = 819 [(module) = "framework"]; 28} 29 30/** 31* Logged when there is a change to the Desktop mode UI 32* 33* Logged from 34* frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt 35*/ 36message DesktopModeUIChanged { 37 // User interactions with desktopmode 38 enum Event { 39 UNKNOWN_EVENT = 0; 40 ENTER = 1; 41 EXIT = 2; 42 } 43 44 // The reason for entering desktopmode 45 enum EnterReason { 46 UNKNOWN_ENTER = 0; 47 OVERVIEW = 1; 48 APP_HANDLE_DRAG = 2; 49 APP_HANDLE_MENU_BUTTON = 3; 50 APP_FREEFORM_INTENT = 4; // This covers intent based starts from app-shortcut, taskbar, keyboard shortcuts where we don't use any custom transition 51 KEYBOARD_SHORTCUT_ENTER = 5; 52 SCREEN_ON = 6; // desktop mode visible after screen turned on 53 APP_FROM_OVERVIEW = 7; 54 } 55 56 // The reason for exiting desktopmode 57 enum ExitReason { 58 UNKNOWN_EXIT = 0; 59 DRAG_TO_EXIT = 1; 60 APP_HANDLE_MENU_BUTTON_EXIT = 2; 61 KEYBOARD_SHORTCUT_EXIT = 3; 62 RETURN_HOME_OR_OVERVIEW = 4; // user swiped up to go to overview, or home screen 63 TASK_FINISHED = 5; // the task finished or dismissed 64 SCREEN_OFF = 6; 65 } 66 67 optional Event event = 1; 68 // What triggered desktopmode (if the event is ENTER) 69 optional EnterReason enter_reason = 2; 70 // What triggered leaving desktopmode (if the event is EXIT) 71 optional ExitReason exit_reason = 3; 72 // An id used to identify a desktop mode instance 73 optional int32 session_id = 4; 74} 75 76/** 77* Logged when there is a task update in the desktop mode session 78* 79* Logged from 80* frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt 81*/ 82message DesktopModeSessionTaskUpdate { 83 // The kind of the app event 84 enum TaskEvent { 85 UNKNOWN_TASK_EVENT = 0; 86 TASK_ADDED = 1; 87 TASK_REMOVED = 2; 88 TASK_INFO_CHANGED = 3; // covers both size and position changes of the app 89 } 90 // The event associated with this app update 91 optional TaskEvent task_event = 1; 92 // The instance_id of this task 93 optional int32 instance_id = 2; 94 // The uid of the app associated with this task 95 optional int32 uid = 3; 96 // The height of this task in px 97 optional int32 task_height = 4; 98 // The width of this task in px 99 optional int32 task_width = 5; 100 // the x-coordinate of the top-left corner 101 optional int32 task_x = 6; 102 // the y-coordinate of the top-right corner 103 optional int32 task_y = 7; 104 // An id used to identify a desktop mode instance 105 optional int32 session_id = 8; 106} 107