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

Commit 9f1195be authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Android (Google) Code Review
Browse files

Merge "Add instant events related to bugreport timing from GlobalActions" into main

parents 09aa6610 aed14858
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) {
            }