Fixes that Contacts crashes when invoke Action.EDIT with profile uri
Modify checking method the URI parameter of Intent.ACTION_EDIT.
Support to "content://com.android.contacts/profile".
Affected Area:
Launch Contact edit screen.
Bug: 67727198
Change-Id: I53bab4c9a5e11f420e2075a6af4b48858b3bd4c0
diff --git a/src/com/android/contacts/editor/PickRawContactLoader.java b/src/com/android/contacts/editor/PickRawContactLoader.java
index e43d02b..772bc16 100644
--- a/src/com/android/contacts/editor/PickRawContactLoader.java
+++ b/src/com/android/contacts/editor/PickRawContactLoader.java
@@ -179,7 +179,8 @@
if (uri == null) {
throw new IllegalArgumentException("Uri must not be null");
}
- if (!uri.toString().startsWith(Contacts.CONTENT_URI.toString())) {
+ if (!uri.toString().startsWith(Contacts.CONTENT_URI.toString()) &&
+ !uri.toString().equals(Profile.CONTENT_URI.toString())) {
throw new IllegalArgumentException("Invalid contact Uri: " + uri);
}
return uri;