AI 144008: UriMatcher: Avoid repeated calls to Uri.getPathSegments()   in UriMatcher.match().   Before, every call to UriMatcher.match() called   Uri.getPathSegments() N + 1 times,   where N is the size of the list returned by   Uri.getPathSegments(). Since some of the implementations   of Uri.getPathSegments() are O(N), UriMatcher.match() was O(N^2).   This CL fixes the problem by calling uri.getPathSegments() once in   the beginning of match(). That should be safe since Uri is   immutable.   BUG=1751158
AI 144008: UriMatcher: Avoid repeated calls to Uri.getPathSegments()
  in UriMatcher.match().
  Before, every call to UriMatcher.match() called
  Uri.getPathSegments() N + 1 times,
  where N is the size of the list returned by
  Uri.getPathSegments(). Since some of the implementations
  of Uri.getPathSegments() are O(N), UriMatcher.match() was O(N^2).
  This CL fixes the problem by calling uri.getPathSegments() once in
  the beginning of match(). That should be safe since Uri is
  immutable.
  BUG=1751158

Automated import of CL 144008

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base