summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2013-08-29 02:43:56 -0700
committerSantos Cordon <santoscordon@google.com>2013-08-29 02:43:56 -0700
commit21017574bf99db38d739ae5dd81711a56cd1756c (patch)
treebd4d95a9c8a7a6b423e1d9399e77242d2201f063
parentfacff288cfbdfcfd9281a64fa05a78532acf3d90 (diff)
Allow new call waiting calls to pop up when not in foreground.
Added some additional debug logging. Allow full-screen startup sequence to happen with any transition to IN_CALL state, not just from a HIDDEN state. (e.g., from IN_CALL -> INCOMING) And for the grand finale, uncomment the code that would have made this work from the beginning. :P bug:10396126 Change-Id: Id34805941b75b28d4876153bb1bf0305142fc4cd
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java8
-rw-r--r--InCallUI/src/com/android/incallui/StatusBarNotifier.java13
2 files changed, 11 insertions, 10 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index cc3dcb2c1..b61e05c4e 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -258,7 +258,7 @@ public class InCallPresenter implements CallList.Listener {
* the UI needs to be started or finished depending on the new state and does it.
*/
private InCallState startOrFinishUi(InCallState newState) {
- Log.d(this, "startOrFinishUi: " + newState.toString());
+ Log.d(this, "startOrFinishUi: " + mInCallState + " -> " + newState);
// TODO(klp): Consider a proper state machine implementation
@@ -291,10 +291,8 @@ public class InCallPresenter implements CallList.Listener {
// [ AND NOW YOU'RE IN THE CALL. voila! ]
//
// Our app is started using a fullScreen notification. We need to do this whenever
- // we get an incoming call or if this is the first time we are displaying (the previous
- // state was HIDDEN).
- final boolean startStartupSequence = (InCallState.INCOMING == newState ||
- InCallState.HIDDEN == mInCallState);
+ // we get an incoming call.
+ final boolean startStartupSequence = (InCallState.INCOMING == newState);
// A new outgoing call indicates that the user just now dialed a number and when that
// happens we need to display the screen immediateley.
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index f8289c90b..b1af4f0e3 100644
--- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java
+++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
@@ -69,6 +69,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
*/
@Override
public void onStateChange(InCallState state, CallList callList) {
+ Log.d(this, "onStateChange");
updateNotification(state, callList);
}
@@ -102,6 +103,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
* (Use updateNotificationAndLaunchIncomingCallUi() for that.)
*/
public void updateNotification(InCallState state, CallList callList) {
+ Log.d(this, "updateNotification");
// allowFullScreenIntent=false means *don't* allow the incoming
// call UI to be launched.
updateInCallNotification(false, state, callList);
@@ -176,6 +178,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
final Call call = getCallToShow(callList);
if (shouldSuppressNotification(state, call)) {
+ Log.d(this, "Suppressing notification");
cancelInCall();
return;
}
@@ -222,7 +225,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
// Set the intent as a full screen intent as well if requested
if (allowFullScreenIntent) {
- configureFullScreenIntent(builder, inCallPendingIntent);
+ configureFullScreenIntent(builder, inCallPendingIntent, call);
}
// set the content
@@ -383,7 +386,8 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
/**
* Adds fullscreen intent to the builder.
*/
- private void configureFullScreenIntent(Notification.Builder builder, PendingIntent intent) {
+ private void configureFullScreenIntent(Notification.Builder builder, PendingIntent intent,
+ Call call) {
// Ok, we actually want to launch the incoming call
// UI at this point (in addition to simply posting a notification
// to the status bar). Setting fullScreenIntent will cause
@@ -413,14 +417,13 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
// TODO: there should be a cleaner way of avoiding this
// problem (see discussion in bug 3184149.)
- // TODO(klp): reenable this for klp
- /*if (incomingCall.getState() == Call.State.CALL_WAITING) {
+ if (call.getState() == Call.State.CALL_WAITING) {
Log.i(this, "updateInCallNotification: call-waiting! force relaunch...");
// Cancel the IN_CALL_NOTIFICATION immediately before
// (re)posting it; this seems to force the
// NotificationManager to launch the fullScreenIntent.
mNotificationManager.cancel(IN_CALL_NOTIFICATION);
- }*/
+ }
}
private Notification.Builder getNotificationBuilder() {