summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/util/UriUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/contacts/common/util/UriUtils.java')
-rw-r--r--src/com/android/contacts/common/util/UriUtils.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/util/UriUtils.java b/src/com/android/contacts/common/util/UriUtils.java
index 41ef62f6..bc098d36 100644
--- a/src/com/android/contacts/common/util/UriUtils.java
+++ b/src/com/android/contacts/common/util/UriUtils.java
@@ -75,6 +75,25 @@ public class UriUtils {
}
/**
+ * @return true if this uri represents a local contact, false otherwise.
+ */
+ public static boolean isLocalContactUri(Uri uri) {
+ if (uri == null) {
+ return false;
+ }
+
+ if (isEncodedContactUri(uri)) {
+ return false;
+ }
+
+ if (!uri.getScheme().equals(ContactsContract.AUTHORITY)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
* Parses the given URI to determine the original lookup key of the contact.
*/
public static String getLookupKeyFromUri(Uri lookupUri) {