Moved the toString method in the parent Connection class.
Beefed up the output to get more info in the logs about a connection. Personal data is only logged at debug level.
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.internal.telephony;
|
package com.android.internal.telephony;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@hide}
|
* {@hide}
|
||||||
@@ -27,6 +28,7 @@ public abstract class Connection {
|
|||||||
public static int PRESENTATION_UNKNOWN = 3; // no specified or unknown by network
|
public static int PRESENTATION_UNKNOWN = 3; // no specified or unknown by network
|
||||||
public static int PRESENTATION_PAYPHONE = 4; // show pay phone info
|
public static int PRESENTATION_PAYPHONE = 4; // show pay phone info
|
||||||
|
|
||||||
|
private static String LOG_TAG = "TelephonyConnection";
|
||||||
|
|
||||||
public enum DisconnectCause {
|
public enum DisconnectCause {
|
||||||
NOT_DISCONNECTED, /* has not yet disconnected */
|
NOT_DISCONNECTED, /* has not yet disconnected */
|
||||||
@@ -269,4 +271,25 @@ public abstract class Connection {
|
|||||||
*/
|
*/
|
||||||
public abstract int getNumberPresentation();
|
public abstract int getNumberPresentation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build a human representation of a connection instance, suitable for debugging.
|
||||||
|
* Don't log personal stuff unless in debug mode.
|
||||||
|
* @return a string representing the internal state of this connection.
|
||||||
|
*/
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder str = new StringBuilder(128);
|
||||||
|
|
||||||
|
if (Log.isLoggable(LOG_TAG, Log.DEBUG)) {
|
||||||
|
str.append("addr: " + getAddress())
|
||||||
|
.append(" pres.: " + getNumberPresentation())
|
||||||
|
.append(" dial: " + getOrigDialString())
|
||||||
|
.append(" postdial: " + getRemainingPostDialString())
|
||||||
|
.append(" cnap name: " + getCnapName())
|
||||||
|
.append("(" + getCnapNamePresentation() + ")");
|
||||||
|
}
|
||||||
|
str.append(" incoming: " + isIncoming())
|
||||||
|
.append(" state: " + getState())
|
||||||
|
.append(" post dial state: " + getPostDialState());
|
||||||
|
return str.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,10 +221,6 @@ public class CdmaConnection extends Connection {
|
|||||||
return isIncoming == c.isMT && equalsHandlesNulls(address, cAddress);
|
return isIncoming == c.isMT && equalsHandlesNulls(address, cAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String
|
|
||||||
toString() {
|
|
||||||
return (isIncoming ? "incoming" : "outgoing");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrigDialString(){
|
public String getOrigDialString(){
|
||||||
return dialString;
|
return dialString;
|
||||||
|
|||||||
@@ -180,11 +180,6 @@ public class GsmConnection extends Connection {
|
|||||||
return isIncoming == c.isMT && equalsHandlesNulls(address, cAddress);
|
return isIncoming == c.isMT && equalsHandlesNulls(address, cAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String
|
|
||||||
toString() {
|
|
||||||
return (isIncoming ? "incoming" : "outgoing");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user