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

Commit dc99c504 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Make StatusBar display all default networks." into lmp-mr1-dev

parents f675cad8 403aa268
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -720,6 +720,19 @@ public class ConnectivityManager {
        }
        }
    }
    }


    /**
     * Returns an array of of {@link NetworkCapabilities} objects, representing
     * the Networks that applications run by the given user will use by default.
     * @hide
     */
    public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) {
        try {
            return mService.getDefaultNetworkCapabilitiesForUser(userId);
        } catch (RemoteException e) {
            return null;
        }
    }

    /**
    /**
     * Returns details about the Provisioning or currently active default data network. When
     * Returns details about the Provisioning or currently active default data network. When
     * connected, this network is the default route for outgoing connections.
     * connected, this network is the default route for outgoing connections.
+1 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ interface IConnectivityManager
    NetworkInfo[] getAllNetworkInfo();
    NetworkInfo[] getAllNetworkInfo();
    Network getNetworkForType(int networkType);
    Network getNetworkForType(int networkType);
    Network[] getAllNetworks();
    Network[] getAllNetworks();
    NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId);


    NetworkInfo getProvisioningOrActiveNetworkInfo();
    NetworkInfo getProvisioningOrActiveNetworkInfo();


+8 −1
Original line number Original line Diff line number Diff line
@@ -154,9 +154,16 @@ public final class NetworkCapabilities implements Parcelable {
     */
     */
    public static final int NET_CAPABILITY_NOT_VPN        = 15;
    public static final int NET_CAPABILITY_NOT_VPN        = 15;


    /**
     * Indicates that connectivity on this network was successfully validated. For example, for a
     * network with NET_CAPABILITY_INTERNET, it means that Internet connectivity was successfully
     * detected.
     * @hide
     */
    public static final int NET_CAPABILITY_VALIDATED      = 16;


    private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
    private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_NOT_VPN;
    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_VALIDATED;


    /**
    /**
     * Adds the given capability to this {@code NetworkCapability} instance.
     * Adds the given capability to this {@code NetworkCapability} instance.
+1 −1
Original line number Original line Diff line number Diff line
@@ -122,7 +122,7 @@ public class QSTileHost implements QSTile.Host {
                    tile.userSwitch(newUserId);
                    tile.userSwitch(newUserId);
                }
                }
                mSecurity.onUserSwitched(newUserId);
                mSecurity.onUserSwitched(newUserId);
                mNetwork.getAccessPointController().onUserSwitched(newUserId);
                mNetwork.onUserSwitched(newUserId);
                mObserver.register();
                mObserver.register();
            }
            }
        };
        };
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@ public interface NetworkController {
    void addNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
    void addNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
    void removeNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
    void removeNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
    void setWifiEnabled(boolean enabled);
    void setWifiEnabled(boolean enabled);
    void onUserSwitched(int newUserId);
    AccessPointController getAccessPointController();
    AccessPointController getAccessPointController();
    MobileDataController getMobileDataController();
    MobileDataController getMobileDataController();


@@ -49,7 +50,6 @@ public interface NetworkController {
        void scanForAccessPoints();
        void scanForAccessPoints();
        boolean connect(AccessPoint ap);
        boolean connect(AccessPoint ap);
        boolean canConfigWifi();
        boolean canConfigWifi();
        void onUserSwitched(int newUserId);


        public interface AccessPointCallback {
        public interface AccessPointCallback {
            void onAccessPointsChanged(AccessPoint[] accessPoints);
            void onAccessPointsChanged(AccessPoint[] accessPoints);
Loading