Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a179962b authored by Etan Cohen's avatar Etan Cohen
Browse files

Merge commit '25a217c0' into merge2

Change-Id: I116a9dbf19e95651a7c50393e4dcd7fb59ca3f3f
parents f491a584 25a217c0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18303,6 +18303,7 @@ package android.net {
    method public android.net.NetworkInfo getNetworkInfo(android.net.Network);
    method public deprecated int getNetworkPreference();
    method public static deprecated android.net.Network getProcessDefaultNetwork();
    method public void ignoreNetworkWithCaptivePortal(android.net.Network, java.lang.String);
    method public boolean isActiveNetworkMetered();
    method public boolean isDefaultNetworkActive();
    method public static boolean isNetworkTypeValid(int);
@@ -18310,6 +18311,7 @@ package android.net {
    method public void releaseNetworkRequest(android.app.PendingIntent);
    method public void removeDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public deprecated void reportBadNetwork(android.net.Network);
    method public void reportCaptivePortalDismissed(android.net.Network, java.lang.String);
    method public void reportNetworkConnectivity(android.net.Network, boolean);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
    method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
@@ -18317,8 +18319,10 @@ package android.net {
    method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
    method public void unregisterNetworkCallback(android.net.ConnectivityManager.NetworkCallback);
    field public static final deprecated java.lang.String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
    field public static final java.lang.String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";
    field public static final java.lang.String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
    field public static final deprecated int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL_TOKEN = "captivePortalToken";
    field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
    field public static final java.lang.String EXTRA_IS_FAILOVER = "isFailover";
    field public static final java.lang.String EXTRA_NETWORK = "android.net.extra.NETWORK";
+4 −0
Original line number Diff line number Diff line
@@ -19762,6 +19762,7 @@ package android.net {
    method public android.net.NetworkInfo getNetworkInfo(android.net.Network);
    method public deprecated int getNetworkPreference();
    method public static deprecated android.net.Network getProcessDefaultNetwork();
    method public void ignoreNetworkWithCaptivePortal(android.net.Network, java.lang.String);
    method public boolean isActiveNetworkMetered();
    method public boolean isDefaultNetworkActive();
    method public static boolean isNetworkTypeValid(int);
@@ -19769,6 +19770,7 @@ package android.net {
    method public void releaseNetworkRequest(android.app.PendingIntent);
    method public void removeDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public deprecated void reportBadNetwork(android.net.Network);
    method public void reportCaptivePortalDismissed(android.net.Network, java.lang.String);
    method public void reportNetworkConnectivity(android.net.Network, boolean);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
    method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
@@ -19776,8 +19778,10 @@ package android.net {
    method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
    method public void unregisterNetworkCallback(android.net.ConnectivityManager.NetworkCallback);
    field public static final deprecated java.lang.String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
    field public static final java.lang.String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";
    field public static final java.lang.String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
    field public static final deprecated int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL_TOKEN = "captivePortalToken";
    field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
    field public static final java.lang.String EXTRA_IS_FAILOVER = "isFailover";
    field public static final java.lang.String EXTRA_NETWORK = "android.net.extra.NETWORK";
+114 −0
Original line number Diff line number Diff line
@@ -97,6 +97,35 @@ public class ConnectivityManager {
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";

    /**
     * The device has connected to a network that has presented a captive
     * portal, which is blocking Internet connectivity. The user was presented
     * with a notification that network sign in is required,
     * and the user invoked the notification's action indicating they
     * desire to sign in to the network. Apps handling this action should
     * facilitate signing in to the network. This action includes a
     * {@link Network} typed extra called {@link #EXTRA_NETWORK} that represents
     * the network presenting the captive portal; all communication with the
     * captive portal must be done using this {@code Network} object.
     * <p/>
     * When the app handling this action believes the user has signed in to
     * the network and the captive portal has been dismissed, the app should call
     * {@link #reportCaptivePortalDismissed} so the system can reevaluate the network.
     * If reevaluation finds the network no longer subject to a captive portal,
     * the network may become the default active data network.
     * <p/>
     * When the app handling this action believes the user explicitly wants
     * to ignore the captive portal and the network, the app should call
     * {@link #ignoreNetworkWithCaptivePortal}.
     * <p/>
     * Note that this action includes a {@code String} extra named
     * {@link #EXTRA_CAPTIVE_PORTAL_TOKEN} that must
     * be passed in to {@link #reportCaptivePortalDismissed} and
     * {@link #ignoreNetworkWithCaptivePortal}.
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";

    /**
     * The lookup key for a {@link NetworkInfo} object. Retrieve with
     * {@link android.content.Intent#getParcelableExtra(String)}.
@@ -159,6 +188,15 @@ public class ConnectivityManager {
     */
    public static final String EXTRA_INET_CONDITION = "inetCondition";

    /**
     * The lookup key for a string that is sent out with
     * {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN}. This string must be
     * passed in to {@link #reportCaptivePortalDismissed} and
     * {@link #ignoreNetworkWithCaptivePortal}. Retrieve it with
     * {@link android.content.Intent#getStringExtra(String)}.
     */
    public static final String EXTRA_CAPTIVE_PORTAL_TOKEN = "captivePortalToken";

    /**
     * Broadcast action to indicate the change of data activity status
     * (idle or active) on a network in a recent period.
@@ -1760,6 +1798,82 @@ public class ConnectivityManager {
        }
    }

    /** {@hide} */
    public static final int CAPTIVE_PORTAL_APP_RETURN_DISMISSED    = 0;
    /** {@hide} */
    public static final int CAPTIVE_PORTAL_APP_RETURN_UNWANTED     = 1;
    /** {@hide} */
    public static final int CAPTIVE_PORTAL_APP_RETURN_WANTED_AS_IS = 2;

    /**
     * Called by an app handling the {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN}
     * action to indicate to the system that the captive portal has been
     * dismissed.  In response the framework will re-evaluate the network's
     * connectivity and might take further action thereafter.
     *
     * @param network The {@link Network} object passed via
     *                {@link #EXTRA_NETWORK} with the
     *                {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     * @param actionToken The {@code String} passed via
     *                    {@link #EXTRA_CAPTIVE_PORTAL_TOKEN} with the
     *                    {@code ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     */
    public void reportCaptivePortalDismissed(Network network, String actionToken) {
        try {
            mService.captivePortalAppResponse(network, CAPTIVE_PORTAL_APP_RETURN_DISMISSED,
                    actionToken);
        } catch (RemoteException e) {
        }
    }

    /**
     * Called by an app handling the {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN}
     * action to indicate that the user does not want to pursue signing in to
     * captive portal and the system should continue to prefer other networks
     * without captive portals for use as the default active data network.  The
     * system will not retest the network for a captive portal so as to avoid
     * disturbing the user with further sign in to network notifications.
     *
     * @param network The {@link Network} object passed via
     *                {@link #EXTRA_NETWORK} with the
     *                {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     * @param actionToken The {@code String} passed via
     *                    {@link #EXTRA_CAPTIVE_PORTAL_TOKEN} with the
     *                    {@code ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     */
    public void ignoreNetworkWithCaptivePortal(Network network, String actionToken) {
        try {
            mService.captivePortalAppResponse(network, CAPTIVE_PORTAL_APP_RETURN_UNWANTED,
                    actionToken);
        } catch (RemoteException e) {
        }
    }

    /**
     * Called by an app handling the {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN}
     * action to indicate the user wants to use this network as is, even though
     * the captive portal is still in place.  The system will treat the network
     * as if it did not have a captive portal when selecting the network to use
     * as the default active data network. This may result in this network
     * becoming the default active data network, which could disrupt network
     * connectivity for apps because the captive portal is still in place.
     *
     * @param network The {@link Network} object passed via
     *                {@link #EXTRA_NETWORK} with the
     *                {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     * @param actionToken The {@code String} passed via
     *                    {@link #EXTRA_CAPTIVE_PORTAL_TOKEN} with the
     *                    {@code ACTION_CAPTIVE_PORTAL_SIGN_IN} action.
     * @hide
     */
    public void useNetworkWithCaptivePortal(Network network, String actionToken) {
        try {
            mService.captivePortalAppResponse(network, CAPTIVE_PORTAL_APP_RETURN_WANTED_AS_IS,
                    actionToken);
        } catch (RemoteException e) {
        }
    }

    /**
     * Set a network-independent global http proxy.  This is not normally what you want
     * for typical HTTP proxies - they are general network dependent.  However if you're
+2 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ interface IConnectivityManager

    void reportNetworkConnectivity(in Network network, boolean hasConnectivity);

    void captivePortalAppResponse(in Network network, int response, String actionToken);

    ProxyInfo getGlobalProxy();

    void setGlobalProxy(in ProxyInfo p);
+1 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@
    <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTABLE" />
    <protected-broadcast android:name="android.intent.action.MEDIA_EJECT" />

    <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL" />
    <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    <!-- @deprecated.  Only {@link android.net.ConnectivityManager.CONNECTIVITY_ACTION} is sent. -->
    <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE" />
Loading