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

Commit 1d99f5c5 authored by Bobby Georgescu's avatar Bobby Georgescu
Browse files

Usage statistics for photo and video capture

Bug: 8433834
Change-Id: Idb4343a9e8d6895adbf9707e8c7811d007acc984
parent bb746823
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) {}