diff options
author | Suresh Koleti <skolet@codeaurora.org> | 2016-07-13 17:28:53 +0530 |
---|---|---|
committer | Lalit Kansara <lkansara@codeaurora.org> | 2016-08-24 20:31:13 +0530 |
commit | 017d2e5d65bf66a3923b97054dc930eff42c9ca6 (patch) | |
tree | e16f5d94e7bbb4248ec7420bd441787e04807294 | |
parent | 31974f84087164d07af8fe6f6cf53596eb10229f (diff) | |
download | android_packages_apps_Dialer-staging/cm-14.0-caf.tar.gz android_packages_apps_Dialer-staging/cm-14.0-caf.tar.bz2 android_packages_apps_Dialer-staging/cm-14.0-caf.zip |
IMS: Refresh glowpad and heads up notiifcation for incoming callstaging/cm-14.0-caf
-- Refresh glowpad/heads up notification if incoming call type is
changed before call is connecting.
Change-Id: I8ca2852a548c8b9df2e48132b01ff9a3b46f2c09
CRs-Fixed: 1040592
-rw-r--r-- | InCallUI/src/com/android/incallui/AnswerPresenter.java | 12 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index d3c84bc15..24ec7b2d9 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -18,6 +18,7 @@ package com.android.incallui; import android.content.Context; import android.provider.Settings; +import android.telecom.VideoProfile; import android.telephony.SubscriptionManager; import com.android.dialer.compat.UserManagerCompat; @@ -52,6 +53,9 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> private Call mCall[] = new Call[InCallServiceImpl.sPhoneCount]; private final CallList mCalls = CallList.getInstance(); private boolean mHasTextMessages = false; + // Currently mVideoState is beeing used only for incoming calls. + // As there is only one incoming call allowed there is no need of array here. + private int mVideoState = VideoProfile.STATE_AUDIO_ONLY; /* QtiImsExtListenerBaseImpl instance to handle call deflection response */ private QtiImsExtListenerBaseImpl imsInterfaceListener = @@ -218,6 +222,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> Log.d(TAG, "Showing incoming for call id: " + mCallId[phoneId] + " " + this); if (showAnswerUi(true)) { + mVideoState = call.getVideoState(); final List<String> textMsgs = mCalls.getTextResponses(call.getId()); configureAnswerTargetsForSms(call, textMsgs); } @@ -290,11 +295,10 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> } mHasTextMessages = false; - } else if (!mHasTextMessages) { + } else if (!mHasTextMessages || (mVideoState != call.getVideoState())) { final List<String> textMsgs = mCalls.getTextResponses(call.getId()); - if (textMsgs != null) { - configureAnswerTargetsForSms(call, textMsgs); - } + mVideoState = call.getVideoState(); + configureAnswerTargetsForSms(call, textMsgs); } } diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 71fee5746..9504be146 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -42,6 +42,7 @@ import android.os.SystemClock; import android.telecom.Call.Details; import android.telecom.PhoneAccount; import android.telecom.TelecomManager; +import android.telecom.VideoProfile; import android.telephony.TelephonyManager; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; @@ -94,6 +95,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, private final DialerRingtoneManager mDialerRingtoneManager; private int mCurrentNotification = NOTIFICATION_NONE; private int mCallState = Call.State.INVALID; + private int mVideoState = VideoProfile.STATE_AUDIO_ONLY; private int mSavedIcon = 0; private String mSavedContent = null; private Bitmap mSavedLargeIcon; @@ -346,7 +348,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, } if (!checkForChangeAndSaveData(iconResId, content, largeIcon, contentTitle, callState, - notificationType, contactInfo.contactRingtoneUri)) { + call.getVideoState(), notificationType, contactInfo.contactRingtoneUri)) { return; } @@ -485,7 +487,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, * we do not issue a new notification for the exact same data. */ private boolean checkForChangeAndSaveData(int icon, String content, Bitmap largeIcon, - String contentTitle, int state, int notificationType, Uri ringtone) { + String contentTitle, int state, int videoState, int notificationType, Uri ringtone) { // The two are different: // if new title is not null, it should be different from saved version OR @@ -496,8 +498,9 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, // any change means we are definitely updating boolean retval = (mSavedIcon != icon) || !Objects.equals(mSavedContent, content) - || (mCallState != state) || (mSavedLargeIcon != largeIcon) - || contentTitleChanged || !Objects.equals(mRingtone, ringtone); + || (mCallState != state) || (mVideoState != videoState) + || (mSavedLargeIcon != largeIcon) || contentTitleChanged + || !Objects.equals(mRingtone, ringtone); // If we aren't showing a notification right now or the notification type is changing, // definitely do an update. @@ -511,6 +514,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, mSavedIcon = icon; mSavedContent = content; mCallState = state; + mVideoState = videoState; mSavedLargeIcon = largeIcon; mSavedContentTitle = contentTitle; mRingtone = ringtone; |