OSDN Git Service

Fix the problem of CaptivePortalLogin app cannot show SSL error page
authorlucaslin <lucaslin@google.com>
Tue, 19 Mar 2019 11:15:54 +0000 (19:15 +0800)
committerlucaslin <lucaslin@google.com>
Tue, 19 Mar 2019 11:15:54 +0000 (19:15 +0800)
commit8efd38b61dac31564c8a53e1699e32c35c594ae6
treec6ff68d9db83659e9daadce80e993fb015f61356
parent13f15b3752982474ef61f6baa31bfdb4177accb0
Fix the problem of CaptivePortalLogin app cannot show SSL error page

This commit is trying to fix the limitation of older design:
1.There is no guarantee that onReceivedSslError() will be called
after onPageStarted(). So, onReceivedSslError() may compare the
host of SSL error url with mHostName which is unset.
2.Some WIFI APs may redirect to the probing url(mUrl) along with
special parameter first then redirect to the real log-in page,
it will make onPageStarted get unexpected hostname.
Above 2 situations will make captive portal app cannot show SSL
error page and result in captive portal app is blank.

The new design is trying to get the main frame url and compare
it with SSL error url. If the SSL error url is equal to main
frame url, then show the SSL error page.

Bug: 123208856
Bug: 122991421
Test: build pass
Change-Id: I27be7258436ccb833ff75ebcfed3af811467fa47
packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java