summaryrefslogtreecommitdiff
path: root/java/com/android
diff options
context:
space:
mode:
authorroldenburg <roldenburg@google.com>2017-10-31 12:51:06 -0700
committerzachh <zachh@google.com>2017-11-01 22:01:50 +0000
commitc14610de72a300f05b3a2674f0a459a9fc9204a9 (patch)
tree37a185e01f7d606837c2b4bb220a6d62dba3618a /java/com/android
parent650e7cc429c89e2471fc44abe8b0cc8a0e50158f (diff)
Update heads up notification based on video state
Refresh heads up notification to show only accept and reject options when incoming Video call is handed over to CS. Author: Suresh Koleti <skolet@codeaurora.org> Bug: 63157046 Test: StatusBarNotifierTest PiperOrigin-RevId: 174077146 Change-Id: Ic74d5a201392c6764ee33f1512bf528f86b80f69
Diffstat (limited to 'java/com/android')
-rw-r--r--java/com/android/incallui/StatusBarNotifier.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java
index db416d861..0a0aa5e61 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -53,6 +53,7 @@ import android.telecom.Call.Details;
import android.telecom.CallAudioState;
import android.telecom.PhoneAccount;
import android.telecom.TelecomManager;
+import android.telecom.VideoProfile;
import android.text.BidiFormatter;
import android.text.Spannable;
import android.text.SpannableString;
@@ -117,6 +118,7 @@ public class StatusBarNotifier
@Nullable private ContactsPreferences mContactsPreferences;
private int mCurrentNotification = NOTIFICATION_NONE;
private int mCallState = DialerCall.State.INVALID;
+ private int mVideoState = VideoProfile.STATE_AUDIO_ONLY;
private int mSavedIcon = 0;
private String mSavedContent = null;
private Bitmap mSavedLargeIcon;
@@ -312,6 +314,7 @@ public class StatusBarNotifier
largeIcon,
contentTitle,
callState,
+ call.getVideoState(),
notificationType,
contactInfo.contactRingtoneUri,
callAudioState)) {
@@ -474,6 +477,7 @@ public class StatusBarNotifier
Bitmap largeIcon,
String contentTitle,
int state,
+ int videoState,
int notificationType,
Uri ringtone,
CallAudioState callAudioState) {
@@ -485,14 +489,19 @@ public class StatusBarNotifier
(contentTitle != null && !contentTitle.equals(mSavedContentTitle))
|| (contentTitle == null && mSavedContentTitle != null);
- boolean largeIconChanged =
- mSavedLargeIcon == null ? largeIcon != null : !mSavedLargeIcon.sameAs(largeIcon);
+ boolean largeIconChanged;
+ if (mSavedLargeIcon == null) {
+ largeIconChanged = largeIcon != null;
+ } else {
+ largeIconChanged = largeIcon == null || !mSavedLargeIcon.sameAs(largeIcon);
+ }
// any change means we are definitely updating
boolean retval =
(mSavedIcon != icon)
|| !Objects.equals(mSavedContent, content)
|| (mCallState != state)
+ || (mVideoState != videoState)
|| largeIconChanged
|| contentTitleChanged
|| !Objects.equals(mRingtone, ringtone)
@@ -500,11 +509,12 @@ public class StatusBarNotifier
LogUtil.d(
"StatusBarNotifier.checkForChangeAndSaveData",
- "data changed: icon: %b, content: %b, state: %b, largeIcon: %b, title: %b, ringtone: %b, "
- + "audioState: %b, type: %b",
+ "data changed: icon: %b, content: %b, state: %b, videoState: %b, largeIcon: %b, title: %b,"
+ + "ringtone: %b, audioState: %b, type: %b",
(mSavedIcon != icon),
!Objects.equals(mSavedContent, content),
(mCallState != state),
+ (mVideoState != videoState),
largeIconChanged,
contentTitleChanged,
!Objects.equals(mRingtone, ringtone),
@@ -523,6 +533,7 @@ public class StatusBarNotifier
mSavedIcon = icon;
mSavedContent = content;
mCallState = state;
+ mVideoState = videoState;
mSavedLargeIcon = largeIcon;
mSavedContentTitle = contentTitle;
mRingtone = ringtone;