From f3c10020e2b76f20adb90d250ab4ed4e20e348d2 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 9 Mar 2015 18:46:22 -0700 Subject: Add methods to indicate accessibility support. Namely, indicates whether Telephony supports TTY mode or hearing aid compatibility. Bug: 19372734 Change-Id: I08d8cc64169b170c1dc6fb0c713e888eeba30099 --- api/current.txt | 2 ++ api/system-current.txt | 2 ++ .../java/android/telephony/TelephonyManager.java | 30 ++++++++++++++++++---- .../com/android/internal/telephony/ITelephony.aidl | 14 ++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index 612d16de8332..8a166f8c4aee 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29370,8 +29370,10 @@ package android.telephony { method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String); method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); + method public boolean isHearingAidCompatibilitySupported(); method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); + method public boolean isTtyModeSupported(); method public boolean isVoiceCapable(); method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); diff --git a/api/system-current.txt b/api/system-current.txt index ff9809ffb14b..2388eb6f6a11 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31520,6 +31520,7 @@ package android.telephony { method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public boolean isDataConnectivityPossible(); + method public boolean isHearingAidCompatibilitySupported(); method public boolean isIdle(); method public boolean isNetworkRoaming(); method public boolean isOffhook(); @@ -31527,6 +31528,7 @@ package android.telephony { method public boolean isRinging(); method public boolean isSimPinEnabled(); method public boolean isSmsCapable(); + method public boolean isTtyModeSupported(); method public boolean isVideoCallingEnabled(); method public boolean isVoiceCapable(); method public boolean isWorldPhone(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index f3b2d2e322ea..ddb9183d0165 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3744,12 +3744,32 @@ public class TelephonyManager { } /** - * This function retrieves value for setting "name+subId", and if that is not found - * retrieves value for setting "name", and if that is not found uses def as default + * Whether the phone supports TTY mode. * - * @hide */ - public static int getIntWithSubId(ContentResolver cr, String name, int subId, int def) { - return Settings.Global.getInt(cr, name + subId, Settings.Global.getInt(cr, name, def)); + * @return {@code true} if the device supports TTY mode, and {@code false} otherwise. + */ + public boolean isTtyModeSupported() { + try { + return getITelephony().isTtyModeSupported(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isTtyModeSupported", e); + } + return false; + } + + /** + * Whether the phone supports hearing aid compatibility. + * + * @return {@code true} if the device supports hearing aid compatibility, and {@code false} + * otherwise. + */ + public boolean isHearingAidCompatibilitySupported() { + try { + return getITelephony().isHearingAidCompatibilitySupported(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isHearingAidCompatibilitySupported", e); + } + return false; } /** diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 3769deed233d..f9e15f3968c2 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -881,6 +881,20 @@ interface ITelephony { */ boolean isWorldPhone(); + /** + * Whether the phone supports TTY mode. + * + * @return {@code true} if the device supports TTY mode. + */ + boolean isTtyModeSupported(); + + /** + * Whether the phone supports hearing aid compatibility. + * + * @return {@code true} if the device supports hearing aid compatibility. + */ + boolean isHearingAidCompatibilitySupported(); + /** * Get IMS Registration Status */ -- cgit v1.2.3-59-g8ed1b