Rewrite UidRanges::overlaps()

Improve time complexity of the function from O(mn) to O(mlog(n)). The m
is the number of uid pairs in the new adding UidRanges. The n is the
number of uid pairs kept by netd.

Bug: 182460808
Test: atest
Change-Id: I1be2c2a55bac8c5b32ca130e34df6ea24abfdb47
2 files changed