OSDN Git Service

Allow leading slash in path argument for addURI() method.
authorChiao Cheng <chiaocheng@google.com>
Wed, 20 Mar 2013 20:12:41 +0000 (13:12 -0700)
committerChiao Cheng <chiaocheng@google.com>
Tue, 26 Mar 2013 18:20:47 +0000 (11:20 -0700)
commitef23bf198d14bea183c0dabd5b4fcd0a5d07d738
tree8f9be8ca134af4245024c04d4dfa0bfea3a4a808
parente4c9ac2df26f640fa9aeab5928e82bcc59a33da2
Allow leading slash in path argument for addURI() method.

The original documentation for this class indicated a leading slash was possible
but the code did not support it.  Since then, the docs were changed to reflect
what the code does.

The purpose of this change is to allow the use of uri.getPath() as an argument.
With this change, the following can be done

matcher.addURI(ContactsContract.AUTHORITY,
        ContactsContract.CONTENT_FILTER_URI.getPath(), CONTACTS_FILTER)

instead of

matcher.addURI(ContactsContract.AUTHORITY,
        "contacts/filter", CONTACTS_FILTER)

Change-Id: I76a9e3133365be9fe7a8de86eae57f9eea1cd2a3
core/java/android/content/UriMatcher.java
core/tests/coretests/src/android/net/UriMatcherTest.java