Fallback if redirect url is not valid for captive portal login

Wifi AP may send a relative URL or other invalid URL if any
network issue or configuration issue happen. In this kind of
case, sending a redirect url to captive portal app will fail
to open the login page. Thus, fallback to send detection url
if the redirect url is a malformed URL.

Bug: 157433005
Test: atest NetworkStackTest
Merged-In: I6126f5aeb4709a09ec249947b5e59f1310ec7a4b
Change-Id: I6126f5aeb4709a09ec249947b5e59f1310ec7a4b
2 files changed