diff options
| author | 2018-11-01 18:05:09 -0700 | |
|---|---|---|
| committer | 2018-11-01 18:05:09 -0700 | |
| commit | c02e86d0bf11ac080512990ddee3a5121cbcd2da (patch) | |
| tree | a7f7437a2eaba155f8aa2f92849b76f36b0e58b2 | |
| parent | 780ba3226ef5fa0f39db507ff05edcefe3ccf5c0 (diff) | |
| parent | f583bb525ae52530932f4396d128e0bd83dc9fbc (diff) | |
Merge "Add TestApi to get RTT support status"
am: f583bb525a
Change-Id: Iaec0f9d035cfa657a345ee8ca25fc7d810f1d933
| -rw-r--r-- | api/test-current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 21 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 2 |
3 files changed, 24 insertions, 0 deletions
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 9af5761354f6..d02a39d99cc4 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -7394,6 +7394,27 @@ public class TelephonyManager { } /** + * 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. * * @return {@code true} if the device supports hearing aid compatibility, and {@code false} diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index cf13b431daac..a98efe2eb6d8 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1053,6 +1053,8 @@ interface ITelephony { */ boolean isTtyModeSupported(); + boolean isRttSupported(int subscriptionId); + /** * Whether the phone supports hearing aid compatibility. * |