diff options
author | Santos Cordon <santoscordon@google.com> | 2013-08-09 16:35:23 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-08-09 17:48:47 -0700 |
commit | 250f3792c16e15968b96fde2e52c434013b44d35 (patch) | |
tree | ac0737c97366de7711e97861e1fbf6a10320690d /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | 7030437c3ff5ec76aa4f7dd44cde1fdf71434527 (diff) |
Adding suppression behavior for in-call notification.
This suppresses the notificaiton if the call isn't active of outgoing.
We also suppress the notification if the user is currently in the
in-call screen.
...except during incoming (ringing) calls...we always show it for ringing calls.
Change-Id: Ib75545339376c62c975c390298ef9567d733b8e3
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 8ae37bd21..c76f08ad0 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -34,6 +34,7 @@ public class InCallActivity extends Activity { private CallCardFragment mCallCardFragment; private AnswerFragment mAnswerFragment; private DialpadFragment mDialpadFragment; + private boolean mIsForegroundActivity; @Override protected void onCreate(Bundle icicle) { @@ -62,6 +63,9 @@ public class InCallActivity extends Activity { protected void onResume() { Logger.d(this, "onResume()..."); super.onResume(); + + mIsForegroundActivity = true; + InCallPresenter.getInstance().onUiShowing(true); } // onPause is guaranteed to be called when the InCallActivity goes @@ -70,6 +74,9 @@ public class InCallActivity extends Activity { protected void onPause() { Logger.d(this, "onPause()..."); super.onPause(); + + mIsForegroundActivity = false; + InCallPresenter.getInstance().onUiShowing(false); } @Override @@ -85,6 +92,13 @@ public class InCallActivity extends Activity { } /** + * Returns true when theActivity is in foreground (between onResume and onPause). + */ + /* package */ boolean isForegroundActivity() { + return mIsForegroundActivity; + } + + /** * Dismisses the in-call screen. * * We never *really* finish() the InCallActivity, since we don't want to get destroyed and then |