diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-05-09 16:18:58 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2018-05-15 14:31:07 -0700 |
commit | 018eec68997342ca87e4ea607ab292adb12d7a34 (patch) | |
tree | 201552fbbe4a681a27b2533ecdf3784218b828cd /quickstep | |
parent | c14adabe99aa120dc2e9cef64b4553f757f3086f (diff) | |
download | android_packages_apps_Trebuchet-018eec68997342ca87e4ea607ab292adb12d7a34.tar.gz android_packages_apps_Trebuchet-018eec68997342ca87e4ea607ab292adb12d7a34.tar.bz2 android_packages_apps_Trebuchet-018eec68997342ca87e4ea607ab292adb12d7a34.zip |
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
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/libs/sysui_shared.jar | bin | 128394 -> 128240 bytes | |||
-rw-r--r-- | quickstep/src/com/android/quickstep/OverviewCommandHelper.java | 13 | ||||
-rw-r--r-- | quickstep/src/com/android/quickstep/TouchInteractionService.java | 5 | ||||
-rw-r--r-- | quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java | 52 |
4 files changed, 69 insertions, 1 deletions
diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar Binary files differindex b343cc205..95bb8bbed 100644 --- a/quickstep/libs/sysui_shared.jar +++ b/quickstep/libs/sysui_shared.jar diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index c1462460b..81a73fc65 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -48,8 +48,10 @@ import android.view.ViewConfiguration; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; +import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.anim.AnimationSuccessListener; +import com.android.launcher3.logging.UserEventDispatcher; import com.android.quickstep.ActivityControlHelper.ActivityInitListener; import com.android.quickstep.ActivityControlHelper.AnimationFactory; import com.android.quickstep.ActivityControlHelper.FallbackActivityControllerHelper; @@ -189,6 +191,17 @@ public class OverviewCommandHelper { mMainThreadExecutor.execute(new ShowRecentsCommand()); } + public void onTip(int actionType, int viewType) { + mMainThreadExecutor.execute(new Runnable() { + @Override + public void run() { + UserEventDispatcher.newInstance(mContext, + new InvariantDeviceProfile(mContext).getDeviceProfile(mContext)) + .logActionTip(actionType, viewType); + } + }); + } + public ActivityControlHelper getActivityControlHelper() { return mActivityControlHelper; } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 7496b4782..bd05b6d7b 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -147,6 +147,11 @@ public class TouchInteractionService extends Service { TraceHelper.endSection("SysUiBinder", "onQuickStep"); } + + @Override + public void onTip(int actionType, int viewType) { + mOverviewCommandHelper.onTip(actionType, viewType); + } }; private final TouchConsumer mNoOpTouchConsumer = (ev) -> {}; diff --git a/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java index d4cdd3556..04153cc99 100644 --- a/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java +++ b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java @@ -15,15 +15,32 @@ */ package com.android.quickstep.logging; +import android.util.Log; + +import static com.android.launcher3.logging.LoggerUtils.newAction; +import static com.android.launcher3.logging.LoggerUtils.newContainerTarget; +import static com.android.launcher3.logging.LoggerUtils.newLauncherEvent; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.CANCEL_TARGET; +import static com.android.systemui.shared.system.LauncherEventUtil.VISIBLE; +import static com.android.systemui.shared.system.LauncherEventUtil.DISMISS; +import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_QUICK_SCRUB_ONBOARDING_TIP; +import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_SWIPE_UP_ONBOARDING_TIP; + import com.android.launcher3.logging.UserEventDispatcher; +import com.android.launcher3.model.nano.LauncherDumpProto; +import com.android.launcher3.userevent.nano.LauncherLogExtensions; import com.android.launcher3.userevent.nano.LauncherLogProto; +import com.android.systemui.shared.system.LauncherEventUtil; import com.android.systemui.shared.system.MetricsLoggerCompat; /** - * This class handles AOSP MetricsLogger function calls. + * This class handles AOSP MetricsLogger function calls and logging around + * quickstep interactions. */ public class UserEventDispatcherExtension extends UserEventDispatcher { + private static final String TAG = "UserEventDispatcher"; + public void logStateChangeAction(int action, int dir, int srcChildTargetType, int srcParentContainerType, int dstContainerType, int pageIndex) { @@ -32,4 +49,37 @@ public class UserEventDispatcherExtension extends UserEventDispatcher { super.logStateChangeAction(action, dir, srcChildTargetType, srcParentContainerType, dstContainerType, pageIndex); } + + public void logActionTip(int actionType, int viewType) { + LauncherLogProto.Action action = new LauncherLogProto.Action(); + LauncherLogProto.Target target = new LauncherLogProto.Target(); + switch(actionType) { + case VISIBLE: + action.type = LauncherLogProto.Action.Type.TIP; + target.type = LauncherLogProto.Target.Type.CONTAINER; + target.containerType = LauncherLogProto.ContainerType.TIP; + break; + case DISMISS: + action.type = LauncherLogProto.Action.Type.TOUCH; + action.touch = LauncherLogProto.Action.Touch.TAP; + target.type = LauncherLogProto.Target.Type.CONTROL; + target.controlType = CANCEL_TARGET; + break; + default: + Log.e(TAG, "Unexpected action type = " + actionType); + } + + switch(viewType) { + case RECENTS_QUICK_SCRUB_ONBOARDING_TIP: + target.tipType = LauncherLogProto.TipType.QUICK_SCRUB_TEXT; + break; + case RECENTS_SWIPE_UP_ONBOARDING_TIP: + target.tipType = LauncherLogProto.TipType.SWIPE_UP_TEXT; + break; + default: + Log.e(TAG, "Unexpected viewType = " + viewType); + } + LauncherLogProto.LauncherEvent event = newLauncherEvent(action, target); + dispatchUserEvent(event, null); + } } |