diff options
author | Paul Jensen <pauljensen@google.com> | 2014-12-17 18:50:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-17 18:50:30 +0000 |
commit | b9d5551be23a9f0129b64fd9c73ba2bf1dcc852b (patch) | |
tree | 776dbc0dca9320247cbe25c30ccf21d384637e59 /packages/CaptivePortalLogin | |
parent | 55950d5c762b5cc242c7d070f9b0e36279a055dc (diff) | |
parent | c266f62fd9f241b0d122bae7ad016ecd58ab40da (diff) | |
download | frameworks_base-b9d5551be23a9f0129b64fd9c73ba2bf1dcc852b.zip frameworks_base-b9d5551be23a9f0129b64fd9c73ba2bf1dcc852b.tar.gz frameworks_base-b9d5551be23a9f0129b64fd9c73ba2bf1dcc852b.tar.bz2 |
am c266f62f: am eece3339: Merge "Show broken lock image when SSL errors are encountered in CaptivePortalLogin." into lmp-mr1-dev automerge: ee8feae
* commit 'c266f62fd9f241b0d122bae7ad016ecd58ab40da':
Show broken lock image when SSL errors are encountered in CaptivePortalLogin.
Diffstat (limited to 'packages/CaptivePortalLogin')
-rw-r--r-- | packages/CaptivePortalLogin/assets/locked_page.png | bin | 0 -> 7864 bytes | |||
-rw-r--r-- | packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/CaptivePortalLogin/assets/locked_page.png b/packages/CaptivePortalLogin/assets/locked_page.png Binary files differnew file mode 100644 index 0000000..91e1291 --- /dev/null +++ b/packages/CaptivePortalLogin/assets/locked_page.png diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java index 7253579..06e8574 100644 --- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java +++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java @@ -28,6 +28,7 @@ import android.net.NetworkCapabilities; import android.net.NetworkRequest; import android.net.Proxy; import android.net.Uri; +import android.net.http.SslError; import android.os.Bundle; import android.provider.Settings; import android.provider.Settings.Global; @@ -37,6 +38,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; +import android.webkit.SslErrorHandler; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; @@ -251,6 +253,19 @@ public class CaptivePortalLoginActivity extends Activity { } testForCaptivePortal(); } + + // A web page consisting of a large broken lock icon to indicate SSL failure. + final static String SSL_ERROR_HTML = "<!DOCTYPE html><html><head><style>" + + "html { width:100%; height:100%; " + + " background:url(locked_page.png) center center no-repeat; }" + + "</style></head><body></body></html>"; + + @Override + public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { + Log.w(TAG, "SSL error; displaying broken lock icon."); + view.loadDataWithBaseURL("file:///android_asset/", SSL_ERROR_HTML, "text/HTML", + "UTF-8", null); + } } private class MyWebChromeClient extends WebChromeClient { |