summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2015-11-11 10:21:22 -0800
committerHall Liu <hallliu@google.com>2015-11-11 11:41:20 -0800
commit762ed8f1b0716eda3e9bcace78ac8beb1f2cf5c6 (patch)
treebb8cda486c95040e5dd0f2d0105953e826e26acb
parente52b94ac7311ce253987d30e71508ed741abf804 (diff)
Fix incorrect in-call notification
There was an issue where the in-call notification would still show content appropriate for a ringing call. The in-call UI may be showing before Telecom has updated the call to the active state, so it may be the case that state can be Call.State.Incoming while notificationType is NOTIFICATION_IN_CALL. Since the contents of the notification are mostly dependent on state, this causes a mismatch between the contents of the notification and notificationType. Thus, a notification may be displayed that has the contents of a ringing call notification, but it will store NOTIFICATION_IN_CALL into mCurrentNotification. When the call gets updated to the active state, the previous notification will not be cleared, resulting in the incorrect behavior. Bug: 25598950 Change-Id: Ic0b3700587322b8d3cf0787a724577e58e0bb701
-rw-r--r--InCallUI/src/com/android/incallui/StatusBarNotifier.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index 79a0b2cac..12764fe7b 100644
--- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java
+++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
@@ -224,9 +224,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
final String contentTitle = getContentTitle(contactInfo, call);
final int notificationType;
- if ((state == Call.State.INCOMING
- || state == Call.State.CALL_WAITING) &&
- !InCallPresenter.getInstance().isShowingInCallUi()) {
+ if (state == Call.State.INCOMING || state == Call.State.CALL_WAITING) {
notificationType = NOTIFICATION_INCOMING_CALL;
} else {
notificationType = NOTIFICATION_IN_CALL;
@@ -251,7 +249,8 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
builder.setContentIntent(inCallPendingIntent);
// Set the intent as a full screen intent as well if a call is incoming
- if (notificationType == NOTIFICATION_INCOMING_CALL) {
+ if (notificationType == NOTIFICATION_INCOMING_CALL
+ && !InCallPresenter.getInstance().isShowingInCallUi()) {
configureFullScreenIntent(builder, inCallPendingIntent, call);
// Set the notification category for incoming calls
builder.setCategory(Notification.CATEGORY_CALL);