summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2018-06-06 21:19:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-06-06 21:19:04 +0000
commitb62aa315d1d9d27c716964930205ed0681e8997b (patch)
tree630c0345d3805bbf2769bf073d2b003dbd2afa65
parentb044b885cf51ef350745e9178e763c0b4db8a86a (diff)
parentf2e08b4c2c2c9cfa150cd9e4bb416d89e38b7b4e (diff)
Merge "Ensure self-managed calls use voip audio mode."
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 2fdbc7194af8..4045eea4db02 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -1531,6 +1531,14 @@ public abstract class ConnectionService extends Service {
new DisconnectCause(DisconnectCause.ERROR, "IMPL_RETURNED_NULL_CONNECTION"));
}
+ boolean isSelfManaged =
+ (connection.getConnectionProperties() & Connection.PROPERTY_SELF_MANAGED)
+ == Connection.PROPERTY_SELF_MANAGED;
+ // Self-managed Connections should always use voip audio mode; we default here so that the
+ // local state within the ConnectionService matches the default we assume in Telecom.
+ if (isSelfManaged) {
+ connection.setAudioModeIsVoip(true);
+ }
connection.setTelecomCallId(callId);
if (connection.getState() != Connection.STATE_DISCONNECTED) {
addConnection(callId, connection);
@@ -1570,9 +1578,7 @@ public abstract class ConnectionService extends Service {
createIdList(connection.getConferenceables()),
connection.getExtras()));
- if (isIncoming && request.shouldShowIncomingCallUi() &&
- (connection.getConnectionProperties() & Connection.PROPERTY_SELF_MANAGED) ==
- Connection.PROPERTY_SELF_MANAGED) {
+ if (isIncoming && request.shouldShowIncomingCallUi() && isSelfManaged) {
// Tell ConnectionService to show its incoming call UX.
connection.onShowIncomingCallUi();
}