Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcec993f authored by Susi Kharraz-Post's avatar Susi Kharraz-Post
Browse files

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
parent 09207ac8
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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));
            }
        }

+7 −0
Original line number Diff line number Diff line
@@ -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