From 6dfd1963ecc89ecb2c76793ab40af26e35654285 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Sat, 24 Jan 2015 19:58:51 -0800 Subject: Hide emergency callback number when slot2 SIM is default. Because emergency calls are always made from the SIM in slot1, when slot2 has the SIM set for default outgoing call, the InCallUI currently thinks the emergency callback number is different from the number being called from (the code only uses the default number). The fix is to check the line 1 number of the phone account being used instead of the default phone account. Bug: 19087382 Change-Id: I90a096f63493affea979689c7ad188eec7109c08 --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 0d04f48f8..cb378a687 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -340,9 +340,8 @@ public class CallCardPresenter extends Presenter } } - TelephonyManager telephonyManager = - (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); - String simNumber = telephonyManager.getLine1Number(); + TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager(); + String simNumber = mgr.getLine1Number(mPrimary.getAccountHandle()); if (PhoneNumberUtils.compare(callbackNumber, simNumber)) { Log.d(this, "Numbers are the same; not showing the callback number"); callbackNumber = null; -- cgit v1.2.3