From 67fc92bd444e4d8eee0aa7703980aff9185ea1bd Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 2 Mar 2015 22:46:01 -0800 Subject: [PATCH] Add methods for device telephony configs. + Expose method for whether DTMF length can be changed. + Expose method for whether the device is a world phone. Bug: 19372734 Change-Id: I542e87cab1924eb600fdce929f5227e36112964b --- api/current.txt | 2 ++ api/system-current.txt | 2 ++ .../android/telephony/TelephonyManager.java | 28 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 16 ++++++++++- 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 16dfcf7033755..58aece5b23b5a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29268,6 +29268,7 @@ package android.telephony { } public class TelephonyManager { + method public boolean canChangeDtmfToneLength(); method public java.util.List getAllCellInfo(); method public int getCallState(); method public android.telephony.CellLocation getCellLocation(); @@ -29303,6 +29304,7 @@ package android.telephony { method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); method public boolean isVoiceCapable(); + method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); diff --git a/api/system-current.txt b/api/system-current.txt index 1e9d64a5001f7..9d75341c61133 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31393,6 +31393,7 @@ package android.telephony { public class TelephonyManager { method public void answerRingingCall(); method public void call(java.lang.String, java.lang.String); + method public boolean canChangeDtmfToneLength(); method public int checkCarrierPrivilegesForPackage(java.lang.String); method public void dial(java.lang.String); method public boolean disableDataConnectivity(); @@ -31452,6 +31453,7 @@ package android.telephony { method public boolean isSmsCapable(); method public boolean isVideoCallingEnabled(); method public boolean isVoiceCapable(); + method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); method public boolean needsOtaServiceProvisioning(); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index dda96264ed143..e0d547dd98611 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3717,6 +3717,34 @@ public class TelephonyManager { return false; } + /** + * Whether the device supports configuring the DTMF tone length. + * + * @return {@code true} if the DTMF tone length can be changed, and {@code false} otherwise. + */ + public boolean canChangeDtmfToneLength() { + try { + return getITelephony().canChangeDtmfToneLength(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#canChangeDtmfToneLength", e); + } + return false; + } + + /** + * Whether the device is a world phone. + * + * @return {@code true} if the device is a world phone, and {@code false} otherwise. + */ + public boolean isWorldPhone() { + try { + return getITelephony().isWorldPhone(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isWorldPhone", e); + } + return false; + } + /** * 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 diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 62c8746f7ea92..3769deed233d1 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -863,10 +863,24 @@ interface ITelephony { /** * Whether video calling has been enabled by the user. * - * @return {@code True} if the user has enabled video calling, {@code false} otherwise. + * @return {@code true} if the user has enabled video calling, {@code false} otherwise. */ boolean isVideoCallingEnabled(); + /** + * Whether the DTMF tone length can be changed. + * + * @return {@code true} if the DTMF tone length can be changed. + */ + boolean canChangeDtmfToneLength(); + + /** + * Whether the device is a world phone. + * + * @return {@code true} if the devices is a world phone. + */ + boolean isWorldPhone(); + /** * Get IMS Registration Status */