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

Commit cf8c3fe1 authored by Chalard Jean's avatar Chalard Jean
Browse files

Fix a bug where a NetworkAgent gets repeatedly torn down

mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Change-Id: Id2bbf3808e80b19cd055c832c11cf72372710942
parent f4dc7155
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -892,7 +892,7 @@ public final class NetworkCapabilities implements Parcelable {
     *
     * @hide
     */
    private Set<UidRange> mUids = null;
    private ArraySet<UidRange> mUids = null;

    /**
     * Convenience method to set the UIDs this network applies to to a single UID.
@@ -1180,7 +1180,7 @@ public final class NetworkCapabilities implements Parcelable {
        dest.writeInt(mLinkDownBandwidthKbps);
        dest.writeParcelable((Parcelable) mNetworkSpecifier, flags);
        dest.writeInt(mSignalStrength);
        dest.writeArraySet(new ArraySet<>(mUids));
        dest.writeArraySet(mUids);
    }

    public static final Creator<NetworkCapabilities> CREATOR =