From a41587b91fedffe6f7ba643c6ee99ff1eed7df57 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 11 Feb 2016 18:43:06 -0800 Subject: [PATCH] Add logging for actions around gear behind notifications Bug: 22451710 Change-Id: Ife93a9fb983e53585445d5827dd4c15f5b35d637 --- .../src/com/android/systemui/statusbar/BaseStatusBar.java | 2 ++ .../statusbar/stack/NotificationStackScrollLayout.java | 4 ++++ proto/src/metrics_constants.proto | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index f63e97a11430c..469a1fc58be14 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1090,6 +1090,8 @@ public abstract class BaseStatusBar extends SystemUI implements @Override public void onGearDisplayed(ExpandableNotificationRow row) { + MetricsLogger.action(mContext, MetricsEvent.ACTION_REVEAL_GEAR, + row.getStatusBarNotification().getPackageName()); mNotificationGearDisplayed = row; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index e8dad92e7b195..29b1d18f26982 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -48,6 +48,8 @@ import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.widget.OverScroller; +import com.android.internal.logging.MetricsLogger; +import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.systemui.ExpandHelper; import com.android.systemui.Interpolators; import com.android.systemui.R; @@ -363,6 +365,8 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void onGearTouched(ExpandableNotificationRow row, int x, int y) { if (mLongPressListener != null) { + MetricsLogger.action(mContext, MetricsEvent.ACTION_TOUCH_GEAR, + row.getStatusBarNotification().getPackageName()); mLongPressListener.onLongPress(row, x, y); } } diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index 5d693c988fd05..8171b49480e9b 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -1927,6 +1927,14 @@ message MetricsEvent { // access before; action pass package name of calling package. ACTION_SCOPED_DIRECTORY_ACCESS_ALREADY_GRANTED_BY_PACKAGE = 331; + // Logged when the user slides a notification and + // reveals the gear beneath it. + ACTION_REVEAL_GEAR = 332; + + // Logged when the user taps on the gear beneath + // a notification. + ACTION_TOUCH_GEAR = 333; + // Add new aosp constants above this line. // END OF AOSP CONSTANTS