From bdd861e2e39435fb8d1f5871a7b650efc1a18d44 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Tue, 12 Oct 2021 13:22:31 -0400 Subject: Adds two UiEvent IDs for actions on long screenshots After completing a long screenshot, and viewing the result: SCREENSHOT_LONG_SCREEHSHOT_SAVE - Logged when the "Save" button is tapped SCREENSHOT_LONG_SCREENSHOT_EXIT - Logged then the "Cancel" button is tapped Bug: 200295026 Test: manually, make statsd_testdrive && statsd_testdrive 90 Change-Id: Iba841287a31853685cfe2596f5a591b31c1166af --- .../com/android/systemui/screenshot/LongScreenshotActivity.java | 9 +++++++-- .../src/com/android/systemui/screenshot/ScreenshotEvent.java | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java b/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java index a42b34cf23d0..ba6e98e79ac0 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java @@ -78,6 +78,7 @@ public class LongScreenshotActivity extends Activity { private ImageView mTransitionView; private ImageView mEnterTransitionView; private View mSave; + private View mCancel; private View mEdit; private View mShare; private CropView mCropView; @@ -119,15 +120,15 @@ public class LongScreenshotActivity extends Activity { mSave = requireViewById(R.id.save); mEdit = requireViewById(R.id.edit); mShare = requireViewById(R.id.share); + mCancel = requireViewById(R.id.cancel); mCropView = requireViewById(R.id.crop_view); mMagnifierView = requireViewById(R.id.magnifier); mCropView.setCropInteractionListener(mMagnifierView); mTransitionView = requireViewById(R.id.transition); mEnterTransitionView = requireViewById(R.id.enter_transition); - requireViewById(R.id.cancel).setOnClickListener(v -> finishAndRemoveTask()); - mSave.setOnClickListener(this::onClicked); + mCancel.setOnClickListener(this::onClicked); mEdit.setOnClickListener(this::onClicked); mShare.setOnClickListener(this::onClicked); @@ -353,6 +354,7 @@ public class LongScreenshotActivity extends Activity { v.setPressed(true); setButtonsEnabled(false); if (id == R.id.save) { + mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_SAVED); startExport(PendingAction.SAVE); } else if (id == R.id.edit) { mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EDIT); @@ -360,6 +362,9 @@ public class LongScreenshotActivity extends Activity { } else if (id == R.id.share) { mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_SHARE); startExport(PendingAction.SHARE); + } else if (id == R.id.cancel) { + mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EXIT); + finishAndRemoveTask(); } } diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotEvent.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotEvent.java index 169b28c6b373..d49ff9311718 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotEvent.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotEvent.java @@ -83,7 +83,11 @@ public enum ScreenshotEvent implements UiEventLogger.UiEventEnum { @UiEvent(doc = "Long screenshot editor activity loaded a previously saved screenshot") SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_CACHED_IMAGE_LOADED(890), @UiEvent(doc = "Long screenshot editor activity finished") - SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_FINISHED(891); + SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_FINISHED(891), + @UiEvent(doc = "User has saved a long screenshot to a file") + SCREENSHOT_LONG_SCREENSHOT_SAVED(910), + @UiEvent(doc = "User has discarded the result of a long screenshot") + SCREENSHOT_LONG_SCREENSHOT_EXIT(911); private final int mId; -- cgit v1.2.3-59-g8ed1b