From 161475cb6b2edc8b51b09999919bf3fa8de5d3f9 Mon Sep 17 00:00:00 2001 From: pkanwar Date: Thu, 19 Jan 2017 12:24:19 -0800 Subject: [PATCH] Create Public API which exposes if the device is in a state where simultaneous voice and data are possible. BUG: 32912296 Test: Not required. Change-Id: If603aa37c774157f0a3af12ca4ac6bafad94340d Merged-In: If603aa37c774157f0a3af12ca4ac6bafad94340d --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + .../java/android/telephony/TelephonyManager.java | 14 ++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 6 ++++++ 5 files changed, 23 insertions(+) diff --git a/api/current.txt b/api/current.txt index 18cdb958d5450..f3894ceeba004 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38218,6 +38218,7 @@ package android.telephony { method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int); 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 isConcurrentVoiceAndDataAllowed(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); diff --git a/api/system-current.txt b/api/system-current.txt index ba6d19793d741..dac558e2a6fd8 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -41435,6 +41435,7 @@ package android.telephony { method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int); 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 isConcurrentVoiceAndDataAllowed(); method public boolean isDataConnectivityPossible(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isIdle(); diff --git a/api/test-current.txt b/api/test-current.txt index 088340003b858..78f42135f3bff 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -38317,6 +38317,7 @@ package android.telephony { method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int); 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 isConcurrentVoiceAndDataAllowed(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b7f6e572b649e..c28257e72c972 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5056,6 +5056,20 @@ public class TelephonyManager { } } + /* + * @return true, if the device is currently on a technology (e.g. UMTS or LTE) which can support + * voice and data simultaneously. This can change based on location or network condition. + */ + public boolean isConcurrentVoiceAndDataAllowed() { + try { + ITelephony telephony = getITelephony(); + return (telephony == null ? false : telephony.isConcurrentVoiceAndDataAllowed(mSubId)); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isConcurrentVoiceAndDataAllowed", e); + } + return false; + } + /** @hide */ @SystemApi public boolean handlePinMmi(String dialString) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 60d5eeba04fd9..3bd80bf3183d2 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -491,6 +491,12 @@ interface ITelephony { */ int getVoiceMessageCountForSubscriber(int subId); + /** + * Returns true if current state supports both voice and data + * simultaneously. This can change based on location or network condition. + */ + boolean isConcurrentVoiceAndDataAllowed(int subId); + oneway void setVisualVoicemailEnabled(String callingPackage, in PhoneAccountHandle accountHandle, boolean enabled);