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

Commit 2dd99177 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Removing code to handle "call" action from QSB suggestion

- Contacts provider no longer generates suggestions with
SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED or
SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED.
(Removed in I0c56f638e347d101468e22d8fb2417552891eaa9)

- Also removed "ACTION_SEARCH" with "call".
Apparently it hasn't been working.

Bug 6889515

Change-Id: I58e95dc6fd84bc14f1dc2b66e72885ced7fe9081
parent 96464512
Loading
Loading
Loading
Loading
+13 −38
Original line number Diff line number Diff line
@@ -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;
@@ -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)) {
@@ -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)
@@ -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) {