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

Commit 7472deb5 authored by junyulai's avatar junyulai Committed by Junyu Lai
Browse files

Remove the reference of new Network(int) in Vpn.java

Test: atest FrameworksNetTests
Bug: 182963397
Merged-In: I4176dd1298ad8d8e8407eb95b2e6cbb8faf4bc17
Change-Id: I4176dd1298ad8d8e8407eb95b2e6cbb8faf4bc17
  (cherry-picked from ag/13959430)
parent 9327a578
Loading
Loading
Loading
Loading
+4 −13
Original line number Original line Diff line number Diff line
@@ -1859,22 +1859,13 @@ public class Vpn {
    /**
    /**
     * Updates underlying network set.
     * Updates underlying network set.
     */
     */
    public synchronized boolean setUnderlyingNetworks(Network[] networks) {
    public synchronized boolean setUnderlyingNetworks(@Nullable Network[] networks) {
        if (!isCallerEstablishedOwnerLocked()) {
        if (!isCallerEstablishedOwnerLocked()) {
            return false;
            return false;
        }
        }
        if (networks == null) {
        // Make defensive copy since the content of array might be altered by the caller.
            mConfig.underlyingNetworks = null;
        mConfig.underlyingNetworks =
        } else {
                (networks != null) ? Arrays.copyOf(networks, networks.length) : null;
            mConfig.underlyingNetworks = new Network[networks.length];
            for (int i = 0; i < networks.length; ++i) {
                if (networks[i] == null) {
                    mConfig.underlyingNetworks[i] = null;
                } else {
                    mConfig.underlyingNetworks[i] = new Network(networks[i].getNetId());
                }
            }
        }
        mNetworkAgent.setUnderlyingNetworks((mConfig.underlyingNetworks != null)
        mNetworkAgent.setUnderlyingNetworks((mConfig.underlyingNetworks != null)
                ? Arrays.asList(mConfig.underlyingNetworks) : null);
                ? Arrays.asList(mConfig.underlyingNetworks) : null);
        return true;
        return true;