diff options
| author | 2018-04-24 15:41:17 -0700 | |
|---|---|---|
| committer | 2018-05-17 11:48:53 -0700 | |
| commit | c50d40aa9f467ec2e57da9af258613471de154ee (patch) | |
| tree | 14a5303f06b65e12dafacbbe60656216dd11c7e6 | |
| parent | d27a9f4465c7159b046a3087b7c4d1fad3c2a7c5 (diff) | |
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 2636dd435a7054b3101b041ef1570573c04afe96)
| -rw-r--r-- | telephony/java/android/telephony/PhysicalChannelConfig.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/PhysicalChannelConfig.java b/telephony/java/android/telephony/PhysicalChannelConfig.java index ce444dd00ce4..d2001ae6ea0e 100644 --- a/telephony/java/android/telephony/PhysicalChannelConfig.java +++ b/telephony/java/android/telephony/PhysicalChannelConfig.java @@ -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(); + } } |