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

Commit 2636dd43 authored by Nathan Harold's avatar Nathan Harold
Browse files

Add toString() method to PhysicalChannelConfig

We need to be able to print the PhysicalChannelConfig
for debugging/dumping, so adding a toString() method
to print in a format that we can easily digest and
is consistent with other Telephony log formatting.

Bug: 78791811
Test: manual / TelephonyDebugMenu
Change-Id: Ieb12f78a821369072ca9f03d28b28759836f84b4
parent c9bad6ef
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -99,6 +99,20 @@ public final class PhysicalChannelConfig implements Parcelable {
        return mCellConnectionStatus;
    }

    /** @return String representation of the connection status */
    private String getConnectionStatusString() {
        switch(mCellConnectionStatus) {
            case CONNECTION_PRIMARY_SERVING:
                return "PrimaryServing";
            case CONNECTION_SECONDARY_SERVING:
                return "SecondaryServing";
            case CONNECTION_UNKNOWN:
                return "Unknown";
            default:
                return "Invalid(" + mCellConnectionStatus + ")";
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
@@ -129,4 +143,15 @@ public final class PhysicalChannelConfig implements Parcelable {
                return new PhysicalChannelConfig[size];
            }
        };

    @Override
    public String toString() {
        return new StringBuilder()
            .append("{mConnectionStatus=")
            .append(getConnectionStatusString())
            .append(",mCellBandwidthDownlinkKhz=")
            .append(mCellBandwidthDownlinkKhz)
            .append("}")
            .toString();
    }
}