diff options
4 files changed, 13 insertions, 5 deletions
diff --git a/java/com/android/dialer/dialpadview/DialpadFragment.java b/java/com/android/dialer/dialpadview/DialpadFragment.java index 2745a71b1..c45c77689 100644 --- a/java/com/android/dialer/dialpadview/DialpadFragment.java +++ b/java/com/android/dialer/dialpadview/DialpadFragment.java @@ -470,11 +470,13 @@ public class DialpadFragment extends Fragment } if (shouldShowEmergencyCallWarning(getContext())) { - digitsHint.setText( - getContext().getString(R.string.dialpad_hint_emergency_calling_not_available)); + String hint = getContext().getString(R.string.dialpad_hint_emergency_calling_not_available); + digits.setContentDescription(hint); + digitsHint.setText(hint); digitsHint.setVisibility(View.VISIBLE); return; } + digits.setContentDescription(null); digitsHint.setVisibility(View.GONE); } diff --git a/java/com/android/dialer/dialpadview/res/values/strings.xml b/java/com/android/dialer/dialpadview/res/values/strings.xml index eb5c04f9c..afa02373a 100644 --- a/java/com/android/dialer/dialpadview/res/values/strings.xml +++ b/java/com/android/dialer/dialpadview/res/values/strings.xml @@ -97,9 +97,9 @@ Ignored if empty. --> <string name="config_prohibited_phone_number_regexp" translatable="false"></string> - <!-- Warning hint shown in the dialpad input field when emergency call (911, etc.) cannot be made. + <!-- Warning hint shown in the dialpad input field when emergency call (911, etc.) cannot be made over wifi. [CHAR_LIMIT=60] --> - <string name="dialpad_hint_emergency_calling_not_available">Emergency calling not available</string> + <string name="dialpad_hint_emergency_calling_not_available">Can\'t make emergency calls over WiFi</string> <!-- Dialog message which is shown when the user tries to make a phone call to prohibited phone numbers [CHAR LIMIT=NONE] --> diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index 56b392b19..16e7641ba 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -25,6 +25,7 @@ import android.support.annotation.VisibleForTesting; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; +import android.telephony.PhoneNumberUtils; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener; import com.android.dialer.callintent.CallIntentBuilder; @@ -65,6 +66,10 @@ public class CallingAccountSelector implements PreCallAction { if (builder.getPhoneAccountHandle() != null) { return false; } + if (PhoneNumberUtils.isEmergencyNumber(builder.getUri().getSchemeSpecificPart())) { + return false; + } + TelecomManager telecomManager = context.getSystemService(TelecomManager.class); List<PhoneAccountHandle> accounts = telecomManager.getCallCapablePhoneAccounts(); if (accounts.size() <= 1) { diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index a22a2581f..e30c70fec 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -485,7 +485,8 @@ public class CallButtonPresenter otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle()); boolean showSwapSim = - otherAccount != null + !call.isEmergencyCall() + && otherAccount != null && !call.isVoiceMailNumber() && DialerCall.State.isDialing(call.getState()) // Most devices cannot make calls on 2 SIMs at the same time. |