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

am: 4920698e17

* commit '4920698e17dc8aacd1b0743d313383a8ee1a3400':
  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
3 changed files with 301 additions and 42 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;