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:37:44 -0700 |
commit | 9e828a0093f4fc4589c98428263d05234ac2a303 (patch) | |
tree | b049d3f130c1f08cc20a1ea0db895391acc2e733 | |
parent | 191c15ac645ec649a04c4c0a5490f03cea690eb5 (diff) | |
download | android_packages_apps_ContactsCommon-9e828a0093f4fc4589c98428263d05234ac2a303.tar.gz android_packages_apps_ContactsCommon-9e828a0093f4fc4589c98428263d05234ac2a303.tar.bz2 android_packages_apps_ContactsCommon-9e828a0093f4fc4589c98428263d05234ac2a303.zip |
EmergencyContacts: Check if quickdial number is an emergency number
If the phone number is an emergency number, use ACTION_CALL_PRIVILEGED.
Change-Id: I348d2bff06eb5a9b8218ad9c8a5584ffa84e33f8
-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 ea2d8539..751b196b 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(); |