diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-24 19:17:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-24 19:17:34 +0000 |
commit | c4d4925c6617edae27c738e736a64ed75b31129f (patch) | |
tree | e701213640c084ab4537ba981ae1ed01ae09b2e3 | |
parent | 203d50977f7982a81f5ef3c325e9b3b796d9a418 (diff) | |
parent | ea3b162a8d99fb08654c1b8ca69f47ca7a733649 (diff) |
Merge changes I54dbbaad,If0adf10a
* changes:
Don't show SIM selection and swap SIM for emergency calls.
Update emergency wifi calling string Set content description for dialpad hint
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. |