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

Commit c50d40aa 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
Merged-In: Ieb12f78a821369072ca9f03d28b28759836f84b4
Change-Id: Ieb12f78a821369072ca9f03d28b28759836f84b4
(cherry picked from commit 2636dd43)
parent d27a9f44
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();
    }
}