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 17 package com.android.internal.jank; 18 19 import android.annotation.IntDef; 20 21 import com.android.internal.annotations.VisibleForTesting; 22 import com.android.internal.util.FrameworkStatsLog; 23 24 import java.lang.annotation.Retention; 25 import java.lang.annotation.RetentionPolicy; 26 import java.util.Arrays; 27 28 /** @hide */ 29 public class Cuj { 30 @VisibleForTesting 31 public static final int MAX_LENGTH_OF_CUJ_NAME = 82; 32 33 // Every value must have a corresponding entry in CUJ_STATSD_INTERACTION_TYPE. 34 public static final int CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE = 0; 35 public static final int CUJ_NOTIFICATION_SHADE_SCROLL_FLING = 2; 36 public static final int CUJ_NOTIFICATION_SHADE_ROW_EXPAND = 3; 37 public static final int CUJ_NOTIFICATION_SHADE_ROW_SWIPE = 4; 38 public static final int CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE = 5; 39 public static final int CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPE = 6; 40 public static final int CUJ_LAUNCHER_APP_LAUNCH_FROM_RECENTS = 7; 41 public static final int CUJ_LAUNCHER_APP_LAUNCH_FROM_ICON = 8; 42 public static final int CUJ_LAUNCHER_APP_CLOSE_TO_HOME = 9; 43 public static final int CUJ_LAUNCHER_APP_CLOSE_TO_PIP = 10; 44 public static final int CUJ_LAUNCHER_QUICK_SWITCH = 11; 45 public static final int CUJ_NOTIFICATION_HEADS_UP_APPEAR = 12; 46 public static final int CUJ_NOTIFICATION_HEADS_UP_DISAPPEAR = 13; 47 public static final int CUJ_NOTIFICATION_ADD = 14; 48 public static final int CUJ_NOTIFICATION_REMOVE = 15; 49 public static final int CUJ_NOTIFICATION_APP_START = 16; 50 public static final int CUJ_LOCKSCREEN_PASSWORD_APPEAR = 17; 51 public static final int CUJ_LOCKSCREEN_PATTERN_APPEAR = 18; 52 public static final int CUJ_LOCKSCREEN_PIN_APPEAR = 19; 53 public static final int CUJ_LOCKSCREEN_PASSWORD_DISAPPEAR = 20; 54 public static final int CUJ_LOCKSCREEN_PATTERN_DISAPPEAR = 21; 55 public static final int CUJ_LOCKSCREEN_PIN_DISAPPEAR = 22; 56 public static final int CUJ_LOCKSCREEN_TRANSITION_FROM_AOD = 23; 57 public static final int CUJ_LOCKSCREEN_TRANSITION_TO_AOD = 24; 58 public static final int CUJ_LAUNCHER_OPEN_ALL_APPS = 25; 59 public static final int CUJ_LAUNCHER_ALL_APPS_SCROLL = 26; 60 public static final int CUJ_LAUNCHER_APP_LAUNCH_FROM_WIDGET = 27; 61 public static final int CUJ_SETTINGS_PAGE_SCROLL = 28; 62 public static final int CUJ_LOCKSCREEN_UNLOCK_ANIMATION = 29; 63 public static final int CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON = 30; 64 public static final int CUJ_SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER = 31; 65 public static final int CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE = 32; 66 public static final int CUJ_SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON = 33; 67 public static final int CUJ_STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP = 34; 68 public static final int CUJ_PIP_TRANSITION = 35; 69 public static final int CUJ_WALLPAPER_TRANSITION = 36; 70 public static final int CUJ_USER_SWITCH = 37; 71 public static final int CUJ_SPLASHSCREEN_AVD = 38; 72 public static final int CUJ_SPLASHSCREEN_EXIT_ANIM = 39; 73 public static final int CUJ_SCREEN_OFF = 40; 74 public static final int CUJ_SCREEN_OFF_SHOW_AOD = 41; 75 public static final int CUJ_ONE_HANDED_ENTER_TRANSITION = 42; 76 public static final int CUJ_ONE_HANDED_EXIT_TRANSITION = 43; 77 public static final int CUJ_UNFOLD_ANIM = 44; 78 public static final int CUJ_SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS = 45; 79 public static final int CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS = 46; 80 public static final int CUJ_SUW_LOADING_TO_NEXT_FLOW = 47; 81 public static final int CUJ_SUW_LOADING_SCREEN_FOR_STATUS = 48; 82 public static final int CUJ_SPLIT_SCREEN_ENTER = 49; 83 public static final int CUJ_SPLIT_SCREEN_EXIT = 50; 84 public static final int CUJ_LOCKSCREEN_LAUNCH_CAMERA = 51; // reserved. 85 public static final int CUJ_SPLIT_SCREEN_RESIZE = 52; 86 public static final int CUJ_SETTINGS_SLIDER = 53; 87 public static final int CUJ_TAKE_SCREENSHOT = 54; 88 public static final int CUJ_VOLUME_CONTROL = 55; 89 public static final int CUJ_BIOMETRIC_PROMPT_TRANSITION = 56; 90 public static final int CUJ_SETTINGS_TOGGLE = 57; 91 public static final int CUJ_SHADE_DIALOG_OPEN = 58; 92 public static final int CUJ_USER_DIALOG_OPEN = 59; 93 public static final int CUJ_TASKBAR_EXPAND = 60; 94 public static final int CUJ_TASKBAR_COLLAPSE = 61; 95 public static final int CUJ_SHADE_CLEAR_ALL = 62; 96 public static final int CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION = 63; 97 public static final int CUJ_LOCKSCREEN_OCCLUSION = 64; 98 public static final int CUJ_RECENTS_SCROLLING = 65; 99 public static final int CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS = 66; 100 public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE = 67; 101 public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME = 68; 102 public static final int CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION = 70; 103 public static final int CUJ_LAUNCHER_OPEN_SEARCH_RESULT = 71; 104 // 72 - 77 are reserved for b/281564325. 105 106 /** 107 * In some cases when we do not have any end-target, we play a simple slide-down animation. 108 * eg: Open an app from Overview/Task switcher such that there is no home-screen icon. 109 * eg: Exit the app using back gesture. 110 */ 111 public static final int CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK = 78; 112 // 79 is reserved. 113 public static final int CUJ_IME_INSETS_SHOW_ANIMATION = 80; 114 public static final int CUJ_IME_INSETS_HIDE_ANIMATION = 81; 115 116 public static final int CUJ_SPLIT_SCREEN_DOUBLE_TAP_DIVIDER = 82; 117 118 public static final int CUJ_LAUNCHER_UNFOLD_ANIM = 83; 119 120 public static final int CUJ_PREDICTIVE_BACK_CROSS_ACTIVITY = 84; 121 public static final int CUJ_PREDICTIVE_BACK_CROSS_TASK = 85; 122 public static final int CUJ_PREDICTIVE_BACK_HOME = 86; 123 // 87 is reserved - previously assigned to deprecated CUJ_LAUNCHER_SEARCH_QSB_OPEN. 124 public static final int CUJ_BACK_PANEL_ARROW = 88; 125 public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK = 89; 126 public static final int CUJ_LAUNCHER_SEARCH_QSB_WEB_SEARCH = 90; 127 public static final int CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE = 91; 128 public static final int CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR = 92; 129 public static final int CUJ_LAUNCHER_SAVE_APP_PAIR = 93; 130 public static final int CUJ_LAUNCHER_ALL_APPS_SEARCH_BACK = 95; 131 public static final int CUJ_LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK = 96; 132 public static final int CUJ_LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK = 97; 133 public static final int CUJ_LAUNCHER_WIDGET_PICKER_CLOSE_BACK = 98; 134 public static final int CUJ_LAUNCHER_WIDGET_PICKER_SEARCH_BACK = 99; 135 public static final int CUJ_LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK = 100; 136 public static final int CUJ_LAUNCHER_WIDGET_EDU_SHEET_CLOSE_BACK = 101; 137 public static final int CUJ_LAUNCHER_PRIVATE_SPACE_LOCK = 102; 138 public static final int CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK = 103; 139 140 // When adding a CUJ, update this and make sure to also update CUJ_TO_STATSD_INTERACTION_TYPE. 141 @VisibleForTesting 142 static final int LAST_CUJ = CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK; 143 144 /** @hide */ 145 @IntDef({ 146 CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE, 147 CUJ_NOTIFICATION_SHADE_SCROLL_FLING, 148 CUJ_NOTIFICATION_SHADE_ROW_EXPAND, 149 CUJ_NOTIFICATION_SHADE_ROW_SWIPE, 150 CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE, 151 CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPE, 152 CUJ_LAUNCHER_APP_LAUNCH_FROM_RECENTS, 153 CUJ_LAUNCHER_APP_LAUNCH_FROM_ICON, 154 CUJ_LAUNCHER_APP_CLOSE_TO_HOME, 155 CUJ_LAUNCHER_APP_CLOSE_TO_PIP, 156 CUJ_LAUNCHER_QUICK_SWITCH, 157 CUJ_NOTIFICATION_HEADS_UP_APPEAR, 158 CUJ_NOTIFICATION_HEADS_UP_DISAPPEAR, 159 CUJ_NOTIFICATION_ADD, 160 CUJ_NOTIFICATION_REMOVE, 161 CUJ_NOTIFICATION_APP_START, 162 CUJ_LOCKSCREEN_PASSWORD_APPEAR, 163 CUJ_LOCKSCREEN_PATTERN_APPEAR, 164 CUJ_LOCKSCREEN_PIN_APPEAR, 165 CUJ_LOCKSCREEN_PASSWORD_DISAPPEAR, 166 CUJ_LOCKSCREEN_PATTERN_DISAPPEAR, 167 CUJ_LOCKSCREEN_PIN_DISAPPEAR, 168 CUJ_LOCKSCREEN_TRANSITION_FROM_AOD, 169 CUJ_LOCKSCREEN_TRANSITION_TO_AOD, 170 CUJ_LAUNCHER_OPEN_ALL_APPS, 171 CUJ_LAUNCHER_ALL_APPS_SCROLL, 172 CUJ_LAUNCHER_APP_LAUNCH_FROM_WIDGET, 173 CUJ_SETTINGS_PAGE_SCROLL, 174 CUJ_LOCKSCREEN_UNLOCK_ANIMATION, 175 CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON, 176 CUJ_SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER, 177 CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE, 178 CUJ_SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON, 179 CUJ_STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP, 180 CUJ_PIP_TRANSITION, 181 CUJ_WALLPAPER_TRANSITION, 182 CUJ_USER_SWITCH, 183 CUJ_SPLASHSCREEN_AVD, 184 CUJ_SPLASHSCREEN_EXIT_ANIM, 185 CUJ_SCREEN_OFF, 186 CUJ_SCREEN_OFF_SHOW_AOD, 187 CUJ_ONE_HANDED_ENTER_TRANSITION, 188 CUJ_ONE_HANDED_EXIT_TRANSITION, 189 CUJ_UNFOLD_ANIM, 190 CUJ_SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS, 191 CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS, 192 CUJ_SUW_LOADING_TO_NEXT_FLOW, 193 CUJ_SUW_LOADING_SCREEN_FOR_STATUS, 194 CUJ_SPLIT_SCREEN_ENTER, 195 CUJ_SPLIT_SCREEN_EXIT, 196 CUJ_LOCKSCREEN_LAUNCH_CAMERA, 197 CUJ_SPLIT_SCREEN_RESIZE, 198 CUJ_SETTINGS_SLIDER, 199 CUJ_TAKE_SCREENSHOT, 200 CUJ_VOLUME_CONTROL, 201 CUJ_BIOMETRIC_PROMPT_TRANSITION, 202 CUJ_SETTINGS_TOGGLE, 203 CUJ_SHADE_DIALOG_OPEN, 204 CUJ_USER_DIALOG_OPEN, 205 CUJ_TASKBAR_EXPAND, 206 CUJ_TASKBAR_COLLAPSE, 207 CUJ_SHADE_CLEAR_ALL, 208 CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION, 209 CUJ_LOCKSCREEN_OCCLUSION, 210 CUJ_RECENTS_SCROLLING, 211 CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, 212 CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE, 213 CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME, 214 CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION, 215 CUJ_LAUNCHER_OPEN_SEARCH_RESULT, 216 CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK, 217 CUJ_IME_INSETS_SHOW_ANIMATION, 218 CUJ_IME_INSETS_HIDE_ANIMATION, 219 CUJ_SPLIT_SCREEN_DOUBLE_TAP_DIVIDER, 220 CUJ_LAUNCHER_UNFOLD_ANIM, 221 CUJ_PREDICTIVE_BACK_CROSS_ACTIVITY, 222 CUJ_PREDICTIVE_BACK_CROSS_TASK, 223 CUJ_PREDICTIVE_BACK_HOME, 224 CUJ_BACK_PANEL_ARROW, 225 CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK, 226 CUJ_LAUNCHER_SEARCH_QSB_WEB_SEARCH, 227 CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE, 228 CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR, 229 CUJ_LAUNCHER_SAVE_APP_PAIR, 230 CUJ_LAUNCHER_ALL_APPS_SEARCH_BACK, 231 CUJ_LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK, 232 CUJ_LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK, 233 CUJ_LAUNCHER_WIDGET_PICKER_CLOSE_BACK, 234 CUJ_LAUNCHER_WIDGET_PICKER_SEARCH_BACK, 235 CUJ_LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK, 236 CUJ_LAUNCHER_PRIVATE_SPACE_LOCK, 237 CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK 238 }) 239 @Retention(RetentionPolicy.SOURCE) 240 public @interface CujType { 241 } 242 243 private static final int NO_STATSD_LOGGING = -1; 244 245 // Used to convert CujType to InteractionType enum value for statsd logging. 246 // Use NO_STATSD_LOGGING in case the measurement for a given CUJ should not be logged to statsd. 247 private static final int[] CUJ_TO_STATSD_INTERACTION_TYPE = new int[LAST_CUJ + 1]; 248 static { Arrays.fill(CUJ_TO_STATSD_INTERACTION_TYPE, NO_STATSD_LOGGING)249 Arrays.fill(CUJ_TO_STATSD_INTERACTION_TYPE, NO_STATSD_LOGGING); 250 251 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__NOTIFICATION_SHADE_SWIPE; 252 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_SCROLL_FLING] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_SCROLL_FLING; 253 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_ROW_EXPAND] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_ROW_EXPAND; 254 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_ROW_SWIPE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_ROW_SWIPE; 255 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_QS_EXPAND_COLLAPSE; 256 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_QS_SCROLL_SWIPE; 257 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_LAUNCH_FROM_RECENTS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_LAUNCH_FROM_RECENTS; 258 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_LAUNCH_FROM_ICON] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_LAUNCH_FROM_ICON; 259 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_CLOSE_TO_HOME] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_CLOSE_TO_HOME; 260 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_CLOSE_TO_PIP] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_CLOSE_TO_PIP; 261 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_QUICK_SWITCH] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_QUICK_SWITCH; 262 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_HEADS_UP_APPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_HEADS_UP_APPEAR; 263 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_HEADS_UP_DISAPPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_HEADS_UP_DISAPPEAR; 264 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_ADD] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_NOTIFICATION_ADD; 265 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_REMOVE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_NOTIFICATION_REMOVE; 266 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_NOTIFICATION_APP_START] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH; 267 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PASSWORD_APPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PASSWORD_APPEAR; 268 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PATTERN_APPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PATTERN_APPEAR; 269 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PIN_APPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PIN_APPEAR; 270 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PASSWORD_DISAPPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PASSWORD_DISAPPEAR; 271 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PATTERN_DISAPPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PATTERN_DISAPPEAR; 272 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_PIN_DISAPPEAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PIN_DISAPPEAR; 273 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_TRANSITION_FROM_AOD] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_TRANSITION_FROM_AOD; 274 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_TRANSITION_TO_AOD] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_TRANSITION_TO_AOD; 275 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_OPEN_ALL_APPS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OPEN_ALL_APPS; 276 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_ALL_APPS_SCROLL] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_ALL_APPS_SCROLL; 277 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_LAUNCH_FROM_WIDGET] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_LAUNCH_FROM_WIDGET; 278 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SETTINGS_PAGE_SCROLL] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_PAGE_SCROLL; 279 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_UNLOCK_ANIMATION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_UNLOCK_ANIMATION; 280 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON; 281 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER; 282 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_QS_TILE; 283 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON; 284 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP; 285 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_PIP_TRANSITION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__PIP_TRANSITION; 286 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_WALLPAPER_TRANSITION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__WALLPAPER_TRANSITION; 287 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_USER_SWITCH] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__USER_SWITCH; 288 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLASHSCREEN_AVD] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLASHSCREEN_AVD; 289 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLASHSCREEN_EXIT_ANIM] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLASHSCREEN_EXIT_ANIM; 290 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SCREEN_OFF] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SCREEN_OFF; 291 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SCREEN_OFF_SHOW_AOD] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SCREEN_OFF_SHOW_AOD; 292 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_ONE_HANDED_ENTER_TRANSITION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__ONE_HANDED_ENTER_TRANSITION; 293 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_ONE_HANDED_EXIT_TRANSITION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__ONE_HANDED_EXIT_TRANSITION; 294 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_UNFOLD_ANIM] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__UNFOLD_ANIM; 295 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS; 296 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS; 297 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SUW_LOADING_TO_NEXT_FLOW] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_TO_NEXT_FLOW; 298 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SUW_LOADING_SCREEN_FOR_STATUS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_SCREEN_FOR_STATUS; 299 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLIT_SCREEN_ENTER] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_ENTER; 300 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLIT_SCREEN_EXIT] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_EXIT; 301 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_LAUNCH_CAMERA] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_LAUNCH_CAMERA; 302 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLIT_SCREEN_RESIZE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_RESIZE; 303 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SETTINGS_SLIDER] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_SLIDER; 304 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_TAKE_SCREENSHOT] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__TAKE_SCREENSHOT; 305 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_VOLUME_CONTROL] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__VOLUME_CONTROL; 306 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_BIOMETRIC_PROMPT_TRANSITION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__BIOMETRIC_PROMPT_TRANSITION; 307 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SETTINGS_TOGGLE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_TOGGLE; 308 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_DIALOG_OPEN] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_DIALOG_OPEN; 309 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_USER_DIALOG_OPEN] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__USER_DIALOG_OPEN; 310 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_TASKBAR_EXPAND] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__TASKBAR_EXPAND; 311 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_TASKBAR_COLLAPSE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__TASKBAR_COLLAPSE; 312 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SHADE_CLEAR_ALL] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_CLEAR_ALL; 313 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_UNLOCK_ENTRANCE_ANIMATION; 314 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_OCCLUSION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_OCCLUSION; 315 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_RECENTS_SCROLLING] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__RECENTS_SCROLLING; 316 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_SWIPE_TO_RECENTS; 317 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_SWIPE; 318 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_TO_HOME; 319 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_CLOCK_MOVE_ANIMATION; 320 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_OPEN_SEARCH_RESULT] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OPEN_SEARCH_RESULT; 321 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK; 322 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_IME_INSETS_SHOW_ANIMATION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__IME_INSETS_SHOW_ANIMATION; 323 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_IME_INSETS_HIDE_ANIMATION] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__IME_INSETS_HIDE_ANIMATION; 324 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_SPLIT_SCREEN_DOUBLE_TAP_DIVIDER] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_DOUBLE_TAP_DIVIDER; 325 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_UNFOLD_ANIM] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_UNFOLD_ANIM; 326 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_PREDICTIVE_BACK_CROSS_ACTIVITY] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__PREDICTIVE_BACK_CROSS_ACTIVITY; 327 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_PREDICTIVE_BACK_CROSS_TASK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__PREDICTIVE_BACK_CROSS_TASK; 328 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_PREDICTIVE_BACK_HOME] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__PREDICTIVE_BACK_HOME; 329 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_BACK_PANEL_ARROW] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__BACK_PANEL_ARROW; 330 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_BACK; 331 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_SEARCH_QSB_WEB_SEARCH] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_SEARCH_QSB_WEB_SEARCH; 332 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE; 333 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR; 334 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_SAVE_APP_PAIR] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_SAVE_APP_PAIR; 335 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_ALL_APPS_SEARCH_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_ALL_APPS_SEARCH_BACK; 336 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK; 337 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK; 338 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_WIDGET_PICKER_CLOSE_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_WIDGET_PICKER_CLOSE_BACK; 339 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_WIDGET_PICKER_SEARCH_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_WIDGET_PICKER_SEARCH_BACK; 340 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK; 341 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_WIDGET_EDU_SHEET_CLOSE_BACK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_WIDGET_EDU_SHEET_CLOSE_BACK; 342 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_PRIVATE_SPACE_LOCK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_PRIVATE_SPACE_LOCK; 343 CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_PRIVATE_SPACE_UNLOCK; 344 } 345 Cuj()346 private Cuj() { 347 } 348 349 /** 350 * A helper method to translate CUJ type to CUJ name. 351 * 352 * @param cujType the cuj type defined in this file 353 * @return the name of the cuj type 354 */ getNameOfCuj(int cujType)355 public static String getNameOfCuj(int cujType) { 356 // Please note: 357 // 1. The length of the returned string shouldn't exceed MAX_LENGTH_OF_CUJ_NAME. 358 // 2. The returned string should be the same with the name defined in atoms.proto. 359 switch (cujType) { 360 case CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE: 361 return "NOTIFICATION_SHADE_EXPAND_COLLAPSE"; 362 case CUJ_NOTIFICATION_SHADE_SCROLL_FLING: 363 return "NOTIFICATION_SHADE_SCROLL_FLING"; 364 case CUJ_NOTIFICATION_SHADE_ROW_EXPAND: 365 return "NOTIFICATION_SHADE_ROW_EXPAND"; 366 case CUJ_NOTIFICATION_SHADE_ROW_SWIPE: 367 return "NOTIFICATION_SHADE_ROW_SWIPE"; 368 case CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE: 369 return "NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE"; 370 case CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPE: 371 return "NOTIFICATION_SHADE_QS_SCROLL_SWIPE"; 372 case CUJ_LAUNCHER_APP_LAUNCH_FROM_RECENTS: 373 return "LAUNCHER_APP_LAUNCH_FROM_RECENTS"; 374 case CUJ_LAUNCHER_APP_LAUNCH_FROM_ICON: 375 return "LAUNCHER_APP_LAUNCH_FROM_ICON"; 376 case CUJ_LAUNCHER_APP_CLOSE_TO_HOME: 377 return "LAUNCHER_APP_CLOSE_TO_HOME"; 378 case CUJ_LAUNCHER_APP_CLOSE_TO_PIP: 379 return "LAUNCHER_APP_CLOSE_TO_PIP"; 380 case CUJ_LAUNCHER_QUICK_SWITCH: 381 return "LAUNCHER_QUICK_SWITCH"; 382 case CUJ_NOTIFICATION_HEADS_UP_APPEAR: 383 return "NOTIFICATION_HEADS_UP_APPEAR"; 384 case CUJ_NOTIFICATION_HEADS_UP_DISAPPEAR: 385 return "NOTIFICATION_HEADS_UP_DISAPPEAR"; 386 case CUJ_NOTIFICATION_ADD: 387 return "NOTIFICATION_ADD"; 388 case CUJ_NOTIFICATION_REMOVE: 389 return "NOTIFICATION_REMOVE"; 390 case CUJ_NOTIFICATION_APP_START: 391 return "NOTIFICATION_APP_START"; 392 case CUJ_LOCKSCREEN_PASSWORD_APPEAR: 393 return "LOCKSCREEN_PASSWORD_APPEAR"; 394 case CUJ_LOCKSCREEN_PATTERN_APPEAR: 395 return "LOCKSCREEN_PATTERN_APPEAR"; 396 case CUJ_LOCKSCREEN_PIN_APPEAR: 397 return "LOCKSCREEN_PIN_APPEAR"; 398 case CUJ_LOCKSCREEN_PASSWORD_DISAPPEAR: 399 return "LOCKSCREEN_PASSWORD_DISAPPEAR"; 400 case CUJ_LOCKSCREEN_PATTERN_DISAPPEAR: 401 return "LOCKSCREEN_PATTERN_DISAPPEAR"; 402 case CUJ_LOCKSCREEN_PIN_DISAPPEAR: 403 return "LOCKSCREEN_PIN_DISAPPEAR"; 404 case CUJ_LOCKSCREEN_TRANSITION_FROM_AOD: 405 return "LOCKSCREEN_TRANSITION_FROM_AOD"; 406 case CUJ_LOCKSCREEN_TRANSITION_TO_AOD: 407 return "LOCKSCREEN_TRANSITION_TO_AOD"; 408 case CUJ_LAUNCHER_OPEN_ALL_APPS : 409 return "LAUNCHER_OPEN_ALL_APPS"; 410 case CUJ_LAUNCHER_ALL_APPS_SCROLL: 411 return "LAUNCHER_ALL_APPS_SCROLL"; 412 case CUJ_LAUNCHER_APP_LAUNCH_FROM_WIDGET: 413 return "LAUNCHER_APP_LAUNCH_FROM_WIDGET"; 414 case CUJ_SETTINGS_PAGE_SCROLL: 415 return "SETTINGS_PAGE_SCROLL"; 416 case CUJ_LOCKSCREEN_UNLOCK_ANIMATION: 417 return "LOCKSCREEN_UNLOCK_ANIMATION"; 418 case CUJ_SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON: 419 return "SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON"; 420 case CUJ_SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER: 421 return "SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER"; 422 case CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE: 423 return "SHADE_APP_LAUNCH_FROM_QS_TILE"; 424 case CUJ_SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON: 425 return "SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON"; 426 case CUJ_STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP: 427 return "STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP"; 428 case CUJ_PIP_TRANSITION: 429 return "PIP_TRANSITION"; 430 case CUJ_WALLPAPER_TRANSITION: 431 return "WALLPAPER_TRANSITION"; 432 case CUJ_USER_SWITCH: 433 return "USER_SWITCH"; 434 case CUJ_SPLASHSCREEN_AVD: 435 return "SPLASHSCREEN_AVD"; 436 case CUJ_SPLASHSCREEN_EXIT_ANIM: 437 return "SPLASHSCREEN_EXIT_ANIM"; 438 case CUJ_SCREEN_OFF: 439 return "SCREEN_OFF"; 440 case CUJ_SCREEN_OFF_SHOW_AOD: 441 return "SCREEN_OFF_SHOW_AOD"; 442 case CUJ_ONE_HANDED_ENTER_TRANSITION: 443 return "ONE_HANDED_ENTER_TRANSITION"; 444 case CUJ_ONE_HANDED_EXIT_TRANSITION: 445 return "ONE_HANDED_EXIT_TRANSITION"; 446 case CUJ_UNFOLD_ANIM: 447 return "UNFOLD_ANIM"; 448 case CUJ_SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS: 449 return "SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS"; 450 case CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS: 451 return "SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS"; 452 case CUJ_SUW_LOADING_TO_NEXT_FLOW: 453 return "SUW_LOADING_TO_NEXT_FLOW"; 454 case CUJ_SUW_LOADING_SCREEN_FOR_STATUS: 455 return "SUW_LOADING_SCREEN_FOR_STATUS"; 456 case CUJ_SPLIT_SCREEN_ENTER: 457 return "SPLIT_SCREEN_ENTER"; 458 case CUJ_SPLIT_SCREEN_EXIT: 459 return "SPLIT_SCREEN_EXIT"; 460 case CUJ_LOCKSCREEN_LAUNCH_CAMERA: 461 return "LOCKSCREEN_LAUNCH_CAMERA"; 462 case CUJ_SPLIT_SCREEN_RESIZE: 463 return "SPLIT_SCREEN_RESIZE"; 464 case CUJ_SETTINGS_SLIDER: 465 return "SETTINGS_SLIDER"; 466 case CUJ_TAKE_SCREENSHOT: 467 return "TAKE_SCREENSHOT"; 468 case CUJ_VOLUME_CONTROL: 469 return "VOLUME_CONTROL"; 470 case CUJ_BIOMETRIC_PROMPT_TRANSITION: 471 return "BIOMETRIC_PROMPT_TRANSITION"; 472 case CUJ_SETTINGS_TOGGLE: 473 return "SETTINGS_TOGGLE"; 474 case CUJ_SHADE_DIALOG_OPEN: 475 return "SHADE_DIALOG_OPEN"; 476 case CUJ_USER_DIALOG_OPEN: 477 return "USER_DIALOG_OPEN"; 478 case CUJ_TASKBAR_EXPAND: 479 return "TASKBAR_EXPAND"; 480 case CUJ_TASKBAR_COLLAPSE: 481 return "TASKBAR_COLLAPSE"; 482 case CUJ_SHADE_CLEAR_ALL: 483 return "SHADE_CLEAR_ALL"; 484 case CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION: 485 return "LAUNCHER_UNLOCK_ENTRANCE_ANIMATION"; 486 case CUJ_LOCKSCREEN_OCCLUSION: 487 return "LOCKSCREEN_OCCLUSION"; 488 case CUJ_RECENTS_SCROLLING: 489 return "RECENTS_SCROLLING"; 490 case CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS: 491 return "LAUNCHER_APP_SWIPE_TO_RECENTS"; 492 case CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE: 493 return "LAUNCHER_CLOSE_ALL_APPS_SWIPE"; 494 case CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME: 495 return "LAUNCHER_CLOSE_ALL_APPS_TO_HOME"; 496 case CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION: 497 return "LOCKSCREEN_CLOCK_MOVE_ANIMATION"; 498 case CUJ_LAUNCHER_OPEN_SEARCH_RESULT: 499 return "LAUNCHER_OPEN_SEARCH_RESULT"; 500 case CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK: 501 return "LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK"; 502 case CUJ_IME_INSETS_SHOW_ANIMATION: 503 return "IME_INSETS_SHOW_ANIMATION"; 504 case CUJ_IME_INSETS_HIDE_ANIMATION: 505 return "IME_INSETS_HIDE_ANIMATION"; 506 case CUJ_SPLIT_SCREEN_DOUBLE_TAP_DIVIDER: 507 return "SPLIT_SCREEN_DOUBLE_TAP_DIVIDER"; 508 case CUJ_LAUNCHER_UNFOLD_ANIM: 509 return "LAUNCHER_UNFOLD_ANIM"; 510 case CUJ_PREDICTIVE_BACK_CROSS_ACTIVITY: 511 return "PREDICTIVE_BACK_CROSS_ACTIVITY"; 512 case CUJ_PREDICTIVE_BACK_CROSS_TASK: 513 return "PREDICTIVE_BACK_CROSS_TASK"; 514 case CUJ_PREDICTIVE_BACK_HOME: 515 return "PREDICTIVE_BACK_HOME"; 516 case CUJ_BACK_PANEL_ARROW: 517 return "BACK_PANEL_ARROW"; 518 case CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK: 519 return "LAUNCHER_CLOSE_ALL_APPS_BACK"; 520 case CUJ_LAUNCHER_SEARCH_QSB_WEB_SEARCH: 521 return "LAUNCHER_SEARCH_QSB_WEB_SEARCH"; 522 case CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE: 523 return "LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE"; 524 case CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR: 525 return "LAUNCHER_LAUNCH_APP_PAIR_FROM_TASKBAR"; 526 case CUJ_LAUNCHER_SAVE_APP_PAIR: 527 return "LAUNCHER_SAVE_APP_PAIR"; 528 case CUJ_LAUNCHER_ALL_APPS_SEARCH_BACK: 529 return "LAUNCHER_ALL_APPS_SEARCH_BACK"; 530 case CUJ_LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK: 531 return "LAUNCHER_TASKBAR_ALL_APPS_CLOSE_BACK"; 532 case CUJ_LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK: 533 return "LAUNCHER_TASKBAR_ALL_APPS_SEARCH_BACK"; 534 case CUJ_LAUNCHER_WIDGET_PICKER_CLOSE_BACK: 535 return "LAUNCHER_WIDGET_PICKER_CLOSE_BACK"; 536 case CUJ_LAUNCHER_WIDGET_PICKER_SEARCH_BACK: 537 return "LAUNCHER_WIDGET_PICKER_SEARCH_BACK"; 538 case CUJ_LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK: 539 return "LAUNCHER_WIDGET_BOTTOM_SHEET_CLOSE_BACK"; 540 case CUJ_LAUNCHER_WIDGET_EDU_SHEET_CLOSE_BACK: 541 return "LAUNCHER_WIDGET_EDU_SHEET_CLOSE_BACK"; 542 case CUJ_LAUNCHER_PRIVATE_SPACE_LOCK: 543 return "LAUNCHER_PRIVATE_SPACE_LOCK"; 544 case CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK: 545 return "LAUNCHER_PRIVATE_SPACE_UNLOCK"; 546 } 547 return "UNKNOWN"; 548 } 549 getStatsdInteractionType(@ujType int cujType)550 public static int getStatsdInteractionType(@CujType int cujType) { 551 return CUJ_TO_STATSD_INTERACTION_TYPE[cujType]; 552 } 553 554 /** Returns whether the measurements for the given CUJ should be written to statsd. */ logToStatsd(@ujType int cujType)555 public static boolean logToStatsd(@CujType int cujType) { 556 return getStatsdInteractionType(cujType) != NO_STATSD_LOGGING; 557 } 558 559 /** 560 * A helper method to translate interaction type to CUJ name. 561 * 562 * @param interactionType the interaction type defined in AtomsProto.java 563 * @return the name of the interaction type 564 */ getNameOfInteraction(int interactionType)565 public static String getNameOfInteraction(int interactionType) { 566 // There is an offset amount of 1 between cujType and interactionType. 567 return Cuj.getNameOfCuj(getCujTypeFromInteraction(interactionType)); 568 } 569 570 /** 571 * A helper method to translate interaction type to CUJ type. 572 * 573 * @param interactionType the interaction type defined in AtomsProto.java 574 * @return the integer in {@link Cuj.CujType} 575 */ getCujTypeFromInteraction(int interactionType)576 private static int getCujTypeFromInteraction(int interactionType) { 577 return interactionType - 1; 578 } 579 } 580