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

Commit 54762e1e authored by Bobby Georgescu's avatar Bobby Georgescu Committed by Android (Google) Code Review
Browse files

Merge "Usage statistics for photo and video capture" into gb-ub-photos-bryce

parents 20eb41f8 1d99f5c5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1013,6 +1013,8 @@ public class PhotoModule

        mFaceDetectionStarted = false;
        setCameraState(SNAPSHOT_IN_PROGRESS);
        UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
                UsageStatistics.ACTION_CAPTURE_DONE, "Photo");
        return true;
    }

+8 −0
Original line number Diff line number Diff line
@@ -450,6 +450,8 @@ public class VideoModule implements CameraModule,
        mActivity.mCameraDevice.takePicture(null, null, null, new JpegPictureCallback(loc));
        showVideoSnapshotUI(true);
        mSnapshotInProgress = true;
        UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
                UsageStatistics.ACTION_CAPTURE_DONE, "VideoSnapshot");
    }

    @Override
@@ -1547,6 +1549,8 @@ public class VideoModule implements CameraModule,

        updateRecordingTime();
        keepScreenOn();
        UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
                UsageStatistics.ACTION_CAPTURE_START, "Video");
    }

    private void showCaptureResult() {
@@ -1662,6 +1666,10 @@ public class VideoModule implements CameraModule,
        // Update the parameters here because the parameters might have been altered
        // by MediaRecorder.
        if (!mPaused) mParameters = mActivity.mCameraDevice.getParameters();
        UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
                fail ? UsageStatistics.ACTION_CAPTURE_FAIL :
                    UsageStatistics.ACTION_CAPTURE_DONE, "Video",
                    SystemClock.uptimeMillis() - mRecordingStartTime);
        return fail;
    }

+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@ public class UsageStatistics {
    public static final String TRANSITION_BUTTON_TAP = "ButtonTap";
    public static final String TRANSITION_SWIPE = "Swipe";

    public static final String ACTION_CAPTURE_START = "CaptureStart";
    public static final String ACTION_CAPTURE_FAIL = "CaptureFail";
    public static final String ACTION_CAPTURE_DONE = "CaptureDone";

    public static void initialize(Context context) {}
    public static void showOptInDialogIfNeeded(Activity activity) {}
    public static void setPendingTransitionCause(String cause) {}