From 77e58350baa664c832aca01d963a0ecc76e7585f Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 17 Jul 2014 15:52:19 -0700 Subject: Simplify call-button-presenter update UI code. I consolidated a lot of the if/then branches into booleans. This means that buttons will be updated more frequently, but I think it has the positive effect of making it easier to read, and is considerably more concise. I'm considering moving this code into a helper to address updates for audio calls (vs. video calls), and thought to clean this up on its own before doing that. Bug: 16014280 Change-Id: I5ef53ce654091f033936233b7368b54b45cc3542 --- .../com/android/incallui/CallButtonPresenter.java | 134 ++++++++------------- 1 file changed, 51 insertions(+), 83 deletions(-) diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index f49637e92..7867f4304 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -17,7 +17,6 @@ package com.android.incallui; import android.content.Context; -import android.graphics.drawable.Drawable; import android.telecomm.CallCapabilities; import com.android.contacts.common.util.PhoneNumberHelper; @@ -26,7 +25,6 @@ import com.android.incallui.AudioModeProvider.AudioModeListener; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; -import com.android.incalluibind.ServiceFactory; import com.android.services.telephony.common.AudioMode; import android.app.Fragment; @@ -59,8 +57,6 @@ public class CallButtonPresenter extends Presenter