summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/ConnectionService.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 178ca68ce493..bc9c8473943b 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -1557,6 +1557,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(request.getAccountHandle(), callId, connection);
@@ -1596,9 +1604,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();
}
@@ -2078,6 +2084,10 @@ public abstract class ConnectionService extends Service {
* Call to inform Telecom that your {@link ConnectionService} has released call resources (e.g
* microphone, camera).
*
+ * <p>
+ * The {@link ConnectionService} will be disconnected when it failed to call this method within
+ * 5 seconds after {@link #onConnectionServiceFocusLost()} is called.
+ *
* @see ConnectionService#onConnectionServiceFocusLost()
*/
public final void connectionServiceFocusReleased() {