diff options
author | Santos Cordon <santoscordon@google.com> | 2013-09-15 17:33:09 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-09-15 17:35:09 -0700 |
commit | 1c22bde38cd15919e91afb0f12c558aa66f0bc91 (patch) | |
tree | be065425fd7d1e780be8f5bb797db05073e96a0f | |
parent | e91cacacb3dd7ddab7ee31f83d357a6cf14d3e1f (diff) |
CallCardPresenter should listen for Call Waiting
Regression from recent change to only update UI with incoming calls
using the onIncomingCall callback. The CallCardPresenter wasn't
listening for that specific change so call-waiting calls were not
displaying "incoming call" label.
Change-Id: I6a732585509c1e27e7ecf5805cb17ea8e7f043ed
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 11 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallPresenter.java | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index b055a58a1..e1e3bd464 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -30,6 +30,7 @@ import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.ContactInfoCache.ContactInfoCacheCallback; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; +import com.android.incallui.InCallPresenter.IncomingCallListener; import com.android.services.telephony.common.AudioMode; import com.android.services.telephony.common.Call; import com.android.services.telephony.common.CallIdentification; @@ -41,7 +42,7 @@ import com.google.common.base.Preconditions; * This class listens for changes to InCallState and passes it along to the fragment. */ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> - implements InCallStateListener, AudioModeListener { + implements InCallStateListener, AudioModeListener, IncomingCallListener { private static final String TAG = CallCardPresenter.class.getSimpleName(); private static final long CALL_TIME_UPDATE_INTERVAL = 1000; // in milliseconds @@ -98,6 +99,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // Register for call state changes last InCallPresenter.getInstance().addListener(this); + InCallPresenter.getInstance().addIncomingCallListener(this); } @Override @@ -106,6 +108,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // stop getting call state changes InCallPresenter.getInstance().removeListener(this); + InCallPresenter.getInstance().removeIncomingCallListener(this); AudioModeProvider.getInstance().removeListener(this); @@ -115,6 +118,12 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } @Override + public void onIncomingCall(InCallState state, Call call) { + // same logic should happen as with onStateChange() + onStateChange(state, CallList.getInstance()); + } + + @Override public void onStateChange(InCallState state, CallList callList) { Log.d(this, "onStateChange() " + state); final CallCardUi ui = getUi(); diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 47b0871ae..cecc790f3 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -197,7 +197,7 @@ public class InCallPresenter implements CallList.Listener { mInCallState = newState; for (IncomingCallListener listener : mIncomingCallListeners) { - listener.onIncomingCall(call); + listener.onIncomingCall(mInCallState, call); } } @@ -500,6 +500,6 @@ public class InCallPresenter implements CallList.Listener { } public interface IncomingCallListener { - public void onIncomingCall(Call call); + public void onIncomingCall(InCallState state, Call call); } } |