Improve Task user event logging
Bug: 79539824
Bug: 79541772
(1) Added page index of the TASK that is being launched
(2) Covers all three cases of task launch (tap, swipe down, quick scrub)
UserEvent: action:FLING direction=DOWN
UserEvent: Source child:TASK, packageHash=-1598699687, componentHash=1952702153, pageIdx=0
UserEvent: action:DRAGDROP
UserEvent: Source child:TASK, packageHash=-744307622, componentHash=-515832044, pageIdx=4
(3) Avoid double logging (When onStop is called, it is not logged if
the cause of onStop is APP or TASK launch)
Change-Id: Ic5db7d6a640d43bfb5cd667b49e37dd0ed127d5c
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index bf73149..e851499 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -240,7 +240,6 @@
private PendingRequestArgs mPendingRequestArgs;
public ViewGroupFocusHelper mFocusHandler;
- private boolean mAppLaunchSuccess;
private RotationHelper mRotationHelper;
@@ -730,10 +729,8 @@
}
mAppWidgetHost.setListenIfResumed(false);
- if (!mAppLaunchSuccess) {
- getUserEventDispatcher().logActionCommand(Action.Command.STOP,
- mStateManager.getState().containerType, -1);
- }
+ getUserEventDispatcher().logActionCommand(Action.Command.STOP,
+ mStateManager.getState().containerType, -1);
NotificationListener.removeNotificationsChangedListener();
getStateManager().moveToRestState();
@@ -760,7 +757,6 @@
super.onResume();
TraceHelper.partitionSection("ON_RESUME", "superCall");
- mAppLaunchSuccess = false;
getUserEventDispatcher().resetElapsedSessionMillis();
setOnResumeCallback(null);
// Process any items that were added while Launcher was away.
@@ -1634,8 +1630,8 @@
}
public boolean startActivitySafely(View v, Intent intent, ItemInfo item) {
- mAppLaunchSuccess = super.startActivitySafely(v, intent, item);
- if (mAppLaunchSuccess && v instanceof BubbleTextView) {
+ boolean success = super.startActivitySafely(v, intent, item);
+ if (success && v instanceof BubbleTextView) {
// This is set to the view that launched the activity that navigated the user away
// from launcher. Since there is no callback for when the activity has finished
// launching, enable the press state and keep this reference to reset the press
@@ -1644,7 +1640,7 @@
btv.setStayPressed(true);
setOnResumeCallback(btv);
}
- return mAppLaunchSuccess;
+ return success;
}
boolean isHotseatLayout(View layout) {