From 1b60e8c70bdcbf07c3efab310790134ecf81d4fd Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Mon, 5 Aug 2013 09:42:04 -0700 Subject: Notifications in Phone (part 1) - Added StatusBarNotification class to handle notifications - StatusBarNotification has tons of copied comments from NotificationMgr.java. Also has minimal code to make the notification pop up (without call-specific data). - Moved the UI start-up code from InCallPresenter to StatusBarNotification. Incoming phone calls need to display an alert above immersive (fullscreen) foreground activities and the way to do that is through notifications. The old phone app did the same thing...finally bringing over that functionality. Change-Id: I3324503e0d7bb1de00d8e7fab72d4b40519491dd --- InCallUI/src/com/android/incallui/InCallActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java') diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 89450c534..9eb54ee5e 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -101,6 +101,8 @@ public class InCallActivity extends Activity { @Override public void finish() { Logger.d(this, "finish()..."); + tearDownPresenters(); + super.finish(); // TODO(klp): Actually finish the activity for now. Revisit performance implications of @@ -220,6 +222,14 @@ public class InCallActivity extends Activity { mainPresenter.setActivity(this); } + private void tearDownPresenters() { + InCallPresenter mainPresenter = InCallPresenter.getInstance(); + + mainPresenter.removeListener(mCallButtonFragment.getPresenter()); + mainPresenter.removeListener(mCallCardFragment.getPresenter()); + mainPresenter.removeListener(mAnswerFragment.getPresenter()); + } + private void toast(String text) { final Toast toast = Toast.makeText(this, text, Toast.LENGTH_SHORT); -- cgit v1.2.3