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

Commit cbd6dbc5 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Gerrit Code Review
Browse files

Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d

* changes:
  Increase test coverage for VPN info sent to NetworkStatsService.
  Simplify MockVpn.
  Test a VPN with an underlying network that does not yet exist.
  Minor fixes to NetworkCapabilities#toString.
parents 9890dd3d 76c727c3
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1802,21 +1802,27 @@ public final class NetworkCapabilities implements Parcelable {
            sb.append(" OwnerUid: ").append(mOwnerUid);
        }

        if (mAdministratorUids.length == 0) {
            sb.append(" AdministratorUids: ").append(Arrays.toString(mAdministratorUids));
        if (!ArrayUtils.isEmpty(mAdministratorUids)) {
            sb.append(" AdminUids: ").append(Arrays.toString(mAdministratorUids));
        }

        if (mRequestorUid != Process.INVALID_UID) {
            sb.append(" RequestorUid: ").append(mRequestorUid);
        }

        if (mRequestorPackageName != null) {
            sb.append(" RequestorPkg: ").append(mRequestorPackageName);
        }

        if (null != mSSID) {
            sb.append(" SSID: ").append(mSSID);
        }


        if (mPrivateDnsBroken) {
            sb.append(" Private DNS is broken");
            sb.append(" PrivateDnsBroken");
        }

        sb.append(" RequestorUid: ").append(mRequestorUid);
        sb.append(" RequestorPackageName: ").append(mRequestorPackageName);

        sb.append("]");
        return sb.toString();
    }
+2 −1
Original line number Diff line number Diff line
@@ -207,7 +207,8 @@ public class Vpn {
    @VisibleForTesting protected String mPackage;
    private int mOwnerUID;
    private boolean mIsPackageTargetingAtLeastQ;
    private String mInterface;
    @VisibleForTesting
    protected String mInterface;
    private Connection mConnection;

    /** Tracks the runners for all VPN types managed by the platform (eg. LegacyVpn, PlatformVpn) */
+1 −0
Original line number Diff line number Diff line
@@ -35,4 +35,5 @@ class TestNetIdManager : NetIdManager() {
    private val nextId = AtomicInteger(MAX_NET_ID)
    override fun reserveNetId() = nextId.decrementAndGet()
    override fun releaseNetId(id: Int) = Unit
    fun peekNextNetId() = nextId.get() - 1
}
+226 −49

File changed.

Preview size limit exceeded, changes collapsed.