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

Commit 535c8dad authored by Pablo Gamito's avatar Pablo Gamito Committed by Automerger Merge Worker
Browse files

Merge "Don't let transition tracing exceptions bubble up" into udc-dev am: 4ea6f914

parents 07164524 4ea6f914
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1533,7 +1533,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {

        mController.mLoggerHandler.post(mLogger::logOnSend);
        if (mLogger.mInfo != null) {
            mController.mTransitionTracer.logSentTransition(this, mTargets, info);
            mController.mTransitionTracer.logSentTransition(this, mTargets);
        }
    }

+50 −38
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.os.SystemClock;
import android.os.Trace;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
import android.window.TransitionInfo;

import com.android.internal.util.TraceBuffer;
import com.android.server.wm.Transition.ChangeInfo;
@@ -69,10 +68,9 @@ public class TransitionTracer {
     *
     * @param transition The transition that has been sent to Shell.
     * @param targets Information about the target windows of the transition.
     * @param info The TransitionInfo send over to Shell to execute the transition.
     */
    public void logSentTransition(Transition transition, ArrayList<ChangeInfo> targets,
            TransitionInfo info) {
    public void logSentTransition(Transition transition, ArrayList<ChangeInfo> targets) {
        try {
            final ProtoOutputStream outputStream = new ProtoOutputStream();
            final long protoToken = outputStream
                    .start(com.android.server.wm.shell.TransitionTraceProto.TRANSITIONS);
@@ -89,6 +87,10 @@ public class TransitionTracer {
            outputStream.end(protoToken);

            mTraceBuffer.add(outputStream);
        } catch (Exception e) {
            // Don't let any errors in the tracing cause the transition to fail
            Log.e(LOG_TAG, "Unexpected exception thrown while logging transitions", e);
        }
    }

    /**
@@ -98,6 +100,7 @@ public class TransitionTracer {
     * @param transition The transition that has finished.
     */
    public void logFinishedTransition(Transition transition) {
        try {
            final ProtoOutputStream outputStream = new ProtoOutputStream();
            final long protoToken = outputStream
                    .start(com.android.server.wm.shell.TransitionTraceProto.TRANSITIONS);
@@ -107,6 +110,10 @@ public class TransitionTracer {
            outputStream.end(protoToken);

            mTraceBuffer.add(outputStream);
        } catch (Exception e) {
            // Don't let any errors in the tracing cause the transition to fail
            Log.e(LOG_TAG, "Unexpected exception thrown while logging transitions", e);
        }
    }

    /**
@@ -116,6 +123,7 @@ public class TransitionTracer {
     * @param transition The transition that has been aborted
     */
    public void logAbortedTransition(Transition transition) {
        try {
            final ProtoOutputStream outputStream = new ProtoOutputStream();
            final long protoToken = outputStream
                    .start(com.android.server.wm.shell.TransitionTraceProto.TRANSITIONS);
@@ -125,6 +133,10 @@ public class TransitionTracer {
            outputStream.end(protoToken);

            mTraceBuffer.add(outputStream);
        } catch (Exception e) {
            // Don't let any errors in the tracing cause the transition to fail
            Log.e(LOG_TAG, "Unexpected exception thrown while logging transitions", e);
        }
    }

    private void dumpTransitionTargetsToProto(ProtoOutputStream outputStream,