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

Commit fd5637fc authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MidiManager: Improve output of "dumpsys midi"

- Include each device's port status from MidiDeviceStatus
- MidiDeviceInfo.toString() now outputs all the names and values in the properties Bundle

Change-Id: Ic9329153e4ae4d5619e274d27a420943473377e5
parent dd441795
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -298,6 +298,9 @@ public final class MidiDeviceInfo implements Parcelable {

    @Override
    public String toString() {
        // This is a hack to force the mProperties Bundle to unparcel so we can
        // print all the names and values.
        mProperties.getString(PROPERTY_NAME);
        return ("MidiDeviceInfo[mType=" + mType +
                ",mInputPortCount=" + mInputPortCount +
                ",mOutputPortCount=" + mOutputPortCount +
+1 −2
Original line number Diff line number Diff line
@@ -89,10 +89,9 @@ public final class MidiDeviceStatus implements Parcelable {

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder(mDeviceInfo.toString());
        int inputPortCount = mDeviceInfo.getInputPortCount();
        int outputPortCount = mDeviceInfo.getOutputPortCount();
        builder.append(" mInputPortOpen=[");
        StringBuilder builder = new StringBuilder("mInputPortOpen=[");
        for (int i = 0; i < inputPortCount; i++) {
            builder.append(mInputPortOpen[i]);
            if (i < inputPortCount -1) {
+3 −1
Original line number Diff line number Diff line
@@ -294,8 +294,10 @@ public class MidiService extends IMidiManager.Stub {

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder("Device: ");
            StringBuilder sb = new StringBuilder("Device Info: ");
            sb.append(mDeviceInfo);
            sb.append(" Status: ");
            sb.append(mDeviceStatus);
            sb.append(" UID: ");
            sb.append(mUid);
            return sb.toString();