summaryrefslogtreecommitdiffstats
path: root/packages/CaptivePortalLogin
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2015-05-22 10:50:39 -0400
committerPaul Jensen <pauljensen@google.com>2015-07-09 10:47:34 -0400
commit49e3edff5156f471819e4ea2a88994bca70bd870 (patch)
tree829dcedfefd5f7b8dc9a48d2f1e76a18d73d6841 /packages/CaptivePortalLogin
parent72a77993bdbc2cec49714b73d222ff213be44041 (diff)
downloadframeworks_base-49e3edff5156f471819e4ea2a88994bca70bd870.zip
frameworks_base-49e3edff5156f471819e4ea2a88994bca70bd870.tar.gz
frameworks_base-49e3edff5156f471819e4ea2a88994bca70bd870.tar.bz2
Add android.net.CaptivePortal class for captive-portal-handling-app callbacks
This new class replaces the awkward string token and ConnectivityManager APIs used by apps handling captive portals. Bug:21343774 Change-Id: I1a2c69edb17322715bf8422bb4216b0ea60bfd59
Diffstat (limited to 'packages/CaptivePortalLogin')
-rw-r--r--packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index ddbcd78..a489f94 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -21,6 +21,7 @@ import android.app.LoadedApk;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
+import android.net.CaptivePortal;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
import android.net.Network;
@@ -62,7 +63,7 @@ public class CaptivePortalLoginActivity extends Activity {
private URL mURL;
private Network mNetwork;
- private String mResponseToken;
+ private CaptivePortal mCaptivePortal;
private NetworkCallback mNetworkCallback;
private ConnectivityManager mCm;
private boolean mLaunchBrowser = false;
@@ -83,7 +84,7 @@ public class CaptivePortalLoginActivity extends Activity {
done(Result.WANTED_AS_IS);
}
mNetwork = getIntent().getParcelableExtra(ConnectivityManager.EXTRA_NETWORK);
- mResponseToken = getIntent().getStringExtra(ConnectivityManager.EXTRA_CAPTIVE_PORTAL_TOKEN);
+ mCaptivePortal = getIntent().getParcelableExtra(ConnectivityManager.EXTRA_CAPTIVE_PORTAL);
// Also initializes proxy system properties.
mCm.bindProcessToNetwork(mNetwork);
@@ -155,13 +156,13 @@ public class CaptivePortalLoginActivity extends Activity {
}
switch (result) {
case DISMISSED:
- mCm.reportCaptivePortalDismissed(mNetwork, mResponseToken);
+ mCaptivePortal.reportCaptivePortalDismissed();
break;
case UNWANTED:
- mCm.ignoreNetworkWithCaptivePortal(mNetwork, mResponseToken);
+ mCaptivePortal.ignoreNetwork();
break;
case WANTED_AS_IS:
- mCm.useNetworkWithCaptivePortal(mNetwork, mResponseToken);
+ mCaptivePortal.useNetwork();
break;
}
finish();