diff options
| author | 2019-03-01 16:46:26 -0500 | |
|---|---|---|
| committer | 2019-03-04 08:54:56 -0500 | |
| commit | fcec993fe5dc43b8aa3656192e21a8d4f4c83371 (patch) | |
| tree | 880b571d7d323738d7c21fd9137297ec8721901d | |
| parent | 09207ac8a582a0af23c893745fa805904de8b638 (diff) | |
Add logging for reshuffle of direct share targets
Direct share targets can update after they have been initially
displayed. This modifies the logging that was there to indicate when the
direct targets are displayed for the first time and when they are being
reordered.
Bug: 126920281
Test: successfully ran atest ChooserActivityTest
Change-Id: I1d16c0fb2b5631473879ba9758128e6f482567c2
| -rw-r--r-- | core/java/com/android/internal/app/ChooserActivity.java | 12 | ||||
| -rw-r--r-- | proto/src/metrics_constants/metrics_constants.proto | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index a5a1dd993e0c..67e0446e19e5 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -1889,11 +1889,19 @@ public class ChooserActivity extends ResolverActivity { * Set to true to reveal all service targets at once. */ public void setShowServiceTargets(boolean show) { + // mShowServiceTargets is only flipped once to show direct share targets. But after the + // initial display the list can be re-sorted and the user will see the target list + // change. This will log the initial show and the subsequent shuffle to help us get + // accurate timing of the UX. + if (show) { + getMetricsLogger().write( + new LogMaker(MetricsEvent.ACTION_ACTIVITY_CHOOSER_SHOWN_DIRECT_TARGET) + .setSubtype(mShowServiceTargets ? MetricsEvent.PREVIOUSLY_VISIBLE + : MetricsEvent.PREVIOUSLY_HIDDEN)); + } if (show != mShowServiceTargets) { mShowServiceTargets = show; notifyDataSetChanged(); - getMetricsLogger().write( - new LogMaker(MetricsEvent.ACTION_ACTIVITY_CHOOSER_SHOWN_DIRECT_TARGET)); } } diff --git a/proto/src/metrics_constants/metrics_constants.proto b/proto/src/metrics_constants/metrics_constants.proto index 365c6b4d16ee..3177fb06e003 100644 --- a/proto/src/metrics_constants/metrics_constants.proto +++ b/proto/src/metrics_constants/metrics_constants.proto @@ -253,6 +253,13 @@ message MetricsEvent { MANAGED_PROFILE = 2; } + // Subtypes for showing direct sharing targets + enum DirectShareTargetPreviousState { + PREVIOUSLY_UNKNOWN = 0; + PREVIOUSLY_HIDDEN = 1; + PREVIOUSLY_VISIBLE = 2; + } + // Known visual elements: views or controls. enum View { // Unknown view |