Add a "sign into network" button to the wifi details page.

Bug: 36203355
Test: manually signed into captive portal
Test: make -j64 RunSettingsRoboTests
Change-Id: I3242ef30125ddfdaaac9b80ead4f8ac14ea6d364
This commit is contained in:
Lorenzo Colitti
2017-04-27 00:56:39 +09:00
parent d51b94b042
commit b6245156f6
6 changed files with 255 additions and 43 deletions

View File

@@ -16,6 +16,11 @@
package com.android.settings.vpn2;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
import android.net.Network;
import android.net.NetworkRequest;
import android.os.Handler;
import android.net.ProxyInfo;
/**
@@ -26,6 +31,11 @@ import android.net.ProxyInfo;
*/
public interface ConnectivityManagerWrapper {
/**
* Returns the real ConnectivityManager object wrapped by this wrapper.
*/
public ConnectivityManager getConnectivityManager();
/**
* Calls {@code ConnectivityManager.getAlwaysOnVpnPackageForUser()}.
*
@@ -39,4 +49,27 @@ public interface ConnectivityManagerWrapper {
* @see android.net.ConnectivityManager#getGlobalProxy
*/
ProxyInfo getGlobalProxy();
/**
* Calls {@code ConnectivityManager.registerNetworkCallback()}.
*
* This is part of the ConnectivityManager public API in SDK 26 or above, but is not yet visible
* to the robolectric tests, which currently build with SDK 23.
* TODO: delete this once the robolectric tests build with SDK 26 or above.
*
* @see android.net.ConnectivityManager#registerNetworkCallback(NetworkRequest,NetworkCallback,Handler)
*/
public void registerNetworkCallback(NetworkRequest request, NetworkCallback callback,
Handler handler);
/**
* Calls {@code ConnectivityManager.startCaptivePortalApp()}.
*
* This is part of the ConnectivityManager public API in SDK 26 or above, but is not yet visible
* to the robolectric tests, which currently build with SDK 23.
* TODO: delete this once the robolectric tests build with SDK 26 or above.
*
* @see android.net.ConnectivityManager#startCaptivePortalApp(Network)
*/
public void startCaptivePortalApp(Network network);
}