diff options
Diffstat (limited to 'java/com/android/incallui')
-rw-r--r-- | java/com/android/incallui/CallCardPresenter.java | 2 | ||||
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 67473d75e..eed076d3d 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -484,7 +484,7 @@ public class CallCardPresenter isWorkCall, isAttemptingHdAudioCall, isHdAudioCall, - !TextUtils.isEmpty(primary.getLastForwardedNumber()), + !TextUtils.isEmpty(primary.getLastForwardedNumber()) || primary.isCallForwarded(), shouldShowContactPhoto, primary.getConnectTimeMillis(), primary.isVoiceMailNumber(), diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 543cc3f07..5d71d0aac 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -29,6 +29,7 @@ import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import android.support.v4.os.BuildCompat; import android.telecom.Call; import android.telecom.Call.Details; import android.telecom.CallAudioState; @@ -140,6 +141,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa private String childNumber; private String lastForwardedNumber; + private boolean isCallForwarded; private String callSubject; private PhoneAccountHandle phoneAccountHandle; @CallHistoryStatus private int callHistoryStatus = CALL_HISTORY_STATUS_UNKNOWN; @@ -295,6 +297,13 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa LogUtil.i("DialerCall.onConnectionEvent", "merge complete"); isMergeInProcess = false; break; + case TelephonyManagerCompat.EVENT_CALL_FORWARDED: + // Only handle this event for P+ since it's unreliable pre-P. + if (BuildCompat.isAtLeastP()) { + isCallForwarded = true; + update(); + } + break; default: break; } @@ -800,6 +809,10 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return lastForwardedNumber; } + public boolean isCallForwarded() { + return isCallForwarded; + } + /** @return The call subject, or {@code null} if none specified. */ public String getCallSubject() { return callSubject; |