diff options
Diffstat (limited to 'InCallUI/src')
3 files changed, 7 insertions, 15 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index 8aa8615da..84e63048d 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -19,6 +19,7 @@ package com.android.incallui; import android.telecom.PhoneCapabilities; import android.app.KeyguardManager; import android.content.Context; +import android.telecom.TelecomManager; import java.util.List; @@ -159,6 +160,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> public void onText() { if (getUi() != null) { + InCallPresenter.getInstance().getTelecomManager().silenceRinger(); getUi().showMessageDialog(); } } 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); diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 4432018f8..9461e64f0 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -1194,7 +1194,7 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { /** * @return An instance of TelecomManager. */ - private TelecomManager getTelecomManager() { + public TelecomManager getTelecomManager() { if (mTelecomManager == null) { mTelecomManager = (TelecomManager) mInCallActivity.getSystemService(Context.TELECOM_SERVICE); @@ -1202,7 +1202,6 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { return mTelecomManager; } - /** * Private constructor. Must use getInstance() to get this singleton. */ |