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
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index 79a0b2c..12764fe 100644
--- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java
+++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
@@ -224,9 +224,7 @@
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 @@
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);