summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-09-18 14:32:09 -0700
committerEric Erfanian <erfanian@google.com>2017-09-18 15:46:41 -0700
commit339b4f3b53894325ba68bc49c7208c20f3ff09ad (patch)
tree34b2e2bdfd40405187defff88722b009560c4531
parentdf06af5411002174c6aeb653ca7790f202284de6 (diff)
Always show line1 number in emergency call.
The subcription number might be different than the line1 number (sim number), which could be confusion to user during emergency call when it's not same as the sim number the user knows of. Bug: 65685277 Test: manual PiperOrigin-RevId: 169147724 Change-Id: I2f89559d10a188b13937e80528b756cc9b11a02e
-rw-r--r--java/com/android/incallui/call/DialerCall.java36
1 files changed, 2 insertions, 34 deletions
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index 1a998096a..9f8992575 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -38,7 +38,6 @@ import android.telecom.PhoneAccountHandle;
import android.telecom.StatusHints;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
-import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import com.android.contacts.common.compat.CallCompat;
import com.android.contacts.common.compat.telecom.TelecomManagerCompat;
@@ -1156,26 +1155,10 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
boolean showCallbackNumber = hasProperty(Details.PROPERTY_EMERGENCY_CALLBACK_MODE);
if (isEmergencyCall() || showCallbackNumber) {
- callbackNumber = getSubscriptionNumber();
- } else {
- StatusHints statusHints = getTelecomCall().getDetails().getStatusHints();
- if (statusHints != null) {
- Bundle extras = statusHints.getExtras();
- if (extras != null) {
- callbackNumber = extras.getString(TelecomManager.EXTRA_CALL_BACK_NUMBER);
- }
- }
+ callbackNumber =
+ mContext.getSystemService(TelecomManager.class).getLine1Number(getAccountHandle());
}
- String simNumber =
- mContext.getSystemService(TelecomManager.class).getLine1Number(getAccountHandle());
- if (!showCallbackNumber && PhoneNumberUtils.compare(callbackNumber, simNumber)) {
- LogUtil.v(
- "DialerCall.getCallbackNumber",
- "numbers are the same (and callback number is not being forced to show);"
- + " not showing the callback number");
- callbackNumber = "";
- }
if (callbackNumber == null) {
callbackNumber = "";
}
@@ -1183,21 +1166,6 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
return callbackNumber;
}
- private String getSubscriptionNumber() {
- // If it's an emergency call, and they're not populating the callback number,
- // then try to fall back to the phone sub info (to hopefully get the SIM's
- // number directly from the telephony layer).
- PhoneAccountHandle accountHandle = getAccountHandle();
- if (accountHandle != null) {
- PhoneAccount account =
- mContext.getSystemService(TelecomManager.class).getPhoneAccount(accountHandle);
- if (account != null) {
- return getNumberFromHandle(account.getSubscriptionAddress());
- }
- }
- return null;
- }
-
@Override
public void onVideoTechStateChanged() {
update();