diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-05-15 21:48:06 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-15 21:48:06 +0000 |
commit | 61745e17c75612d97b62313723831e51d62191bf (patch) | |
tree | 85964414586f132cb6ff2376a94ed1fc3befe4e0 /src | |
parent | 46afdf51941951c8f6e7230d59630156cb1f22db (diff) | |
parent | 018eec68997342ca87e4ea607ab292adb12d7a34 (diff) | |
download | android_packages_apps_Trebuchet-61745e17c75612d97b62313723831e51d62191bf.tar.gz android_packages_apps_Trebuchet-61745e17c75612d97b62313723831e51d62191bf.tar.bz2 android_packages_apps_Trebuchet-61745e17c75612d97b62313723831e51d62191bf.zip |
Merge "Add logging for Onboarding Bug: 73784423" into ub-launcher3-edmonton
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/DiscoveryBounce.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/LoggerUtils.java | 28 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 22 |
3 files changed, 47 insertions, 7 deletions
diff --git a/src/com/android/launcher3/allapps/DiscoveryBounce.java b/src/com/android/launcher3/allapps/DiscoveryBounce.java index e8c5f15df..deaf8d3c1 100644 --- a/src/com/android/launcher3/allapps/DiscoveryBounce.java +++ b/src/com/android/launcher3/allapps/DiscoveryBounce.java @@ -18,6 +18,8 @@ package com.android.launcher3.allapps; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.HOTSEAT; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.PREDICTION; import android.animation.Animator; import android.animation.AnimatorInflater; @@ -127,6 +129,7 @@ public class DiscoveryBounce extends AbstractFloatingView { AnimatorInflater.loadAnimator(launcher, R.animator.discovery_bounce)); view.mIsOpen = true; launcher.getDragLayer().addView(view); + launcher.getUserEventDispatcher().logActionBounceTip(HOTSEAT); } public static void showForOverviewIfNeeded(Launcher launcher) { @@ -173,5 +176,6 @@ public class DiscoveryBounce extends AbstractFloatingView { DiscoveryBounce view = new DiscoveryBounce(launcher, animator); view.mIsOpen = true; launcher.getDragLayer().addView(view); + launcher.getUserEventDispatcher().logActionBounceTip(PREDICTION); } } diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java index 9d97cb9c0..442691f0d 100644 --- a/src/com/android/launcher3/logging/LoggerUtils.java +++ b/src/com/android/launcher3/logging/LoggerUtils.java @@ -31,6 +31,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType; import com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; import com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent; import com.android.launcher3.userevent.nano.LauncherLogProto.Target; +import com.android.launcher3.userevent.nano.LauncherLogProto.TipType; import com.android.launcher3.util.InstantAppResolver; import java.lang.reflect.Field; @@ -76,7 +77,7 @@ public class LoggerUtils { } return str; case Action.Type.COMMAND: return getFieldName(action.command, Action.Command.class); - default: return UNKNOWN; + default: return getFieldName(action.type, Action.Type.class); } } @@ -84,23 +85,32 @@ public class LoggerUtils { if (t == null){ return ""; } + String str = ""; switch (t.type) { case Target.Type.ITEM: - return getItemStr(t); + str = getItemStr(t); + break; case Target.Type.CONTROL: - return getFieldName(t.controlType, ControlType.class); + str = getFieldName(t.controlType, ControlType.class); + break; case Target.Type.CONTAINER: - String str = getFieldName(t.containerType, ContainerType.class); + str = getFieldName(t.containerType, ContainerType.class); if (t.containerType == ContainerType.WORKSPACE || t.containerType == ContainerType.HOTSEAT) { str += " id=" + t.pageIndex; } else if (t.containerType == ContainerType.FOLDER) { str += " grid(" + t.gridX + "," + t.gridY+ ")"; } - return str; + break; default: - return "UNKNOWN TARGET TYPE"; + str += "UNKNOWN TARGET TYPE"; } + + if (t.tipType != TipType.DEFAULT_NONE) { + str += " " + getFieldName(t.tipType, TipType.class); + } + + return str; } private static String getItemStr(Target t) { @@ -186,6 +196,12 @@ public class LoggerUtils { return t; } + public static Target newControlTarget(int controlType) { + Target t = newTarget(Target.Type.CONTROL); + t.controlType = controlType; + return t; + } + public static Target newContainerTarget(int containerType) { Target t = newTarget(Target.Type.CONTAINER); t.containerType = containerType; diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 2c1eb3287..07e1315aa 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -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); } |