summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/notification/NotificationMainView.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-02-01 09:13:24 -0800
committerTony Wickham <twickham@google.com>2017-02-07 10:16:52 -0800
commitc6b79e307f59e936ee380da07b0bd6fafe0a490c (patch)
tree864121cc6cf3534fea8b01aae0de210eafe3bf55 /src/com/android/launcher3/notification/NotificationMainView.java
parentdb7b82960a54b85510aaeba2f543b37b4dc59fc8 (diff)
downloadandroid_packages_apps_Trebuchet-c6b79e307f59e936ee380da07b0bd6fafe0a490c.tar.gz
android_packages_apps_Trebuchet-c6b79e307f59e936ee380da07b0bd6fafe0a490c.tar.bz2
android_packages_apps_Trebuchet-c6b79e307f59e936ee380da07b0bd6fafe0a490c.zip
Add logging for notifications.
- Log notification launches - Log notification swipes - Fix logDragNDrop() to only log if the pre-drag ends (so it doesn't log a long-press that only shows shortcuts without dragging). - Add shortcut rank to logs when launching deep shortcuts, where 0 is the shortcut closest to the app icon (highest rank). Bug: 34770729 Bug: 32410600 Change-Id: I99dcef9b6a71da2ef58e32397702bb137407b10f
Diffstat (limited to 'src/com/android/launcher3/notification/NotificationMainView.java')
-rw-r--r--src/com/android/launcher3/notification/NotificationMainView.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher3/notification/NotificationMainView.java b/src/com/android/launcher3/notification/NotificationMainView.java
index 76a84b7c6..6677c2fa2 100644
--- a/src/com/android/launcher3/notification/NotificationMainView.java
+++ b/src/com/android/launcher3/notification/NotificationMainView.java
@@ -20,18 +20,19 @@ import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
-import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
+import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherViewPropertyAnimator;
import com.android.launcher3.R;
import com.android.launcher3.graphics.IconPalette;
+import com.android.launcher3.userevent.nano.LauncherLogProto;
/**
* A {@link LinearLayout} that contains a single notification, e.g. icon + title + text.
@@ -89,6 +90,9 @@ public class NotificationMainView extends LinearLayout implements SwipeHelper.Ca
getContext(), mIconPalette.backgroundColor));
setOnClickListener(mNotificationInfo);
setTranslationX(0);
+ // Add a dummy ItemInfo so that logging populates the correct container and item types
+ // instead of DEFAULT_CONTAINERTYPE and DEFAULT_ITEMTYPE, respectively.
+ setTag(new ItemInfo());
if (animate) {
AnimatorSet animation = LauncherAnimUtils.createAnimatorSet();
Animator textFade = new LauncherViewPropertyAnimator(mTextView).alpha(1);
@@ -135,8 +139,13 @@ public class NotificationMainView extends LinearLayout implements SwipeHelper.Ca
@Override
public void onChildDismissed(View v) {
- Launcher.getLauncher(getContext()).getPopupDataProvider().cancelNotification(
+ Launcher launcher = Launcher.getLauncher(getContext());
+ launcher.getPopupDataProvider().cancelNotification(
mNotificationInfo.notificationKey);
+ launcher.getUserEventDispatcher().logActionOnItem(
+ LauncherLogProto.Action.Touch.SWIPE,
+ LauncherLogProto.Action.Direction.RIGHT, // Assume all swipes are right for logging.
+ LauncherLogProto.ItemType.NOTIFICATION);
}
@Override