Loading src/com/android/contacts/list/ContactsIntentResolver.java +13 −38 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.contacts.list; import com.android.contacts.CallContactActivity; import com.android.contacts.ContactsSearchManager; import com.android.contacts.ContactsUtils; import android.app.Activity; import android.app.SearchManager; Loading Loading @@ -127,12 +125,6 @@ public class ContactsIntentResolver { request.setActionCode(ContactsRequest.ACTION_INSERT_OR_EDIT_CONTACT); } else if (Intent.ACTION_SEARCH.equals(action)) { String query = intent.getStringExtra(SearchManager.QUERY); // See if the suggestion was clicked with a search action key (call button) if ("call".equals(intent.getStringExtra(SearchManager.ACTION_MSG))) { if (!TextUtils.isEmpty(query)) { request.setRedirectIntent(ContactsUtils.getCallIntent(query)); } } else { // If the {@link SearchManager.QUERY} is empty, then check if a phone number // or email is specified, in that priority. if (TextUtils.isEmpty(query)) { Loading @@ -143,7 +135,6 @@ public class ContactsIntentResolver { } request.setQueryString(query); request.setSearchMode(true); } } else if (Intent.ACTION_VIEW.equals(action)) { final String resolvedType = intent.resolveType(mContext); if (ContactsContract.Contacts.CONTENT_TYPE.equals(resolvedType) Loading Loading @@ -178,27 +169,11 @@ public class ContactsIntentResolver { // so we need to re-dispatch from here to the intended target. } else if (Intents.SEARCH_SUGGESTION_CLICKED.equals(action)) { Uri data = intent.getData(); // See if the suggestion was clicked with a search action key (call button) if ("call".equals(intent.getStringExtra(SearchManager.ACTION_MSG))) { Intent newIntent = new Intent(mContext, CallContactActivity.class); newIntent.setData(data); request.setRedirectIntent(newIntent); } else { request.setActionCode(ContactsRequest.ACTION_VIEW_CONTACT); request.setContactUri(data); intent.setAction(Intent.ACTION_DEFAULT); intent.setData(null); } } else if (Intents.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED.equals(action)) { request.setRedirectIntent(ContactsUtils.getCallIntent(intent.getData())); } else if (Intents.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED.equals(action)) { // TODO actually support this in EditContactActivity. String number = intent.getData().getSchemeSpecificPart(); Intent newIntent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); newIntent.putExtra(Intents.Insert.PHONE, number); request.setRedirectIntent(newIntent); } // Allow the title to be set to a custom String using an extra on the intent String title = intent.getStringExtra(UI.TITLE_EXTRA_KEY); if (title != null) { Loading Loading
src/com/android/contacts/list/ContactsIntentResolver.java +13 −38 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.contacts.list; import com.android.contacts.CallContactActivity; import com.android.contacts.ContactsSearchManager; import com.android.contacts.ContactsUtils; import android.app.Activity; import android.app.SearchManager; Loading Loading @@ -127,12 +125,6 @@ public class ContactsIntentResolver { request.setActionCode(ContactsRequest.ACTION_INSERT_OR_EDIT_CONTACT); } else if (Intent.ACTION_SEARCH.equals(action)) { String query = intent.getStringExtra(SearchManager.QUERY); // See if the suggestion was clicked with a search action key (call button) if ("call".equals(intent.getStringExtra(SearchManager.ACTION_MSG))) { if (!TextUtils.isEmpty(query)) { request.setRedirectIntent(ContactsUtils.getCallIntent(query)); } } else { // If the {@link SearchManager.QUERY} is empty, then check if a phone number // or email is specified, in that priority. if (TextUtils.isEmpty(query)) { Loading @@ -143,7 +135,6 @@ public class ContactsIntentResolver { } request.setQueryString(query); request.setSearchMode(true); } } else if (Intent.ACTION_VIEW.equals(action)) { final String resolvedType = intent.resolveType(mContext); if (ContactsContract.Contacts.CONTENT_TYPE.equals(resolvedType) Loading Loading @@ -178,27 +169,11 @@ public class ContactsIntentResolver { // so we need to re-dispatch from here to the intended target. } else if (Intents.SEARCH_SUGGESTION_CLICKED.equals(action)) { Uri data = intent.getData(); // See if the suggestion was clicked with a search action key (call button) if ("call".equals(intent.getStringExtra(SearchManager.ACTION_MSG))) { Intent newIntent = new Intent(mContext, CallContactActivity.class); newIntent.setData(data); request.setRedirectIntent(newIntent); } else { request.setActionCode(ContactsRequest.ACTION_VIEW_CONTACT); request.setContactUri(data); intent.setAction(Intent.ACTION_DEFAULT); intent.setData(null); } } else if (Intents.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED.equals(action)) { request.setRedirectIntent(ContactsUtils.getCallIntent(intent.getData())); } else if (Intents.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED.equals(action)) { // TODO actually support this in EditContactActivity. String number = intent.getData().getSchemeSpecificPart(); Intent newIntent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); newIntent.putExtra(Intents.Insert.PHONE, number); request.setRedirectIntent(newIntent); } // Allow the title to be set to a custom String using an extra on the intent String title = intent.getStringExtra(UI.TITLE_EXTRA_KEY); if (title != null) { Loading