From 248a6687e8075e9730217be73c54ee4f95501a0e Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Tue, 1 Apr 2014 11:48:07 -0700 Subject: InCallUI - Use custom object to track Calls This is the first step in completely moving away from Telephony. This CL creates a custom Call object. Currently this is just a copy of the telephony Call object. I'll update various fields in individual CLs. This CL also deletes the old Telephony services. Bug: 13643568 Change-Id: Id1860a5df9706f2a7fddd40e70f0d693af7b04bd --- .../src/com/android/incallui/DialpadPresenter.java | 28 ++++++---------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'InCallUI/src/com/android/incallui/DialpadPresenter.java') diff --git a/InCallUI/src/com/android/incallui/DialpadPresenter.java b/InCallUI/src/com/android/incallui/DialpadPresenter.java index e426a6a18..53a21d090 100644 --- a/InCallUI/src/com/android/incallui/DialpadPresenter.java +++ b/InCallUI/src/com/android/incallui/DialpadPresenter.java @@ -19,8 +19,6 @@ package com.android.incallui; import android.telecomm.InCallAdapter; import android.telephony.PhoneNumberUtils; -import com.android.services.telephony.common.Call; - /** * Logic for call buttons. */ @@ -50,17 +48,12 @@ public class DialpadPresenter extends Presenter Log.d(this, "Processing dtmf key " + c); // if it is a valid key, then update the display and send the dtmf tone. if (PhoneNumberUtils.is12Key(c) && mCall != null) { - // Plays the tone through Telecomm - InCallAdapter telecommAdapter = InCallPresenter.getInstance().getTelecommAdapter(); - if (telecommAdapter != null) { - String callId = CallInfoTranslator.getTelecommCallId(mCall); - if (callId != null) { - Log.d(this, "updating display and sending dtmf tone for '" + c + "'"); - // Append this key to the "digits" widget. - getUi().appendDigitsToField(c); - telecommAdapter.playDtmfTone(callId, c); - } - } + Log.d(this, "updating display and sending dtmf tone for '" + c + "'"); + + // Append this key to the "digits" widget. + getUi().appendDigitsToField(c); + // Plays the tone through Telecomm. + TelecommAdapter.getInstance().playDtmfTone(mCall.getCallId(), c); } else { Log.d(this, "ignoring dtmf request for '" + c + "'"); } @@ -72,14 +65,7 @@ public class DialpadPresenter extends Presenter public void stopTone() { if (mCall != null) { Log.d(this, "stopping remote tone"); - InCallAdapter telecommAdapter = InCallPresenter.getInstance().getTelecommAdapter(); - if (telecommAdapter != null) { - String callId = CallInfoTranslator.getTelecommCallId(mCall); - if (callId != null) { - Log.d(this, "stopping remote tone: " + callId); - telecommAdapter.stopDtmfTone(callId); - } - } + TelecommAdapter.getInstance().stopDtmfTone(mCall.getCallId()); } } -- cgit v1.2.3