diff options
author | Kristian Monsen <kristianm@google.com> | 2011-07-13 20:22:37 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-07-28 18:29:54 +0100 |
commit | 9eb0e892becc28d1f1ccbbdf2f36a6d5e9ee4145 (patch) | |
tree | 3edc8a73f5c1973e8bca0f499cf2564861ff19d8 /src | |
parent | 56e7068864733e18c666f689c5667d49dcc7b241 (diff) | |
download | packages_apps_Browser-9eb0e892becc28d1f1ccbbdf2f36a6d5e9ee4145.zip packages_apps_Browser-9eb0e892becc28d1f1ccbbdf2f36a6d5e9ee4145.tar.gz packages_apps_Browser-9eb0e892becc28d1f1ccbbdf2f36a6d5e9ee4145.tar.bz2 |
Part of fix for bug 4997380: Some error types unknown to SslError
Added the new error codes to be displayed with error messages.
Change-Id: I06b9bd6b2d6ffb95097228a1843dcda77b85a3e7
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/PageDialogsHandler.java | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/src/com/android/browser/PageDialogsHandler.java b/src/com/android/browser/PageDialogsHandler.java index 015a9bb..3f64758 100644 --- a/src/com/android/browser/PageDialogsHandler.java +++ b/src/com/android/browser/PageDialogsHandler.java @@ -306,32 +306,23 @@ public class PageDialogsHandler { final LinearLayout placeholder = (LinearLayout)certificateView.findViewById(com.android.internal.R.id.placeholder); - if (error.hasError(SslError.SSL_UNTRUSTED)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_untrusted); - } - - if (error.hasError(SslError.SSL_IDMISMATCH)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_mismatch); - } + LinearLayout ll = (LinearLayout)factory.inflate(R.layout.ssl_warning, placeholder); + TextView textView = (TextView)ll.findViewById(R.id.warning); - if (error.hasError(SslError.SSL_EXPIRED)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_expired); - } - - if (error.hasError(SslError.SSL_NOTYETVALID)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_not_yet_valid); + if (error.hasError(SslError.SSL_UNTRUSTED)) { + textView.setText(R.string.ssl_untrusted); + } else if (error.hasError(SslError.SSL_IDMISMATCH)) { + textView.setText(R.string.ssl_mismatch); + } else if (error.hasError(SslError.SSL_EXPIRED)) { + textView.setText(R.string.ssl_expired); + } else if (error.hasError(SslError.SSL_NOTYETVALID)) { + textView.setText(R.string.ssl_not_yet_valid); + } else if (error.hasError(SslError.SSL_DATE_INVALID)) { + textView.setText(R.string.ssl_date_invalid); + } else if (error.hasError(SslError.SSL_INVALID)) { + textView.setText(R.string.ssl_invalid); + } else { + textView.setText(R.string.ssl_unknown); } mSSLCertificateOnErrorHandler = handler; |