Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a580bd9 authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Add all intents accpeted by PeopleActivity to AllIntentsActivity" into...

Merge "Add all intents accpeted by PeopleActivity to AllIntentsActivity" into ub-contactsdialer-f-dev
parents 5b9215ab 9868692a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -28,6 +28,12 @@ public class UiIntentActions {
    public static final String LIST_DEFAULT =
            "com.android.contacts.action.LIST_DEFAULT";

    /**
     * The action for contacts list tab.
     */
    public static final String LIST_CONTACTS =
            "com.android.contacts.action.LIST_CONTACTS";

    /**
     * The action for the contacts list tab.
     */
+12 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

    <string-array name="allIntents">
        <!-- List modes -->
        <item>VIEW (content uri without any id)</item>
        <item>ACTION_PICK: contact</item>
        <item>ACTION_PICK: contact (legacy)</item>
        <item>ACTION_PICK: phone</item>
@@ -44,6 +43,7 @@
        <item>ACTION_SEARCH: contact</item>
        <item>ACTION_SEARCH: email</item>
        <item>ACTION_SEARCH: phone</item>
        <item>ACTION_SEARCH: general</item>
        <item>SEARCH_SUGGESTION_CLICKED: contact</item>

        <!-- Edit -->
@@ -61,6 +61,8 @@
        <item>EDIT (group)</item>

        <!-- View -->
        <item>VIEW (content uri without any id)</item>
        <item>VIEW PERSON (content uri without any id)</item>
        <item>VIEW (content uri with only id)</item>
        <item>VIEW (lookup uri without id)</item>
        <item>VIEW (lookup uri)</item>
@@ -70,6 +72,15 @@

        <!-- Various ways to start Contacts -->
        <item>QuickContactTestsActivity</item>

        <!-- Intents accepted by PeopleActivity -->
        <item>LIST_DEFAULT</item>
        <item>LIST_CONTACTS</item>
        <item>LIST_ALL_CONTACTS</item>
        <item>LIST_CONTACTS_WITH_PHONES</item>
        <item>LIST_STARRED</item>
        <item>LIST_FREQUENT</item>
        <item>LIST_STREQUENT</item>
    </string-array>

    <string name="pickContact">Pick contact</string>
+52 −2
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.widget.ListView;
import android.widget.Toast;

import com.android.contacts.GroupListLoader;
import com.android.contacts.list.UiIntentActions;
import com.android.contacts.tests.R;
import com.android.contacts.tests.quickcontact.QuickContactTestsActivity;

@@ -67,7 +68,6 @@ public class AllIntentsActivity extends ListActivity
            "com.android.contacts.activities.PeopleActivity";

    public enum ContactsIntent {
        VIEW_CONTACT_WITHOUT_ID,
        ACTION_PICK_CONTACT,
        ACTION_PICK_CONTACT_LEGACY,
        ACTION_PICK_PHONE,
@@ -92,6 +92,7 @@ public class AllIntentsActivity extends ListActivity
        ACTION_SEARCH_CONTACT,
        ACTION_SEARCH_EMAIL,
        ACTION_SEARCH_PHONE,
        ACTION_SEARCH_GENERAL,
        SEARCH_SUGGESTION_CLICKED_CONTACT,
        EDIT_CONTACT,
        EDIT_CONTACT_LOOKUP,
@@ -105,13 +106,22 @@ public class AllIntentsActivity extends ListActivity
        EDIT_NEW_RAW_CONTACT,
        EDIT_NEW_LEGACY,
        EDIT_GROUP,
        VIEW_CONTACT_WITHOUT_ID,
        VIEW_PERSON_WITHOUT_ID,
        VIEW_CONTACT,
        VIEW_CONTACT_LOOKUP,
        VIEW_CONTACT_LOOKUP_ID,
        VIEW_RAW_CONTACT,
        VIEW_LEGACY,
        VIEW_GROUP,
        QUICK_CONTACT_TESTS_ACTIVITY;
        QUICK_CONTACT_TESTS_ACTIVITY,
        LIST_DEFAULT,
        LIST_CONTACTS,
        LIST_ALL_CONTACTS,
        LIST_CONTACTS_WITH_PHONES,
        LIST_STARRED,
        LIST_FREQUENT,
        LIST_STREQUENT;

        public static ContactsIntent get(int ordinal) {
            return values()[ordinal];
@@ -275,6 +285,12 @@ public class AllIntentsActivity extends ListActivity
                startSearchResultActivity(intent);
                break;
            }
            case ACTION_SEARCH_GENERAL: {
                Intent intent = new Intent(Intent.ACTION_SEARCH);
                intent.putExtra(SearchManager.QUERY, "a");
                startSearchResultActivity(intent);
                break;
            }
            case SEARCH_SUGGESTION_CLICKED_CONTACT: {
                long contactId = findArbitraryContactWithPhoneNumber();
                if (contactId != -1) {
@@ -389,6 +405,12 @@ public class AllIntentsActivity extends ListActivity
                startActivity(new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI));
                break;
            }
            case VIEW_PERSON_WITHOUT_ID: {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setType("vnd.android.cursor.dir/person");
                startActivity(intent);
                break;
            }
            case VIEW_CONTACT_LOOKUP: {
                final long contactId = findArbitraryContactWithPhoneNumber();
                if (contactId != -1) {
@@ -449,6 +471,34 @@ public class AllIntentsActivity extends ListActivity
                startActivity(new Intent(this, QuickContactTestsActivity.class));
                break;
            }
            case LIST_DEFAULT: {
                startActivity(new Intent(UiIntentActions.LIST_DEFAULT));
                break;
            }
            case LIST_CONTACTS: {
                startActivity(new Intent(UiIntentActions.LIST_CONTACTS));
                break;
            }
            case LIST_ALL_CONTACTS: {
                startActivity(new Intent(UiIntentActions.LIST_ALL_CONTACTS_ACTION));
                break;
            }
            case LIST_CONTACTS_WITH_PHONES: {
                startActivity(new Intent(UiIntentActions.LIST_CONTACTS_WITH_PHONES_ACTION));
                break;
            }
            case LIST_STARRED: {
                startActivity(new Intent(UiIntentActions.LIST_STARRED_ACTION));
                break;
            }
            case LIST_FREQUENT: {
                startActivity(new Intent(UiIntentActions.LIST_FREQUENT_ACTION));
                break;
            }
            case LIST_STREQUENT: {
                startActivity(new Intent(UiIntentActions.LIST_STREQUENT_ACTION));
                break;
            }

            default: {
                Toast.makeText(this, "Sorry, we forgot to write this...", Toast.LENGTH_LONG).show();