Chromium Code Reviews| Index: components/cronet/android/java/src/org/chromium/net/impl/UserAgent.java |
| diff --git a/components/cronet/android/api/src/org/chromium/net/UserAgent.java b/components/cronet/android/java/src/org/chromium/net/impl/UserAgent.java |
| similarity index 89% |
| rename from components/cronet/android/api/src/org/chromium/net/UserAgent.java |
| rename to components/cronet/android/java/src/org/chromium/net/impl/UserAgent.java |
| index 5abd81c93277195082a2aa8401ab1bd7bc6826f8..33bef5dfb1a4485c1272950af686970ae0ad95a9 100644 |
| --- a/components/cronet/android/api/src/org/chromium/net/UserAgent.java |
| +++ b/components/cronet/android/java/src/org/chromium/net/impl/UserAgent.java |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -package org.chromium.net; |
| +package org.chromium.net.impl; |
| import android.content.Context; |
| import android.content.pm.PackageInfo; |
| @@ -15,14 +15,13 @@ import java.util.Locale; |
| /** |
| * Constructs a User-Agent string. |
| */ |
| -final class UserAgent { |
| +public final class UserAgent { |
| private static final Object sLock = new Object(); |
| private static final int VERSION_CODE_UNINITIALIZED = 0; |
| private static int sVersionCode = VERSION_CODE_UNINITIALIZED; |
| - private UserAgent() { |
| - } |
| + private UserAgent() {} |
| /** |
| * Constructs a User-Agent string including application name and version, |
| @@ -87,12 +86,10 @@ final class UserAgent { |
| PackageManager packageManager = context.getPackageManager(); |
| String packageName = context.getPackageName(); |
| try { |
| - PackageInfo packageInfo = packageManager.getPackageInfo( |
| - packageName, 0); |
| + PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0); |
| sVersionCode = packageInfo.versionCode; |
| } catch (NameNotFoundException e) { |
| - throw new IllegalStateException( |
| - "Cannot determine package version"); |
| + throw new IllegalStateException("Cannot determine package version"); |
| } |
| } |
| return sVersionCode; |
| @@ -101,11 +98,10 @@ final class UserAgent { |
| private static void appendCronetVersion(StringBuilder builder) { |
| builder.append(" Cronet/"); |
| - // TODO(pauljensen): This is the API version not the implementation |
| // version. The implementation version may be more appropriate for the |
|
pauljensen
2016/10/03 15:22:38
um you got rid of the first line of the comment...
kapishnikov
2016/10/03 23:49:29
Done.
|
| // UserAgent but is not available until after the CronetEngine is |
| // instantiated. Down the road, if the implementation is loaded via |
| // other means, this should be replaced with the implementation version. |
| - builder.append(ApiVersion.CRONET_VERSION); |
| + builder.append(ImplVersion.CRONET_VERSION); |
| } |
| } |