Merge "Move UidRange to connectivity"

This commit is contained in:
Remi NGUYEN VAN
2021-03-02 09:27:50 +00:00
committed by Gerrit Code Review
3 changed files with 13 additions and 15 deletions

View File

@@ -23,7 +23,6 @@ import android.net.ITetheringStatsProvider;
import android.net.Network;
import android.net.NetworkStats;
import android.net.RouteInfo;
import android.net.UidRange;
/**
* @hide

View File

@@ -16,8 +16,6 @@
package android.net;
import static android.os.UserHandle.PER_USER_RANGE;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
@@ -60,6 +58,7 @@ public final class UidRange implements Parcelable {
return UserHandle.getUserHandleForUid(stop).getIdentifier();
}
/** Returns whether the UidRange contains the specified UID. */
public boolean contains(int uid) {
return start <= uid && uid <= stop;
}
@@ -72,7 +71,7 @@ public final class UidRange implements Parcelable {
}
/**
* @return {@code true} if this range contains every UID contained by the {@param other} range.
* @return {@code true} if this range contains every UID contained by the {@code other} range.
*/
public boolean containsRange(UidRange other) {
return start <= other.start && other.stop <= stop;
@@ -118,18 +117,18 @@ public final class UidRange implements Parcelable {
}
public static final @android.annotation.NonNull Creator<UidRange> CREATOR =
new Creator<UidRange>() {
@Override
public UidRange createFromParcel(Parcel in) {
int start = in.readInt();
int stop = in.readInt();
new Creator<UidRange>() {
@Override
public UidRange createFromParcel(Parcel in) {
int start = in.readInt();
int stop = in.readInt();
return new UidRange(start, stop);
}
@Override
public UidRange[] newArray(int size) {
return new UidRange[size];
}
return new UidRange(start, stop);
}
@Override
public UidRange[] newArray(int size) {
return new UidRange[size];
}
};
/**