# Call.RttCall

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RttCall

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/telecom/Call.RttCall "View this page in Java")  

```
class RttCall
```

|---|--------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                               ||
| ↳ | [android.telecom.Call.RttCall](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#) |

A class that holds the state that describes the state of the RTT channel to the remote party, if it is active.

## Summary

|                                                                                                                                                       Constants                                                                                                                                                       ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RTT_MODE_FULL](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_FULL:kotlin.Int) Indicates that there should be a bidirectional audio stream between the two parties on the call.              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RTT_MODE_HCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_HCO:kotlin.Int) Indicates that the local user should be able to hear the audio stream from the remote user, but not vice versa. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RTT_MODE_VCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_VCO:kotlin.Int) Indicates that the remote user should be able to hear the audio stream from the local user, but not vice versa. |

|                                                                                                                                                                                 Public methods                                                                                                                                                                                 ||
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [getRttAudioMode](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#getRttAudioMode())`()` Returns the current RTT audio mode.                                                                                                                                    |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [read](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#read())`()` Reads a string from the remote user, blocking if there is no data available.                                                                                                                 |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [readImmediately](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#readImmediately())`()` Non-blocking version of[read()](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#read()).                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)      | [setRttMode](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#setRttMode(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the RTT audio mode.                                                           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)      | [write](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#write(kotlin.String))`(`input:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Writes the string {@param input} into the outgoing text stream for this RTT call. |

## Constants

### RTT_MODE_FULL

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RTT_MODE_FULL: Int
```

Indicates that there should be a bidirectional audio stream between the two parties on the call.  

    Value: 1

### RTT_MODE_HCO

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RTT_MODE_HCO: Int
```

Indicates that the local user should be able to hear the audio stream from the remote user, but not vice versa. Equivalent to muting the microphone.  

    Value: 2

### RTT_MODE_VCO

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RTT_MODE_VCO: Int
```

Indicates that the remote user should be able to hear the audio stream from the local user, but not vice versa. Equivalent to setting the volume to zero.  

    Value: 3

## Public methods

### getRttAudioMode

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getRttAudioMode(): Int
```

Returns the current RTT audio mode.

|                                                                                                                                                                                                                                   Return                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Current RTT audio mode. One of[RTT_MODE_FULL](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_FULL:kotlin.Int),[RTT_MODE_VCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_VCO:kotlin.Int), or[RTT_MODE_HCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_HCO:kotlin.Int). |

### read

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun read(): String!
```

Reads a string from the remote user, blocking if there is no data available. Returns`null`if the RTT conversation has been terminated and there is no further data to read. This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.

|                                                                                                            Return                                                                                                            ||
|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | A string containing text sent by the remote user, or`null`if the conversation has been terminated or if there was an error while reading. |

### readImmediately

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun readImmediately(): String!
```

Non-blocking version of[read()](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#read()). Returns`null`if there is nothing to be read.

|                                                                                         Return                                                                                         ||
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | A string containing text entered by the user, or`null`if the user has not entered any new text yet. |

### setRttMode

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setRttMode(mode: Int): Unit
```

Sets the RTT audio mode. The requested mode change will be communicated through[Callback.onRttModeChanged(Call, int)](https://developer.android.com/reference/kotlin/android/telecom/Call.Callback#onRttModeChanged(android.telecom.Call,%20kotlin.Int)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The desired RTT audio mode, one of[RTT_MODE_FULL](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_FULL:kotlin.Int),[RTT_MODE_VCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_VCO:kotlin.Int), or[RTT_MODE_HCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_HCO:kotlin.Int). Value is android.telecom.Call.RttCall.RTT_MODE_INVALID,[android.telecom.Call.RttCall#RTT_MODE_FULL](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_FULL:kotlin.Int),[android.telecom.Call.RttCall#RTT_MODE_HCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_HCO:kotlin.Int), or[android.telecom.Call.RttCall#RTT_MODE_VCO](https://developer.android.com/reference/kotlin/android/telecom/Call.RttCall#RTT_MODE_VCO:kotlin.Int) |

### write

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun write(input: String!): Unit
```

Writes the string {@param input} into the outgoing text stream for this RTT call. Since RTT transmits text in real-time, this method should be called once for each user action. For example, when the user enters text as discrete characters using the keyboard, this method should be called once for each character. However, if the user enters text by pasting or autocomplete, the entire contents of the pasted or autocompleted text should be sent in one call to this method. This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.

|                                                             Parameters                                                             ||
|---------|---------------------------------------------------------------------------------------------------------------------------|
| `input` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The message to send to the remote user. |