Add methods to indicate accessibility support.

Namely, indicates whether Telephony supports TTY mode or hearing
aid compatibility.

Bug: 19372734
Change-Id: I08d8cc64169b170c1dc6fb0c713e888eeba30099
This commit is contained in:
Andrew Lee
2015-03-09 18:46:22 -07:00
parent 216f3edcb9
commit f3c10020e2
4 changed files with 43 additions and 5 deletions

View File

@@ -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;
}
/**

View File

@@ -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
*/