Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
bug: change default UA agent string for MMS.
Browse files Browse the repository at this point in the history
- add conditional logging for UAProf url.
- if the MMS port isn't set, don't use Log.e() to log it.

Change-Id: I9557763d209226eafb5cb3b0b7e4092287f5ef29
  • Loading branch information
Wei Huang committed Dec 1, 2009
1 parent 16c7e30 commit 1b37c93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/com/android/mms/MmsConfig.java
Expand Up @@ -34,7 +34,7 @@ public class MmsConfig {
private static final boolean LOCAL_LOGV = DEBUG ? Config.LOGD : Config.LOGV;

private static final String DEFAULT_HTTP_KEY_X_WAP_PROFILE = "x-wap-profile";
private static final String DEFAULT_USER_AGENT = "Android-Mms/0.1";
private static final String DEFAULT_USER_AGENT = "Android-Mms/2.0";

private static final int MAX_IMAGE_HEIGHT = 480;
private static final int MAX_IMAGE_WIDTH = 640;
Expand Down
4 changes: 4 additions & 0 deletions src/com/android/mms/transaction/HttpUtils.java
Expand Up @@ -157,6 +157,10 @@ protected static byte[] httpConnection(Context context, long token,
String xWapProfileUrl = MmsConfig.getUaProfUrl();

if (xWapProfileUrl != null) {
if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.d(LogTag.TRANSACTION,
"[HttpUtils] httpConn: xWapProfUrl=" + xWapProfileUrl);
}
req.addHeader(xWapProfileTagName, xWapProfileUrl);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/com/android/mms/transaction/TransactionSettings.java
Expand Up @@ -85,7 +85,11 @@ public TransactionSettings(Context context, String apnName) {
try {
mProxyPort = Integer.parseInt(portString);
} catch (NumberFormatException e) {
Log.e(TAG, "Bad port number format: " + portString, e);
if (TextUtils.isEmpty(portString)) {
Log.w(TAG, "mms port not set!");
} else {
Log.e(TAG, "Bad port number format: " + portString, e);
}
}
}
}
Expand Down

0 comments on commit 1b37c93

Please sign in to comment.