From 87231cfbbb70fd52c04a9cdb5c0f13e869ebc392 Mon Sep 17 00:00:00 2001 From: Debajit Ghosh <> Date: Tue, 24 Mar 2009 18:35:54 -0700 Subject: [PATCH] Automated import from //branches/master/...@140820,140820 --- .../gdata/client/AndroidGDataClient.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/core/java/com/google/android/gdata/client/AndroidGDataClient.java b/core/java/com/google/android/gdata/client/AndroidGDataClient.java index fe7d8601c2e02..998f940e63a1d 100644 --- a/core/java/com/google/android/gdata/client/AndroidGDataClient.java +++ b/core/java/com/google/android/gdata/client/AndroidGDataClient.java @@ -51,7 +51,7 @@ public class AndroidGDataClient implements GDataClient { private static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; - private static final String USER_AGENT_APP_VERSION = "Android-GData/1.0"; + private static final String DEFAULT_USER_AGENT_APP_VERSION = "Android-GData/1.1"; private static final int MAX_REDIRECTS = 10; @@ -121,7 +121,7 @@ public class AndroidGDataClient implements GDataClient { * @deprecated Use AndroidGDAtaClient(Context) instead. */ public AndroidGDataClient(ContentResolver resolver) { - mHttpClient = new GoogleHttpClient(resolver, USER_AGENT_APP_VERSION, + mHttpClient = new GoogleHttpClient(resolver, DEFAULT_USER_AGENT_APP_VERSION, true /* gzip capable */); mHttpClient.enableCurlLogging(TAG, Log.VERBOSE); mResolver = resolver; @@ -136,7 +136,21 @@ public class AndroidGDataClient implements GDataClient { * SSL session persistence. */ public AndroidGDataClient(Context context) { - mHttpClient = new GoogleHttpClient(context, USER_AGENT_APP_VERSION, + this(context, DEFAULT_USER_AGENT_APP_VERSION); + } + + /** + * Creates a new AndroidGDataClient. + * + * @param context The ContentResolver to get URL rewriting rules from + * through the Android proxy server, using null to indicate not using proxy. + * The context will also be used by GoogleHttpClient for configuration of + * SSL session persistence. + * @param appAndVersion The application name and version to be used as the basis of the + * User-Agent. e.g., Android-GData/1.5.0. + */ + public AndroidGDataClient(Context context, String appAndVersion) { + mHttpClient = new GoogleHttpClient(context, appAndVersion, true /* gzip capable */); mHttpClient.enableCurlLogging(TAG, Log.VERBOSE); mResolver = context.getContentResolver();