OsuLogin: Do not load the page for local IP address

Currently the OsuLogin Weview shows "web page not available" page when
user clicks getPasspoint Button on the page.
This is because we are trying to load the page for http://127.0.0.1 on
last moment before we exit the OsuLogin webview as part of HTTP redirect
to local server.

So, it needs to stop loading the page for the local server.

Bug: 121281421
Test: Tested with R2 AP
Change-Id: I37e3aa5985d49d0a58e367ff221d53df371551e0
Signed-off-by: Ecco Park <eccopark@google.com>
This commit is contained in:
Ecco Park
2018-12-19 16:08:11 -08:00
parent c60fbd4fcd
commit 9bed4c14af

View File

@@ -39,12 +39,14 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.android.hotspot2.R;
import java.net.MalformedURLException;
import java.net.URL;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
/**
* Online Sign Up Login Web View launched during Provision Process of Hotspot 2.0 rel2.
@@ -252,6 +254,10 @@ public class OsuLoginActivity extends Activity {
@Override
public void onReceivedError(WebView view, WebResourceRequest request,
WebResourceError error) {
if (request.getUrl().toString().startsWith("http://127.0.0.1")) {
view.stopLoading();
}
if (request.isForMainFrame()) {
// This happens right after getting HTTP redirect response from an OSU server
// since no more Http request is allowed to send to the OSU server.