diff options
author | Christine Chen <christinech@google.com> | 2013-09-11 01:28:11 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-11 01:28:15 +0000 |
commit | 0b99c0e28fd45bfd542c1e1d1bd6e9390008de69 (patch) | |
tree | bd9993e5b81f63b390798c8f8e530d4375281786 | |
parent | 46f4867780526b9518e6c42a530535ece7ccec7c (diff) | |
parent | f05f341d8bf54a1052129a741cb6e2b4c2ff8ac8 (diff) |
Merge "Adds onUiReady and onUiUnready to the presenter" into klp-dev
3 files changed, 18 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index e8bcc99c1..e820929a0 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -56,7 +56,6 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> if (mCallId != Call.INVALID_CALL_ID) { CallList.getInstance().removeCallUpdateListener(mCallId, this); } - } @Override diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index f14d851a7..ec8e84471 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -50,13 +50,12 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto @Override public void onUiUnready(CallButtonUi ui) { + super.onUiUnready(ui); + InCallPresenter.getInstance().removeListener(this); AudioModeProvider.getInstance().removeListener(this); mProximitySensor = null; - - // set Ui to null, so should go last - super.onUiUnready(ui); } @Override diff --git a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java index ccda4a579..041614db6 100644 --- a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java +++ b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java @@ -39,8 +39,24 @@ public class ConferenceManagerPresenter private Context mContext; @Override + public void onUiReady(ConferenceManagerUi ui) { + super.onUiReady(ui); + + // register for call state changes last + InCallPresenter.getInstance().addListener(this); + } + + @Override + public void onUiUnready(ConferenceManagerUi ui) { + super.onUiUnready(ui); + + InCallPresenter.getInstance().removeListener(this); + } + + @Override public void onStateChange(InCallState state, CallList callList) { if (getUi().isFragmentVisible()) { + Log.v(this, "onStateChange" + state); if (state == InCallState.INCALL && callList.getActiveOrBackgroundCall() != null && callList.getActiveOrBackgroundCall().isConferenceCall()) { Log.v(this, "Number of existing calls is " + |