From a7d023057241b887341360ef5c4125826d716430 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Wed, 31 Oct 2018 17:03:34 -0700 Subject: Add TestApi to get RTT support status Add a TestApi for CTS to be able to tell whether a device supports RTT on the current carrier. Bug: 113069001 Test: manual Change-Id: I135338b7b83f888d454d09dddd30c72197fe0533 --- api/test-current.txt | 1 + .../java/android/telephony/TelephonyManager.java | 21 +++++++++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 2 ++ 3 files changed, 24 insertions(+) diff --git a/api/test-current.txt b/api/test-current.txt index 890482eb0655..c09ff9880ce7 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -988,6 +988,7 @@ package android.telephony { public class TelephonyManager { method public int getCarrierIdListVersion(); + method public boolean isRttSupported(); method public void refreshUiccProfile(); method public void setCarrierTestOverride(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String); field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0ad2cbec6100..fc86c654f9b1 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -7326,6 +7326,27 @@ public class TelephonyManager { return false; } + /** + * Determines whether the device currently supports RTT (Real-time text). Based both on carrier + * support for the feature and device firmware support. + * + * @return {@code true} if the device and carrier both support RTT, {@code false} otherwise. + * @hide + */ + @TestApi + public boolean isRttSupported() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isRttSupported(mSubId); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isRttSupported", e); + } catch (SecurityException e) { + Log.e(TAG, "Permission error calling ITelephony#isWorldPhone", e); + } + return false; + } /** * Whether the phone supports hearing aid compatibility. * diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 84c2a5d78018..96d9c3ab2681 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1038,6 +1038,8 @@ interface ITelephony { */ boolean isTtyModeSupported(); + boolean isRttSupported(int subscriptionId); + /** * Whether the phone supports hearing aid compatibility. * -- cgit v1.2.3-59-g8ed1b