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

Commit a51c99f1 authored by Hall Liu's avatar Hall Liu
Browse files

Add pending messages to dumpsys

Add a record of the pending messages for the two audio state machines in
the dumpsys in order to debug errors where the state machines get
blocked on a file access.

Bug: 36056251
Test: manual - run dumpsys
Change-Id: I583014783dedb36d9fdd8a0338395f3c0ae6e542
parent 943ab481
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -477,6 +477,16 @@ public class CallAudioManager extends CallsManagerListenerBase {

        pw.println("Foreground call:");
        pw.println(mForegroundCall);

        pw.println("CallAudioModeStateMachine pending messages:");
        pw.increaseIndent();
        mCallAudioModeStateMachine.dumpPendingMessages(pw);
        pw.decreaseIndent();

        pw.println("CallAudioRouteStateMachine pending messages:");
        pw.increaseIndent();
        mCallAudioRouteStateMachine.dumpPendingMessages(pw);
        pw.decreaseIndent();
    }

    @VisibleForTesting
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.telecom.Logging.Session;
import android.util.SparseArray;

import com.android.internal.util.IState;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;

@@ -515,6 +516,10 @@ public class CallAudioModeStateMachine extends StateMachine {
        }
    }

    public void dumpPendingMessages(IndentingPrintWriter pw) {
        getHandler().getLooper().dump(pw::println, "");
    }

    @Override
    protected void onPostHandleMessage(Message msg) {
        Log.endSession();
+5 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.telecom.Logging.Session;
import android.util.SparseArray;

import com.android.internal.util.IState;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.server.telecom.bluetooth.BluetoothRouteManager;
@@ -1318,6 +1319,10 @@ public class CallAudioRouteStateMachine extends StateMachine {
        quitNow();
    }

    public void dumpPendingMessages(IndentingPrintWriter pw) {
        getHandler().getLooper().dump(pw::println, "");
    }

    /**
     * Sets whether notifications should be suppressed or not.  Used when in a call to ensure the
     * device will not vibrate due to notifications.