diff options
author | Santos Cordon <santoscordon@google.com> | 2013-09-16 01:25:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-16 01:25:04 +0000 |
commit | b1a2b9be59a1a3a2f283380d67ce3b945ae74e8e (patch) | |
tree | 70c486c481dd2e38f167ec32a9b97e5b27de5e06 | |
parent | be55a98f79c4721af7e4b1bd6854271d19f9333f (diff) | |
parent | 1c22bde38cd15919e91afb0f12c558aa66f0bc91 (diff) |
Merge "CallCardPresenter should listen for Call Waiting" into klp-dev
-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 82da5b8f7..d49859a36 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -207,7 +207,7 @@ public class InCallPresenter implements CallList.Listener { mInCallState = newState; for (IncomingCallListener listener : mIncomingCallListeners) { - listener.onIncomingCall(call); + listener.onIncomingCall(mInCallState, call); } } @@ -516,6 +516,6 @@ public class InCallPresenter implements CallList.Listener { } public interface IncomingCallListener { - public void onIncomingCall(Call call); + public void onIncomingCall(InCallState state, Call call); } } |