Add latency cuj definition of smart space doorbell

Bug: 226518453
Test: atest LatencyTrackerTest
Test: adb logcat
Test: Capture the trace locally
Change-Id: I2296c7ce75e8cbd8e45fcee9e2e2f0bf8c57e334
Merged-In: I2296c7ce75e8cbd8e45fcee9e2e2f0bf8c57e334
This commit is contained in:
Ahan Wu
2022-12-22 15:33:04 +00:00
committed by Wu Ahan
parent be45482224
commit 81b6d626a4

View File

@@ -35,6 +35,7 @@ import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPOR
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_BACK_ARROW;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_SELECTION_TOOLBAR;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_VOICE_INTERACTION;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SMARTSPACE_DOORBELL;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_START_RECENTS_ANIMATION;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SWITCH_DISPLAY_UNFOLD;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_TOGGLE_RECENTS;
@@ -205,6 +206,15 @@ public class LatencyTracker {
*/
public static final int ACTION_REQUEST_IME_HIDDEN = 21;
/**
* Time it takes to load the animation frames in smart space doorbell card.
* It measures the duration from the images uris are passed into the view
* to all the frames are loaded.
* <p/>
* A long latency makes the doorbell animation looks janky until all the frames are loaded.
*/
public static final int ACTION_SMARTSPACE_DOORBELL = 22;
private static final int[] ACTIONS_ALL = {
ACTION_EXPAND_PANEL,
ACTION_TOGGLE_RECENTS,
@@ -228,6 +238,7 @@ public class LatencyTracker {
ACTION_SHOW_VOICE_INTERACTION,
ACTION_REQUEST_IME_SHOWN,
ACTION_REQUEST_IME_HIDDEN,
ACTION_SMARTSPACE_DOORBELL,
};
/** @hide */
@@ -254,6 +265,7 @@ public class LatencyTracker {
ACTION_SHOW_VOICE_INTERACTION,
ACTION_REQUEST_IME_SHOWN,
ACTION_REQUEST_IME_HIDDEN,
ACTION_SMARTSPACE_DOORBELL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Action {
@@ -283,6 +295,7 @@ public class LatencyTracker {
UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_VOICE_INTERACTION,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_SHOWN,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_SMARTSPACE_DOORBELL,
};
private static LatencyTracker sLatencyTracker;
@@ -411,6 +424,8 @@ public class LatencyTracker {
return "ACTION_REQUEST_IME_SHOWN";
case UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN:
return "ACTION_REQUEST_IME_HIDDEN";
case UIACTION_LATENCY_REPORTED__ACTION__ACTION_SMARTSPACE_DOORBELL:
return "ACTION_SMARTSPACE_DOORBELL";
default:
throw new IllegalArgumentException("Invalid action");
}