From 28d90d7b5800f19194bade2a29cf1134e5a17f41 Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Sat, 19 Jul 2014 13:21:49 -0700 Subject: InCallService to inherit directly from Service. (2/2) Bug: 16416927 Change-Id: I31584556c79e49132c628a0f8f25c372eb4e9b3c --- .../com/android/incallui/InCallServiceImpl.java | 53 ++++++++++------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/InCallServiceImpl.java b/InCallUI/src/com/android/incallui/InCallServiceImpl.java index c69571a67..f19220199 100644 --- a/InCallUI/src/com/android/incallui/InCallServiceImpl.java +++ b/InCallUI/src/com/android/incallui/InCallServiceImpl.java @@ -28,38 +28,31 @@ import android.telecomm.Phone; * dialing (outgoing), and active calls. When the last call is disconnected, Telecomm will unbind to * the service triggering InCallActivity (via CallList) to finish soon after. */ -public class InCallServiceImpl extends Service { +public class InCallServiceImpl extends InCallService { - private final InCallService mInCallServiceInstance = new InCallService() { - @Override - public void onPhoneCreated(Phone phone) { - Log.v(this, "onPhoneCreated"); - CallList.getInstance().setPhone(phone); - AudioModeProvider.getInstance().setPhone(phone); - TelecommAdapter.getInstance().setPhone(phone); - InCallPresenter.getInstance().setPhone(phone); - InCallPresenter.getInstance().setUp( - getApplicationContext(), - CallList.getInstance(), - AudioModeProvider.getInstance()); - TelecommAdapter.getInstance().setContext(InCallServiceImpl.this); - } - - @Override - public void onPhoneDestroyed(Phone phone) { - Log.v(this, "onPhoneDestroyed"); - // Tear down the InCall system - CallList.getInstance().clearPhone(); - AudioModeProvider.getInstance().clearPhone(); - TelecommAdapter.getInstance().clearPhone(); - TelecommAdapter.getInstance().setContext(null); - CallList.getInstance().clearOnDisconnect(); - InCallPresenter.getInstance().tearDown(); - } - }; + @Override + public void onPhoneCreated(Phone phone) { + Log.v(this, "onPhoneCreated"); + CallList.getInstance().setPhone(phone); + AudioModeProvider.getInstance().setPhone(phone); + TelecommAdapter.getInstance().setPhone(phone); + InCallPresenter.getInstance().setPhone(phone); + InCallPresenter.getInstance().setUp( + getApplicationContext(), + CallList.getInstance(), + AudioModeProvider.getInstance()); + TelecommAdapter.getInstance().setContext(InCallServiceImpl.this); + } @Override - public IBinder onBind(Intent intent) { - return mInCallServiceInstance.getBinder(); + public void onPhoneDestroyed(Phone phone) { + Log.v(this, "onPhoneDestroyed"); + // Tear down the InCall system + CallList.getInstance().clearPhone(); + AudioModeProvider.getInstance().clearPhone(); + TelecommAdapter.getInstance().clearPhone(); + TelecommAdapter.getInstance().setContext(null); + CallList.getInstance().clearOnDisconnect(); + InCallPresenter.getInstance().tearDown(); } } -- cgit v1.2.3