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

Commit a7a6ca52 authored by Stefan Andonian's avatar Stefan Andonian
Browse files

Move saving View Capture responsibility to Traceur.

Bug: 305049544
Test: Verified locally that this works. See b/335874800 as a sample bug
where traces were recorded.
Flag: ACONFIG record_issue_qs_tile STAGING

Change-Id: Iee38546c95aeb0df5cc58939310799ef34da1226
parent 8e08da9f
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.app.IActivityManager
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.pm.LauncherApps
import android.content.res.Resources
import android.net.Uri
import android.os.Handler
@@ -63,7 +62,6 @@ constructor(
    private val panelInteractor: PanelInteractor,
    private val issueRecordingState: IssueRecordingState,
    private val iActivityManager: IActivityManager,
    private val launcherApps: LauncherApps,
) :
    RecordingService(
        controller,
@@ -85,7 +83,7 @@ constructor(
        when (intent?.action) {
            ACTION_START -> {
                TraceUtils.traceStart(
                    contentResolver,
                    this,
                    DEFAULT_TRACE_TAGS,
                    DEFAULT_BUFFER_SIZE,
                    DEFAULT_IS_INCLUDING_WINSCOPE,
@@ -104,11 +102,7 @@ constructor(
            }
            ACTION_STOP,
            ACTION_STOP_NOTIF -> {
                // ViewCapture needs to save it's data before it is disabled, or else the data will
                // be lost. This is expected to change in the near future, and when that happens
                // this line should be removed.
                launcherApps.saveViewCaptureData()
                TraceUtils.traceStop(contentResolver)
                TraceUtils.traceStop(this)
                issueRecordingState.isRecording = false
            }
            ACTION_SHARE -> {
@@ -142,7 +136,7 @@ constructor(

    private fun shareRecording(screenRecording: Uri?) {
        val traces =
            TraceUtils.traceDump(contentResolver, TRACE_FILE_NAME).getOrElse {
            TraceUtils.traceDump(this, TRACE_FILE_NAME).getOrElse {
                Log.v(
                    TAG,
                    "Traces were not present. This can happen if users double" +