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

Commit dbb207ac authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Gerrit Code Review
Browse files

SmartDialer: show quick contact on long press

Instead of displaying the disambiguation dialog, show quick contact
instead which also allows the user to decide which number to call as
well as perform other operations such as editing or messaging.

This is useful because it's easier to search for contacts via T9
compared to using the QWERTY keyboard.

Change-Id: I81c21e58fb1090157a062d79600287d7e1e7c8d6
parent dc281e19
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@ import android.provider.Contacts.Intents.Insert;
import android.provider.Contacts.People;
import android.provider.Contacts.People;
import android.provider.Contacts.Phones;
import android.provider.Contacts.Phones;
import android.provider.Contacts.PhonesColumns;
import android.provider.Contacts.PhonesColumns;
import android.provider.ContactsContract;
import android.provider.Settings;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneStateListener;
import android.telephony.PhoneStateListener;
@@ -1745,10 +1746,12 @@ public class DialpadFragment extends Fragment
            final SmartDialEntry entry = (SmartDialEntry) view.getTag();
            final SmartDialEntry entry = (SmartDialEntry) view.getTag();
            if (entry == null) return false; // just in case.
            if (entry == null) return false; // just in case.
            mClearDigitsOnStop = true;
            mClearDigitsOnStop = true;
            // Show the phone number disambiguation dialog without using the primary
            // Show quick contact dialog so the user can decide which number
            // phone number so that the user can decide which number to call
            // to call or perform other operations
            PhoneNumberInteraction.startInteractionForPhoneCall(
            Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
                    (TransactionSafeActivity) getActivity(), entry.contactUri, false);
                    getActivity(), view, entry.contactUri,
                    ContactsContract.QuickContact.MODE_LARGE, null);
            startActivity(intent);
            return true;
            return true;
        }
        }
    }
    }