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

Commit 554475f0 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android (Google) Code Review
Browse files

Merge "resolved conflicts for merge of 40717996 to master"

parents 7cec1423 86994c1f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -115,6 +115,14 @@
        <item>"mobile_cbs,12,0,2,60000,true"</item>
    </string-array>

    <!-- Array of ConnectivityManager.TYPE_xxxx constants for networks that may only
         be controlled by systemOrSignature apps.  -->
    <integer-array translatable="false" name="config_protectedNetworks">
        <item>10</item>
        <item>11</item>
        <item>12</item>
    </integer-array>

    <!-- This string array should be overridden by the device to present a list of radio
         attributes.  This is used by the connectivity manager to decide which networks can coexist
         based on the hardware -->
+25 −1
Original line number Diff line number Diff line
@@ -278,6 +278,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
    }
    RadioAttributes[] mRadioAttributes;

    // the set of network types that can only be enabled by system/sig apps
    List mProtectedNetworks;

    public ConnectivityService(
            Context context, INetworkManagementService netd, INetworkPolicyManager policyManager) {
        if (DBG) log("ConnectivityService starting up");
@@ -381,6 +384,17 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            }
        }

        mProtectedNetworks = new ArrayList<Integer>();
        int[] protectedNetworks = context.getResources().getIntArray(
                com.android.internal.R.array.config_protectedNetworks);
        for (int p : protectedNetworks) {
            if ((mNetConfigs[p] != null) && (mProtectedNetworks.contains(p) == false)) {
                mProtectedNetworks.add(p);
            } else {
                if (DBG) loge("Ignoring protectedNetwork " + p);
            }
        }

        // high priority first
        mPriorityList = new int[mNetworksDefined];
        {
@@ -802,6 +816,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                usedNetworkType = networkType;
            }
        }

        if (mProtectedNetworks.contains(usedNetworkType)) {
            enforceConnectivityInternalPermission();
        }

        NetworkStateTracker network = mNetTrackers[usedNetworkType];
        if (network != null) {
            Integer currentPid = new Integer(getCallingPid());
@@ -1012,6 +1031,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
     */
    public boolean requestRouteToHostAddress(int networkType, byte[] hostAddress) {
        enforceChangePermission();
        if (mProtectedNetworks.contains(networkType)) {
            enforceConnectivityInternalPermission();
        }

        if (!ConnectivityManager.isNetworkTypeValid(networkType)) {
            return false;
        }
@@ -1129,7 +1152,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
    }

    public void setDataDependency(int networkType, boolean met) {
        enforceChangePermission();
        enforceConnectivityInternalPermission();

        if (DBG) {
            log("setDataDependency(" + networkType + ", " + met + ")");
        }