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

Commit 3302cfc6 authored by lucaslin's avatar lucaslin
Browse files

Remove the network capabilities which are added twice

Remove the network capabilities which are added twice in
createDefaultNetworkCapabilitiesForUid() and
createDefaultInternetRequestForTransport(). In the constructor
of NetworkCapabilities, it will add the DEFAULT_CAPABILITIES
which includes the NOT_RESTRICTED.

Bug: 142370233
Test: 1. Build pass.
      2. atest FrameworksNetTests
Change-Id: I7159909aec8faa7f25cef94195bdaea0fea55840
parent 37ee696d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1149,7 +1149,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
    private static NetworkCapabilities createDefaultNetworkCapabilitiesForUid(int uid) {
        final NetworkCapabilities netCap = new NetworkCapabilities();
        netCap.addCapability(NET_CAPABILITY_INTERNET);
        netCap.addCapability(NET_CAPABILITY_NOT_RESTRICTED);
        netCap.removeCapability(NET_CAPABILITY_NOT_VPN);
        netCap.setSingleUid(uid);
        return netCap;
@@ -1159,7 +1158,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
            int transportType, NetworkRequest.Type type) {
        final NetworkCapabilities netCap = new NetworkCapabilities();
        netCap.addCapability(NET_CAPABILITY_INTERNET);
        netCap.addCapability(NET_CAPABILITY_NOT_RESTRICTED);
        if (transportType > -1) {
            netCap.addTransportType(transportType);
        }