diff options
| author | Stephen Bird <sbird@cyngn.com> | 2015-07-23 18:58:24 -0700 |
|---|---|---|
| committer | Stephen Bird <sbird@cyngn.com> | 2015-07-27 17:38:20 -0700 |
| commit | 6a632461e86865e72dfb4ed14259e8ee7c45d68d (patch) | |
| tree | 3ab8cf62b34106c37c6ec8a45f7e4c136a66a15a | |
| parent | 3a66f7fae90ea3eb22fe7d404ccad5ba0705506c (diff) | |
| download | packages_apps_ContactsCommon-caf/cm-12.0.tar.gz packages_apps_ContactsCommon-caf/cm-12.0.tar.bz2 packages_apps_ContactsCommon-caf/cm-12.0.zip | |
EmergencyContacts: Check if quickdial number is an emergency numbercaf/cm-12.0
If the phone number is an emergency number, use ACTION_CALL_PRIVILEGED.
Change-Id: I348d2bff06eb5a9b8218ad9c8a5584ffa84e33f8
(cherry picked from commit 9e828a0093f4fc4589c98428263d05234ac2a303)
(cherry picked from commit 60ca51a3cb2736989e59be84b45c2ef21ed60eaf)
| -rwxr-xr-x | src/com/android/contacts/common/list/ContactListAdapter.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/list/ContactListAdapter.java b/src/com/android/contacts/common/list/ContactListAdapter.java index b987e4d8..4ee891bb 100755 --- a/src/com/android/contacts/common/list/ContactListAdapter.java +++ b/src/com/android/contacts/common/list/ContactListAdapter.java @@ -25,6 +25,7 @@ import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Directory; import android.provider.ContactsContract.RawContacts; import android.provider.ContactsContract.SearchSnippets; +import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -243,7 +244,12 @@ public abstract class ContactListAdapter extends ContactEntryListAdapter { if (cursor.moveToNext()) { String phoneNumber = cursor.getString(0); Uri uri = Uri.parse("tel: " + phoneNumber); - Intent intent = new Intent(Intent.ACTION_CALL, uri); + Intent intent; + if (PhoneNumberUtils.isEmergencyNumber(phoneNumber)) { + intent = new Intent(Intent.ACTION_CALL_EMERGENCY, uri); + } else { + intent = new Intent(Intent.ACTION_CALL, uri); + } mContext.startActivity(intent); } cursor.close(); |
