summaryrefslogtreecommitdiffstats
path: root/core/java/com/google
diff options
context:
space:
mode:
authorDebajit Ghosh <>2009-03-24 18:36:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 18:36:00 -0700
commite259023ffc2541536c6b08d8da6f14ac24a1ab8b (patch)
tree638b3eb22ef42f2f2992de7c50cc8d9eebceca0c /core/java/com/google
parentd01721d5ca5bfa943760ed61cc99ca1ffc044c50 (diff)
downloadframeworks_base-e259023ffc2541536c6b08d8da6f14ac24a1ab8b.zip
frameworks_base-e259023ffc2541536c6b08d8da6f14ac24a1ab8b.tar.gz
frameworks_base-e259023ffc2541536c6b08d8da6f14ac24a1ab8b.tar.bz2
Automated import from //branches/donutburger/...@140817,140817
Diffstat (limited to 'core/java/com/google')
-rw-r--r--core/java/com/google/android/gdata/client/AndroidGDataClient.java20
1 files 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 fe7d860..998f940 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();