diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/android/java/src/org/chromium/net/ProxyChangeListener.java | 14 | ||||
-rw-r--r-- | net/android/java/src/org/chromium/net/X509Util.java | 11 |
2 files changed, 11 insertions, 14 deletions
diff --git a/net/android/java/src/org/chromium/net/ProxyChangeListener.java b/net/android/java/src/org/chromium/net/ProxyChangeListener.java index b130da0..51b6714 100644 --- a/net/android/java/src/org/chromium/net/ProxyChangeListener.java +++ b/net/android/java/src/org/chromium/net/ProxyChangeListener.java @@ -101,9 +101,9 @@ public class ProxyChangeListener { // TODO(sgurun): once android.net.ProxyInfo is public, rewrite this. private ProxyConfig extractNewProxy(Intent intent) { try { - final String GET_HOST_NAME = "getHost"; - final String GET_PORT_NAME = "getPort"; - final String GET_PAC_FILE_URL = "getPacFileUrl"; + final String getHostName = "getHost"; + final String getPortName = "getPort"; + final String getPacFileUrl = "getPacFileUrl"; String className; String proxyInfo; if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { @@ -120,8 +120,8 @@ public class ProxyChangeListener { } Class<?> cls = Class.forName(className); - Method getHostMethod = cls.getDeclaredMethod(GET_HOST_NAME); - Method getPortMethod = cls.getDeclaredMethod(GET_PORT_NAME); + Method getHostMethod = cls.getDeclaredMethod(getHostName); + Method getPortMethod = cls.getDeclaredMethod(getPortName); String host = (String) getHostMethod.invoke(props); int port = (Integer) getPortMethod.invoke(props); @@ -129,14 +129,14 @@ public class ProxyChangeListener { // TODO(xunjieli): rewrite this once the API is public. if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { Method getPacFileUrlMethod = - cls.getDeclaredMethod(GET_PAC_FILE_URL); + cls.getDeclaredMethod(getPacFileUrl); String pacFileUrl = (String) getPacFileUrlMethod.invoke(props); if (!TextUtils.isEmpty(pacFileUrl)) { return new ProxyConfig(host, port, pacFileUrl); } } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { Method getPacFileUrlMethod = - cls.getDeclaredMethod(GET_PAC_FILE_URL); + cls.getDeclaredMethod(getPacFileUrl); Uri pacFileUrl = (Uri) getPacFileUrlMethod.invoke(props); if (!Uri.EMPTY.equals(pacFileUrl)) { return new ProxyConfig(host, port, pacFileUrl.toString()); diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java index 934ec40..00a24e4 100644 --- a/net/android/java/src/org/chromium/net/X509Util.java +++ b/net/android/java/src/org/chromium/net/X509Util.java @@ -55,14 +55,11 @@ public class X509Util { if (intent.getAction().equals(KeyChain.ACTION_STORAGE_CHANGED)) { try { reloadDefaultTrustManager(); - } - catch (CertificateException e) { + } catch (CertificateException e) { Log.e(TAG, "Unable to reload the default TrustManager", e); - } - catch (KeyStoreException e) { + } catch (KeyStoreException e) { Log.e(TAG, "Unable to reload the default TrustManager", e); - } - catch (NoSuchAlgorithmException e) { + } catch (NoSuchAlgorithmException e) { Log.e(TAG, "Unable to reload the default TrustManager", e); } } @@ -377,7 +374,7 @@ public class X509Util { } // If the subject and public key match, this is a system root. - X509Certificate anchorX509 = (X509Certificate)anchor; + X509Certificate anchorX509 = (X509Certificate) anchor; if (root.getSubjectX500Principal().equals(anchorX509.getSubjectX500Principal()) && root.getPublicKey().equals(anchorX509.getPublicKey())) { sSystemTrustAnchorCache.add(key); |