diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-09 21:12:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-09 21:12:24 +0000 |
commit | ca19e2a139c6f3ffb279718efb2c540c0a8eb5e8 (patch) | |
tree | 94616583239ba75d6cfc648ad7db2bb48fd9c082 /java/com/android/incallui | |
parent | ece72f3f20ec102c845d5e849a6e154b5131b203 (diff) | |
parent | f4ba34589194d4609cfeed64d53d815a11a1d5d1 (diff) |
Merge "Handle android.telephony.event.EVENT_CALL_FORWARDED."
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; |