This page describes how to implement real-time text (RTT) in Android 9. RTT is a feature for deaf or hard of hearing users that replaces teletypewriter (TTY) technology. With this feature, devices can use the same phone number for voice and RTT calls, simultaneously transmit text as it is being typed on a character-by-character basis, support 911 communications, and provide backward capability with TTY.
In an RTT call, both the caller and receiver have indications that they are in an RTT call. When connected, both sides enter the RTT call where the text input and keyboard is activated. When typing, the text appears and is sent as it is typed, character by character.
Examples and source
Framework components are available in AOSP at Call.RttCall and Connection.RttTextStream. IMS/modem components are proprietary and should be supplied by the IMS/modem vendor. Dialer RTT reference implementation is also available.
AOSP Dialer code for RTT:
- InCall: /java/com/android/incallui/rtt
- Call log: /java/com/android/dialer/rtt
Implementation
To implement RTT, you should work with a modem/SoC provider because a modem that supports RTT is required. You can upgrade to Android 9 or backport a list of telephony framework patches into Android 8.0. APIs added in Android 8.0 AOSP will not work.
This feature uses public APIs in AOSP in android.telecom
and @SystemApis in
android.telephony.ims
. All UI lies within com.android.phone
and the AOSP
dialer.
To implement RTT, import the AOSP code and supply an IMS stack that implements the IMS-side @SystemApis for RTT. This requires:
- Turning RTT on/off using
ImsConfig#setProvisionedValue(RTT_SETTING_ENABLED)
- Indicating RTT status of a call using
ImsStreamMediaProfile#mRttMode
Support for the following methods in
ImsCallSession
:sendRttMessage
sendRttModifyRequest
sendRttModifyResponse
Support for calling the following methods in
ImsCallSessionListener
:callSessionRttModifyRequestReceived
callSessionRttModifyResponseReceived
callSessionRttMessageReceived
Customization
You can enable or disable this feature using the device config,
config_support_rtt
, in the device config overlay for
packages/services/Telephony
, and the carrier config flag,
CarrierConfigManager.RTT_SUPPORTED_BOOL
, in the carrier config files.
Depending on the configuration, the feature is either available through the
Accessibility settings or not. Use the device config to change the default
settings. By default, the feature is set to Off.
Validation
To validate your implementation of RTT, run CTS tests, and perform dialer RTT testing.
CTS testing
The CTS tests (android.cts.telecom.RttOperationsTest
) cover the AOSP portion
of the implementation. You must provide your own tests for the IMS stack portion
of the implementation.
Dialer RTT testing
Scenario description | UI mock |
---|---|
If RTT is disabled on the device, a dialog about RTT is displayed. | |
In Dialer settings, a Real-Time Text screen is available under Settings > Accessibility that provides an option to choose a different RTT mode. | |
When RTT is enabled by default:
|
|
If RTT is disabled on the device:
|
|
If RTT is enabled on the device and has the default
set to answer all calls as RTT:
|
|
In the in-call UI for RTT, options are provided to
allow users to control the state of the voice call and get general help on
using RTT:
|
|
In the Call details screen, selecting the See transcript link displays a full conversation view with the full text of the RTT session. Timestamps are displayed. The user can return to the Call details screen using the back button. |