Merge "Make some of the UID-based VPN code reusable" into nyc-dev

am: 89bf3e3aa2

* commit '89bf3e3aa2b3e95486445a50f4666a20b3d8e830':
  Make some of the UID-based VPN code reusable

Change-Id: I3f1b1a08059aa58cb76db6cdd070b103024b9bf3
This commit is contained in:
Robin Lee
2016-05-17 17:36:43 +00:00
committed by android-build-merger
2 changed files with 209 additions and 0 deletions

View File

@@ -48,6 +48,17 @@ public final class UidRange implements Parcelable {
return start / PER_USER_RANGE;
}
public boolean contains(int uid) {
return start <= uid && uid <= stop;
}
/**
* @return {@code true} if this range contains every UID contained by the {@param other} range.
*/
public boolean containsRange(UidRange other) {
return start <= other.start && other.stop <= stop;
}
@Override
public int hashCode() {
int result = 17;