summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-11-01 23:37:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-11-01 23:37:30 +0000
commiteceebff226c0df860bc44f3c6f524784839462c5 (patch)
tree37a185e01f7d606837c2b4bb220a6d62dba3618a
parentcda1d9230bf7d81c4f35db6be9a152cd95e43a5c (diff)
parentc14610de72a300f05b3a2674f0a459a9fc9204a9 (diff)
Merge "Update heads up notification based on video state"
-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;