diff options
author | Wink Saville <wink@google.com> | 2014-12-09 17:52:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-09 17:52:27 +0000 |
commit | 15b29ac7faf3b8b7845e6623f68ae7a7391dab78 (patch) | |
tree | 11990d9ec4cefc9449329b5e36fdd80e7efcfd99 /telephony/java | |
parent | 2f4ced3009e1aa59f7b05a3663bc6ca6fe0a208e (diff) | |
parent | 36ffb0494dd1045c164b7479b68165e206f8c759 (diff) | |
download | frameworks_base-15b29ac7faf3b8b7845e6623f68ae7a7391dab78.zip frameworks_base-15b29ac7faf3b8b7845e6623f68ae7a7391dab78.tar.gz frameworks_base-15b29ac7faf3b8b7845e6623f68ae7a7391dab78.tar.bz2 |
Merge "Add subId as parameter for get/setDataEnabled." into lmp-mr1-dev
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 22 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 4 |
2 files changed, 21 insertions, 5 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 83bf04f..73e3213 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3509,8 +3509,15 @@ public class TelephonyManager { /** @hide */ @SystemApi public void setDataEnabled(boolean enable) { + setDataEnabled(SubscriptionManager.getDefaultDataSubId(), enable); + } + + /** @hide */ + @SystemApi + public void setDataEnabled(int subId, boolean enable) { try { - getITelephony().setDataEnabled(enable); + Log.d(TAG, "setDataEnabled: enabled=" + enable); + getITelephony().setDataEnabled(subId, enable); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setDataEnabled", e); } @@ -3519,12 +3526,21 @@ public class TelephonyManager { /** @hide */ @SystemApi public boolean getDataEnabled() { + return getDataEnabled(SubscriptionManager.getDefaultDataSubId()); + } + + /** @hide */ + @SystemApi + public boolean getDataEnabled(int subId) { + boolean retVal; try { - return getITelephony().getDataEnabled(); + retVal = getITelephony().getDataEnabled(subId); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#getDataEnabled", e); + retVal = false; } - return false; + Log.d(TAG, "getDataEnabled: retVal=" + retVal); + return retVal; } /** diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index d19fa2c..4affad8 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -679,14 +679,14 @@ interface ITelephony { * * @param enable true to turn on, else false */ - void setDataEnabled(boolean enable); + void setDataEnabled(int subId, boolean enable); /** * Get the user enabled state of Mobile Data. * * @return true on enabled */ - boolean getDataEnabled(); + boolean getDataEnabled(int subId); /** * Get P-CSCF address from PCO after data connection is established or modified. |