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

Commit aed14858 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Add instant events related to bugreport timing from GlobalActions

Flag: None
Bug: 313851266
Test: perfetto trace
Change-Id: I1ce735a3ef9d2c84a72b06292f6979ea06a2ef58
parent 6ed42ea1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Trace
import android.os.UserHandle
import android.util.Log
import com.android.systemui.broadcast.BroadcastDispatcher
@@ -53,6 +54,8 @@ class LogBufferFreezer constructor(
    }

    private fun onBugreportStarted() {
        Trace.instantForTrack(Trace.TRACE_TAG_APP, "bugreport",
                "BUGREPORT_STARTED broadcast received")
        pendingToken?.run()

        Log.i(TAG, "Freezing log buffers")
+6 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -1052,6 +1053,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
            if (ActivityManager.isUserAMonkey()) {
                return;
            }
            Trace.instantForTrack(Trace.TRACE_TAG_APP, "bugreport", "BugReportAction#onPress");
            // Add a little delay before executing, to give the
            // dialog a chance to go away before it takes a
            // screenshot.
@@ -1065,6 +1067,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                        mUiEventLogger.log(GlobalActionsEvent.GA_BUGREPORT_PRESS);
                        if (!mIActivityManager.launchBugReportHandlerApp()) {
                            Log.w(TAG, "Bugreport handler could not be launched");
                            Trace.instantForTrack(Trace.TRACE_TAG_APP, "bugreport",
                                    "BugReportAction#requestingInteractiveBugReport");
                            mIActivityManager.requestInteractiveBugReport();
                        }
                    } catch (RemoteException e) {
@@ -1084,6 +1088,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                // Take a "full" bugreport.
                mMetricsLogger.action(MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_FULL);
                mUiEventLogger.log(GlobalActionsEvent.GA_BUGREPORT_LONG_PRESS);
                Trace.instantForTrack(Trace.TRACE_TAG_APP, "bugreport",
                        "BugReportAction#requestingFullBugReport");
                mIActivityManager.requestFullBugReport();
            } catch (RemoteException e) {
            }