From 1b96ca56fda7caf341fe8a7a228151c68587b4de Mon Sep 17 00:00:00 2001 From: wangqi Date: Wed, 13 Jun 2018 15:05:29 -0700 Subject: Fix bug that RTT call is conferenceable with voice call. Bug: 109763648 Test: manual PiperOrigin-RevId: 200460856 Change-Id: I1ce385490e6ce6167f56dc32c35a931292e0d03f --- java/com/android/incallui/call/DialerCall.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 904a5a833..585421eab 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -977,13 +977,23 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } /** Checks if the call supports the given set of capabilities supplied as a bit mask. */ + @TargetApi(28) public boolean can(int capabilities) { int supportedCapabilities = telecomCall.getDetails().getCallCapabilities(); if ((capabilities & Call.Details.CAPABILITY_MERGE_CONFERENCE) != 0) { + boolean hasConferenceableCall = false; + // RTT call is not conferenceable, it's a bug (a bug) in Telecom and we work around it + // here before it's fixed in Telecom. + for (Call call : telecomCall.getConferenceableCalls()) { + if (!(BuildCompat.isAtLeastP() && call.isRttActive())) { + hasConferenceableCall = true; + break; + } + } // We allow you to merge if the capabilities allow it or if it is a call with // conferenceable calls. - if (telecomCall.getConferenceableCalls().isEmpty() + if (!hasConferenceableCall && ((Call.Details.CAPABILITY_MERGE_CONFERENCE & supportedCapabilities) == 0)) { // Cannot merge calls if there are no calls to merge with. return false; -- cgit v1.2.3