| 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) {
|
|
|