Loading AndroidManifest.xml +7 −2 Original line number Diff line number Diff line Loading @@ -254,6 +254,13 @@ <data android:mimeType="vnd.android.cursor.dir/contact" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/person" /> <data android:mimeType="vnd.android.cursor.dir/contact" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> Loading Loading @@ -480,8 +487,6 @@ <intent-filter android:label="@string/viewContactDesription"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/person" /> <data android:mimeType="vnd.android.cursor.dir/contact" /> <data android:mimeType="vnd.android.cursor.item/person" /> <data android:mimeType="vnd.android.cursor.item/contact" /> <data android:mimeType="vnd.android.cursor.item/raw_contact" /> Loading src/com/android/contacts/list/ContactsIntentResolver.java +11 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Bundle; import android.provider.Contacts.ContactMethods; import android.provider.Contacts.People; import android.provider.Contacts.Phones; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.CommonDataKinds.StructuredPostal; Loading Loading @@ -145,10 +146,16 @@ public class ContactsIntentResolver { request.setSearchMode(true); } } else if (Intent.ACTION_VIEW.equals(action)) { final String resolvedType = intent.resolveType(mContext); if (ContactsContract.Contacts.CONTENT_TYPE.equals(resolvedType) || android.provider.Contacts.People.CONTENT_TYPE.equals(resolvedType)) { request.setActionCode(ContactsRequest.ACTION_ALL_CONTACTS); } else { request.setActionCode(ContactsRequest.ACTION_VIEW_CONTACT); request.setContactUri(intent.getData()); intent.setAction(Intent.ACTION_DEFAULT); intent.setData(null); } } else if (UI.FILTER_CONTACTS_ACTION.equals(action)) { // When we get a FILTER_CONTACTS_ACTION, it represents search in the context // of some other action. Let's retrieve the original action to provide proper Loading tests/res/values/donottranslate_strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ <item>LIST_FREQUENT_ACTION</item> <item>LIST_STREQUENT_ACTION</item> <item>LIST_GROUP_ACTION</item> <item>VIEW (content uri without any id)</item> <item>ACTION_PICK: contact</item> <item>ACTION_PICK: contact (legacy)</item> <item>ACTION_PICK: phone</item> Loading tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java +5 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class AllIntentsActivity extends ListActivity LIST_FREQUENT_ACTION, LIST_STREQUENT_ACTION, LIST_GROUP_ACTION, VIEW_CONTACT_WITHOUT_ID, ACTION_PICK_CONTACT, ACTION_PICK_CONTACT_LEGACY, ACTION_PICK_PHONE, Loading Loading @@ -409,6 +410,10 @@ public class AllIntentsActivity extends ListActivity startActivity(intent); break; } case VIEW_CONTACT_WITHOUT_ID: { startActivity(new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI)); break; } case VIEW_CONTACT_LOOKUP: { final long contactId = findArbitraryContactWithPhoneNumber(); final Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId); Loading Loading
AndroidManifest.xml +7 −2 Original line number Diff line number Diff line Loading @@ -254,6 +254,13 @@ <data android:mimeType="vnd.android.cursor.dir/contact" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/person" /> <data android:mimeType="vnd.android.cursor.dir/contact" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> Loading Loading @@ -480,8 +487,6 @@ <intent-filter android:label="@string/viewContactDesription"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/person" /> <data android:mimeType="vnd.android.cursor.dir/contact" /> <data android:mimeType="vnd.android.cursor.item/person" /> <data android:mimeType="vnd.android.cursor.item/contact" /> <data android:mimeType="vnd.android.cursor.item/raw_contact" /> Loading
src/com/android/contacts/list/ContactsIntentResolver.java +11 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Bundle; import android.provider.Contacts.ContactMethods; import android.provider.Contacts.People; import android.provider.Contacts.Phones; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.CommonDataKinds.StructuredPostal; Loading Loading @@ -145,10 +146,16 @@ public class ContactsIntentResolver { request.setSearchMode(true); } } else if (Intent.ACTION_VIEW.equals(action)) { final String resolvedType = intent.resolveType(mContext); if (ContactsContract.Contacts.CONTENT_TYPE.equals(resolvedType) || android.provider.Contacts.People.CONTENT_TYPE.equals(resolvedType)) { request.setActionCode(ContactsRequest.ACTION_ALL_CONTACTS); } else { request.setActionCode(ContactsRequest.ACTION_VIEW_CONTACT); request.setContactUri(intent.getData()); intent.setAction(Intent.ACTION_DEFAULT); intent.setData(null); } } else if (UI.FILTER_CONTACTS_ACTION.equals(action)) { // When we get a FILTER_CONTACTS_ACTION, it represents search in the context // of some other action. Let's retrieve the original action to provide proper Loading
tests/res/values/donottranslate_strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ <item>LIST_FREQUENT_ACTION</item> <item>LIST_STREQUENT_ACTION</item> <item>LIST_GROUP_ACTION</item> <item>VIEW (content uri without any id)</item> <item>ACTION_PICK: contact</item> <item>ACTION_PICK: contact (legacy)</item> <item>ACTION_PICK: phone</item> Loading
tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java +5 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class AllIntentsActivity extends ListActivity LIST_FREQUENT_ACTION, LIST_STREQUENT_ACTION, LIST_GROUP_ACTION, VIEW_CONTACT_WITHOUT_ID, ACTION_PICK_CONTACT, ACTION_PICK_CONTACT_LEGACY, ACTION_PICK_PHONE, Loading Loading @@ -409,6 +410,10 @@ public class AllIntentsActivity extends ListActivity startActivity(intent); break; } case VIEW_CONTACT_WITHOUT_ID: { startActivity(new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI)); break; } case VIEW_CONTACT_LOOKUP: { final long contactId = findArbitraryContactWithPhoneNumber(); final Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId); Loading