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

Commit 66341900 authored by Paul Hu's avatar Paul Hu
Browse files

Add CTS API coverage for APIs which are used by NetworkStack

Bug: 129200003
Bug: 129200292
Bug: 129199996
Bug: 129200261
Bug: 129200513
Bug: 129200316
Bug: 129200589
Bug: 129200181
Bug: 129200669
Bug: 129200504
Bug: 129200478
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass

Change-Id: I0fed0664c1eb7b07c890efffb71ef589f65eec80
Merged-In: Id3f0d1c19a76c7987b69e449203fc50423f5e531
Merged-In: I0fed0664c1eb7b07c890efffb71ef589f65eec80
(cherry picked from commit 8c6a07de)
parent b037feb1
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public final class ApfProgramEvent implements IpConnectivityLog.Event {
        out.writeInt(filteredRas);
        out.writeInt(currentRas);
        out.writeInt(programLength);
        out.writeInt(flags);
        out.writeInt(this.flags);
    }

    /** @hide */
@@ -192,6 +192,18 @@ public final class ApfProgramEvent implements IpConnectivityLog.Event {
                programLength, actualLifetime, lifetimeString, namesOf(flags));
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj.getClass().equals(ApfProgramEvent.class))) return false;
        final ApfProgramEvent other = (ApfProgramEvent) obj;
        return lifetime == other.lifetime
                && actualLifetime == other.actualLifetime
                && filteredRas == other.filteredRas
                && currentRas == other.currentRas
                && programLength == other.programLength
                && flags == other.flags;
    }

    /** @hide */
    public static final @android.annotation.NonNull Parcelable.Creator<ApfProgramEvent> CREATOR
            = new Parcelable.Creator<ApfProgramEvent>() {
+16 −0
Original line number Diff line number Diff line
@@ -275,6 +275,22 @@ public final class ApfStats implements IpConnectivityLog.Event {
                .toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj.getClass().equals(ApfStats.class))) return false;
        final ApfStats other = (ApfStats) obj;
        return durationMs == other.durationMs
                && receivedRas == other.receivedRas
                && matchingRas == other.matchingRas
                && droppedRas == other.droppedRas
                && zeroLifetimeRas == other.zeroLifetimeRas
                && parseErrors == other.parseErrors
                && programUpdates == other.programUpdates
                && programUpdatesAll == other.programUpdatesAll
                && programUpdatesAllowingMulticast == other.programUpdatesAllowingMulticast
                && maxProgramSize == other.maxProgramSize;
    }

    /** @hide */
    public static final @android.annotation.NonNull Parcelable.Creator<ApfStats> CREATOR = new Parcelable.Creator<ApfStats>() {
        public ApfStats createFromParcel(Parcel in) {
+9 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

/**
 * An event recorded when a DhcpClient state machine transitions to a new state.
@@ -101,6 +102,14 @@ public final class DhcpClientEvent implements IpConnectivityLog.Event {
        return String.format("DhcpClientEvent(%s, %dms)", msg, durationMs);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj.getClass().equals(DhcpClientEvent.class))) return false;
        final DhcpClientEvent other = (DhcpClientEvent) obj;
        return TextUtils.equals(msg, other.msg)
                && durationMs == other.durationMs;
    }

    /** @hide */
    public static final @android.annotation.NonNull Parcelable.Creator<DhcpClientEvent> CREATOR
        = new Parcelable.Creator<DhcpClientEvent>() {
+8 −0
Original line number Diff line number Diff line
@@ -101,6 +101,14 @@ public final class IpManagerEvent implements IpConnectivityLog.Event {
                Decoder.constants.get(eventType), durationMs);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj.getClass().equals(IpManagerEvent.class))) return false;
        final IpManagerEvent other = (IpManagerEvent) obj;
        return eventType == other.eventType
                && durationMs == other.durationMs;
    }

    final static class Decoder {
        static final SparseArray<String> constants = MessageUtils.findMessageNames(
                new Class[]{IpManagerEvent.class},
+7 −0
Original line number Diff line number Diff line
@@ -93,6 +93,13 @@ public final class IpReachabilityEvent implements IpConnectivityLog.Event {
        return String.format("IpReachabilityEvent(%s:%02x)", eventName, lo);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj.getClass().equals(IpReachabilityEvent.class))) return false;
        final IpReachabilityEvent other = (IpReachabilityEvent) obj;
        return eventType == other.eventType;
    }

    final static class Decoder {
        static final SparseArray<String> constants =
                MessageUtils.findMessageNames(new Class[]{IpReachabilityEvent.class},
Loading