Add logging for long screenshots
Bug: 175830820 Test: statsd_testdrive 90 to observe log events Change-Id: I5697f444898f9b2c52a8984cf5a8924a38ce3f00
This commit is contained in:
@@ -602,7 +602,7 @@ public class ScreenshotController {
|
||||
private void runScrollCapture(ScrollCaptureClient.Connection connection) {
|
||||
cancelTimeout();
|
||||
ScrollCaptureController controller = new ScrollCaptureController(mContext, connection,
|
||||
mMainExecutor, mBgExecutor, mImageExporter);
|
||||
mMainExecutor, mBgExecutor, mImageExporter, mUiEventLogger);
|
||||
controller.attach(mWindow);
|
||||
controller.start(new TakeScreenshotService.RequestCallback() {
|
||||
@Override
|
||||
|
||||
@@ -63,7 +63,15 @@ public enum ScreenshotEvent implements UiEventLogger.UiEventEnum {
|
||||
@UiEvent(doc = "screenshot swiped to dismiss")
|
||||
SCREENSHOT_SWIPE_DISMISSED(656),
|
||||
@UiEvent(doc = "screenshot reentered for new screenshot")
|
||||
SCREENSHOT_REENTERED(640);
|
||||
SCREENSHOT_REENTERED(640),
|
||||
@UiEvent(doc = "Long screenshot button was shown to the user")
|
||||
SCREENSHOT_LONG_SCREENSHOT_IMPRESSION(687),
|
||||
@UiEvent(doc = "User has requested a long screenshot")
|
||||
SCREENSHOT_LONG_SCREENSHOT_REQUESTED(688),
|
||||
@UiEvent(doc = "User has shared a long screenshot")
|
||||
SCREENSHOT_LONG_SCREENSHOT_SHARE(689),
|
||||
@UiEvent(doc = "User has sent a long screenshot to the editor")
|
||||
SCREENSHOT_LONG_SCREENSHOT_EDIT(690);
|
||||
|
||||
private final int mId;
|
||||
|
||||
|
||||
@@ -192,14 +192,14 @@ public class ScreenshotView extends FrameLayout implements
|
||||
if (DEBUG_SCROLL) {
|
||||
Log.d(TAG, "Showing Scroll option");
|
||||
}
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_IMPRESSION);
|
||||
mScrollChip.setVisibility(VISIBLE);
|
||||
mScrollChip.setOnClickListener((v) -> {
|
||||
if (DEBUG_INPUT) {
|
||||
Log.d(TAG, "scroll chip tapped");
|
||||
}
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_REQUESTED);
|
||||
onClick.run();
|
||||
// TODO Logging, store event consumer to a field
|
||||
//onElementTapped.accept(ScreenshotEvent.SCREENSHOT_SCROLL_TAPPED);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.view.ViewTreeObserver.OnComputeInternalInsetsListener;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.screenshot.ScrollCaptureClient.Connection;
|
||||
import com.android.systemui.screenshot.ScrollCaptureClient.Session;
|
||||
@@ -58,6 +59,7 @@ public class ScrollCaptureController implements OnComputeInternalInsetsListener
|
||||
private final Executor mBgExecutor;
|
||||
private final ImageExporter mImageExporter;
|
||||
private final ImageTileSet mImageTileSet;
|
||||
private final UiEventLogger mUiEventLogger;
|
||||
|
||||
private ZonedDateTime mCaptureTime;
|
||||
private UUID mRequestId;
|
||||
@@ -72,12 +74,13 @@ public class ScrollCaptureController implements OnComputeInternalInsetsListener
|
||||
private Runnable mPendingAction;
|
||||
|
||||
public ScrollCaptureController(Context context, Connection connection, Executor uiExecutor,
|
||||
Executor bgExecutor, ImageExporter exporter) {
|
||||
Executor bgExecutor, ImageExporter exporter, UiEventLogger uiEventLogger) {
|
||||
mContext = context;
|
||||
mConnection = connection;
|
||||
mUiExecutor = uiExecutor;
|
||||
mBgExecutor = bgExecutor;
|
||||
mImageExporter = exporter;
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mImageTileSet = new ImageTileSet();
|
||||
}
|
||||
|
||||
@@ -136,10 +139,12 @@ public class ScrollCaptureController implements OnComputeInternalInsetsListener
|
||||
disableButtons();
|
||||
finish();
|
||||
} else if (id == R.id.edit) {
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EDIT);
|
||||
v.setPressed(true);
|
||||
disableButtons();
|
||||
edit();
|
||||
} else if (id == R.id.share) {
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_SHARE);
|
||||
v.setPressed(true);
|
||||
disableButtons();
|
||||
share();
|
||||
|
||||
Reference in New Issue
Block a user