Add logging for Onboarding

Bug: 73784423

* Discovery bounce, homescreen, hotseat
UserEvent: action:TIP
UserEvent:  Source child:HOTSEAT id=0 BOUNCE

* Discovery bounce, overview, prediction
UserEvent: action:TIP
UserEvent:  Source child:PREDICTION BOUNCE

* Swipe up from navbar text (visibility, cancel target)
UserEvent: action:TIP
UserEvent:  Source child:TIP SWIPE_UP_TEXT

UserEvent: action:TAP
UserEvent:  Source child:CANCEL_TARGET SWIPE_UP_TEXT

* Quickscrub text (visibility, cancel target)
UserEvent: action:TIP
UserEvent:  Source child:TIP QUICK_SCRUB_TEXT

UserEvent: action:TAP
UserEvent:  Source child:CANCEL_TARGET QUICK_SCRUB_TEXT

* Prediction apps text (visibility, cancel target)
UserEvent: action:TAP
UserEvent:  Source child:TIP PREDICTION_TEXT

UserEvent: action:TAP
UserEvent:  Source child:CANCEL_TARGET PREDICTION_TEXT

Change-Id: I94710b5ed3d00e3599985b154eb660af4a958288
This commit is contained in:
Hyunyoung Song
2018-05-09 16:18:58 -07:00
parent c14adabe99
commit 018eec6899
8 changed files with 130 additions and 9 deletions

View File

@@ -16,8 +16,10 @@
package com.android.launcher3.logging;
import static com.android.launcher3.logging.LoggerUtils.newAction;
import static com.android.launcher3.logging.LoggerUtils.newCommandAction;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
import static com.android.launcher3.logging.LoggerUtils.newControlTarget;
import static com.android.launcher3.logging.LoggerUtils.newDropTarget;
import static com.android.launcher3.logging.LoggerUtils.newItemTarget;
import static com.android.launcher3.logging.LoggerUtils.newLauncherEvent;
@@ -163,6 +165,8 @@ public class UserEventDispatcher {
dispatchUserEvent(event, intent);
}
public void logActionTip(int actionType, int viewType) { }
public void logTaskLaunchOrDismiss(int action, int direction, ComponentKey componentKey) {
LauncherEvent event = newLauncherEvent(newTouchAction(action), // TAP or SWIPE or FLING
newTarget(Target.Type.ITEM));
@@ -243,6 +247,15 @@ public class UserEventDispatcher {
logActionOnControl(action, controlType, controlInContainer, -1);
}
public void logActionOnControl(int action, int controlType, int parentContainer,
int grandParentContainer){
LauncherEvent event = newLauncherEvent(newTouchAction(action),
newControlTarget(controlType),
newContainerTarget(parentContainer),
newContainerTarget(grandParentContainer));
dispatchUserEvent(event, null);
}
public void logActionOnControl(int action, int controlType, @Nullable View controlInContainer,
int parentContainerType) {
final LauncherEvent event = (controlInContainer == null && parentContainerType < 0)
@@ -269,6 +282,13 @@ public class UserEventDispatcher {
dispatchUserEvent(event, null);
}
public void logActionBounceTip(int containerType) {
LauncherEvent event = newLauncherEvent(newAction(Action.Type.TIP),
newContainerTarget(containerType));
event.srcTarget[0].tipType = LauncherLogProto.TipType.BOUNCE;
dispatchUserEvent(event, null);
}
public void logActionOnContainer(int action, int dir, int containerType) {
logActionOnContainer(action, dir, containerType, 0);
}
@@ -393,7 +413,7 @@ public class UserEventDispatcher {
if (!IS_VERBOSE) {
return;
}
String log = "action:" + LoggerUtils.getActionStr(ev.action);
String log = "\n\naction:" + LoggerUtils.getActionStr(ev.action);
if (ev.srcTarget != null && ev.srcTarget.length > 0) {
log += "\n Source " + getTargetsStr(ev.srcTarget);
}