diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index b66f41791..f3c597056 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -67,7 +67,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private ContactCacheEntry mSecondaryContactInfo; private CallTimer mCallTimer; private Context mContext; - private TelecomManager mTelecomManager; public static class ContactLookupCallback implements ContactInfoCacheCallback { private final WeakReference<CallCardPresenter> mCallCardPresenter; @@ -280,8 +279,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // number directly from the telephony layer). PhoneAccountHandle accountHandle = mPrimary.getAccountHandle(); if (accountHandle != null) { - TelecomManager mgr = - (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); + TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager(); PhoneAccount account = mgr.getPhoneAccount(accountHandle); if (account != null) { return getNumberFromHandle(account.getSubscriptionAddress()); @@ -558,7 +556,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> if (accountHandle == null) { return null; } - return getTelecomManager().getPhoneAccount(accountHandle); + return InCallPresenter.getInstance().getTelecomManager().getPhoneAccount(accountHandle); } /** @@ -576,8 +574,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> */ private String getCallProviderLabel(Call call) { PhoneAccount account = getAccountForCall(call); + TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager(); if (account != null && !TextUtils.isEmpty(account.getLabel()) - && getTelecomManager().hasMultipleCallCapableAccounts()) { + && mgr.hasMultipleCallCapableAccounts()) { return account.getLabel().toString(); } return null; @@ -693,14 +692,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> ui.setCallCardVisible(!isFullScreenVideo); } - private TelecomManager getTelecomManager() { - if (mTelecomManager == null) { - mTelecomManager = - (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); - } - return mTelecomManager; - } - private String getConferenceString(Call call) { boolean isGenericConference = call.can(PhoneCapabilities.GENERIC_CONFERENCE); Log.v(this, "getConferenceString: " + isGenericConference); |