Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: components/cronet/android/api/src/org/chromium/net/UserAgent.java

Issue 1665503002: [Cronet] Expose quic_user_agent_id and quic_prefer_aes config options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document QUIC UAID string usage, don't pass it down unless QUIC is enabled. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/api/src/org/chromium/net/UserAgent.java
diff --git a/components/cronet/android/api/src/org/chromium/net/UserAgent.java b/components/cronet/android/api/src/org/chromium/net/UserAgent.java
index a0ce85f0386c2dc2f3c547ddfb284490abb7d85a..58374738020f945dd03ebcabc66ba92f174dc7be 100644
--- a/components/cronet/android/api/src/org/chromium/net/UserAgent.java
+++ b/components/cronet/android/api/src/org/chromium/net/UserAgent.java
@@ -29,8 +29,8 @@ public final class UserAgent {
}
/**
- * Constructs a User-Agent string including Cronet version, and application
- * name and version.
+ * Constructs a User-Agent string including application name and version,
+ * system build version, model and Id, and Cronet version.
* @param context the context to fetch the application name and version
* from.
* @return User-Agent string.
@@ -69,6 +69,23 @@ public final class UserAgent {
return builder.toString();
}
+ /**
+ * Constructs default QUIC User Agent Id string including application name
+ * and Cronet version.
+ * @param context the context to fetch the application name from.
+ * @return User-Agent string.
+ */
+ static String getQuicUserAgentIdFrom(Context context) {
+ StringBuilder builder = new StringBuilder();
+
+ // Application name and cronet version.
+ builder.append(context.getPackageName());
+ builder.append(" Cronet/");
+ builder.append(Version.CRONET_VERSION);
+
+ return builder.toString();
+ }
+
private static int versionFromContext(Context context) {
synchronized (sLock) {
if (sVersionCode == VERSION_CODE_UNINITIALIZED) {

Powered by Google App Engine
This is Rietveld 408576698