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

Commit 1c9ca3b0 authored by Paul Hu's avatar Paul Hu Committed by Gerrit Code Review
Browse files

Merge "Add CTS API coverage for APIs which are used by NetworkStack"

parents 39fbf96b f32da69e
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 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 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 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