Removing obsolete constants

Change-Id: Ie957f3bcc34cabeda712d74e593bfa4240bdc732
diff --git a/src/com/android/contacts/ContactsSearchManager.java b/src/com/android/contacts/ContactsSearchManager.java
index 340d7d6..edb2016 100644
--- a/src/com/android/contacts/ContactsSearchManager.java
+++ b/src/com/android/contacts/ContactsSearchManager.java
@@ -33,26 +33,6 @@
      * An extra that provides context for search UI and defines the scope for
      * the search queries.
      */
-    public static final String ORIGINAL_ACTION_EXTRA_KEY = "originalAction";
-
-    /**
-     * An extra that provides context for search UI and defines the scope for
-     * the search queries.
-     */
-    public static final String ORIGINAL_COMPONENT_EXTRA_KEY = "originalComponent";
-
-    /**
-     * An extra that provides context for search UI and defines the scope for
-     * the search queries.
-     */
-    public static final String ORIGINAL_TYPE_EXTRA_KEY = "originalType";
-
-    /**
-     * An extra that provides context for search UI and defines the scope for
-     * the search queries.
-     */
-    public static final String ORIGINAL_ACTION_CODE_EXTRA_KEY = "originalActionCode";
-
     public static final String ORIGINAL_REQUEST_KEY = "originalRequest";
 
     /**
diff --git a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
index b2c3072..f5bb548 100644
--- a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
+++ b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
@@ -17,6 +17,7 @@
 package com.android.contacts.tests.allintents;
 
 import com.android.contacts.ContactsSearchManager;
+import com.android.contacts.list.ContactsRequest;
 import com.android.contacts.tests.R;
 
 import android.app.ListActivity;
@@ -144,8 +145,7 @@
                 break;
             }
             case LIST_STARRED_ACTION_WITH_FILTER: {
-                startContactsListActivity(
-                        buildFilterIntent(UI.LIST_STARRED_ACTION, null, null));
+                startContactsListActivity(buildFilterIntent(ContactsRequest.ACTION_STARRED, false));
                 break;
             }
             case LIST_FREQUENT_ACTION: {
@@ -155,7 +155,7 @@
             }
             case LIST_FREQUENT_ACTION_WITH_FILTER: {
                 startContactsListActivity(
-                        buildFilterIntent(UI.LIST_FREQUENT_ACTION, null, null));
+                        buildFilterIntent(ContactsRequest.ACTION_FREQUENT, false));
                 break;
             }
             case LIST_STREQUENT_ACTION: {
@@ -165,7 +165,7 @@
             }
             case LIST_STREQUENT_ACTION_WITH_FILTER: {
                 startContactsListActivity(
-                        buildFilterIntent(UI.LIST_STREQUENT_ACTION, null, null));
+                        buildFilterIntent(ContactsRequest.ACTION_STREQUENT, false));
                 break;
             }
             case ACTION_PICK_CONTACT: {
@@ -206,8 +206,8 @@
             }
             case ACTION_CREATE_SHORTCUT_CONTACT_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_CREATE_SHORTCUT,
-                                CONTACTS_LIST_ACTIVITY_CLASS_NAME, null));
+                        buildFilterIntent(ContactsRequest.ACTION_CREATE_SHORTCUT_CONTACT,
+                                false));
                 break;
             }
             case ACTION_CREATE_SHORTCUT_DIAL: {
@@ -219,8 +219,8 @@
             }
             case ACTION_CREATE_SHORTCUT_DIAL_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_CREATE_SHORTCUT,
-                                "alias.DialShortcut", null));
+                        buildFilterIntent(ContactsRequest.ACTION_CREATE_SHORTCUT_CALL,
+                                false));
                 break;
             }
             case ACTION_CREATE_SHORTCUT_MESSAGE: {
@@ -232,8 +232,7 @@
             }
             case ACTION_CREATE_SHORTCUT_MESSAGE_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_CREATE_SHORTCUT,
-                                "alias.MessageShortcut", null));
+                        buildFilterIntent(ContactsRequest.ACTION_CREATE_SHORTCUT_CALL, false));
                 break;
             }
             case ACTION_GET_CONTENT_CONTACT: {
@@ -250,16 +249,13 @@
             }
             case ACTION_GET_CONTENT_CONTACT_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_GET_CONTENT,
-                                CONTACTS_LIST_ACTIVITY_CLASS_NAME,
-                                Contacts.CONTENT_ITEM_TYPE));
+                        buildFilterIntent(ContactsRequest.ACTION_PICK_OR_CREATE_CONTACT, false));
                 break;
             }
             case ACTION_GET_CONTENT_CONTACT_FILTER_LEGACY: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_GET_CONTENT,
-                                CONTACTS_LIST_ACTIVITY_CLASS_NAME,
-                                People.CONTENT_ITEM_TYPE));
+                        buildFilterIntent(ContactsRequest.ACTION_PICK_OR_CREATE_CONTACT,
+                                true));
                 break;
             }
             case ACTION_GET_CONTENT_PHONE: {
@@ -270,9 +266,7 @@
             }
             case ACTION_GET_CONTENT_PHONE_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_GET_CONTENT,
-                                CONTACTS_LIST_ACTIVITY_CLASS_NAME,
-                                Phone.CONTENT_ITEM_TYPE));
+                        buildFilterIntent(ContactsRequest.ACTION_PICK_PHONE, true));
                 break;
             }
             case ACTION_GET_CONTENT_PHONE_LEGACY: {
@@ -289,9 +283,7 @@
             }
             case ACTION_GET_CONTENT_POSTAL_FILTER: {
                 startContactsListActivityForResult(
-                        buildFilterIntent(Intent.ACTION_GET_CONTENT,
-                                CONTACTS_LIST_ACTIVITY_CLASS_NAME,
-                                StructuredPostal.CONTENT_ITEM_TYPE));
+                        buildFilterIntent(ContactsRequest.ACTION_PICK_POSTAL, false));
                 break;
             }
             case ACTION_GET_CONTENT_POSTAL_LEGACY: {
@@ -438,16 +430,12 @@
         }
     }
 
-    private Intent buildFilterIntent(String action, String component, String type) {
+    private Intent buildFilterIntent(int actionCode, boolean legacy) {
         Intent intent = new Intent(UI.FILTER_CONTACTS_ACTION);
         intent.putExtra(UI.FILTER_TEXT_EXTRA_KEY, "A");
-        intent.putExtra(ContactsSearchManager.ORIGINAL_ACTION_EXTRA_KEY, action);
-        if (component != null) {
-            intent.putExtra(ContactsSearchManager.ORIGINAL_COMPONENT_EXTRA_KEY, component);
-        }
-        if (type != null) {
-            intent.putExtra(ContactsSearchManager.ORIGINAL_TYPE_EXTRA_KEY, type);
-        }
+        ContactsRequest request = new ContactsRequest();
+        request.setActionCode(actionCode);
+        intent.putExtra(ContactsSearchManager.ORIGINAL_REQUEST_KEY, request);
         return intent;
     }