Merge "Add latency cuj definition of smart space doorbell" into udc-dev am: 07c35a365f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22089923

Change-Id: I90bb69f34cfab33b9aed0e7abe1e2e02bcc7b1c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-03-24 04:27:16 +00:00
committed by Automerger Merge Worker

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_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_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_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_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_SWITCH_DISPLAY_UNFOLD;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_TOGGLE_RECENTS; 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; 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 = { private static final int[] ACTIONS_ALL = {
ACTION_EXPAND_PANEL, ACTION_EXPAND_PANEL,
ACTION_TOGGLE_RECENTS, ACTION_TOGGLE_RECENTS,
@@ -228,6 +238,7 @@ public class LatencyTracker {
ACTION_SHOW_VOICE_INTERACTION, ACTION_SHOW_VOICE_INTERACTION,
ACTION_REQUEST_IME_SHOWN, ACTION_REQUEST_IME_SHOWN,
ACTION_REQUEST_IME_HIDDEN, ACTION_REQUEST_IME_HIDDEN,
ACTION_SMARTSPACE_DOORBELL,
}; };
/** @hide */ /** @hide */
@@ -254,6 +265,7 @@ public class LatencyTracker {
ACTION_SHOW_VOICE_INTERACTION, ACTION_SHOW_VOICE_INTERACTION,
ACTION_REQUEST_IME_SHOWN, ACTION_REQUEST_IME_SHOWN,
ACTION_REQUEST_IME_HIDDEN, ACTION_REQUEST_IME_HIDDEN,
ACTION_SMARTSPACE_DOORBELL,
}) })
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface Action { public @interface Action {
@@ -283,6 +295,7 @@ public class LatencyTracker {
UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_VOICE_INTERACTION, UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_VOICE_INTERACTION,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_SHOWN, UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_SHOWN,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN, UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN,
UIACTION_LATENCY_REPORTED__ACTION__ACTION_SMARTSPACE_DOORBELL,
}; };
private final Object mLock = new Object(); private final Object mLock = new Object();
@@ -407,6 +420,8 @@ public class LatencyTracker {
return "ACTION_REQUEST_IME_SHOWN"; return "ACTION_REQUEST_IME_SHOWN";
case UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN: case UIACTION_LATENCY_REPORTED__ACTION__ACTION_REQUEST_IME_HIDDEN:
return "ACTION_REQUEST_IME_HIDDEN"; return "ACTION_REQUEST_IME_HIDDEN";
case UIACTION_LATENCY_REPORTED__ACTION__ACTION_SMARTSPACE_DOORBELL:
return "ACTION_SMARTSPACE_DOORBELL";
default: default:
throw new IllegalArgumentException("Invalid action"); throw new IllegalArgumentException("Invalid action");
} }