summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2014-12-09 18:06:03 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-09 18:06:03 +0000
commit7a4df2b7d8fc162881dd482fb13fe85c780d0351 (patch)
treedce98172febf3c5bfacac06d7da18a7d63342203 /telephony
parentb97633c14da555d89dac7eadbf6e351d82281614 (diff)
parent2f5cb843553a596d314596c2bb776541db864d63 (diff)
downloadframeworks_base-7a4df2b7d8fc162881dd482fb13fe85c780d0351.zip
frameworks_base-7a4df2b7d8fc162881dd482fb13fe85c780d0351.tar.gz
frameworks_base-7a4df2b7d8fc162881dd482fb13fe85c780d0351.tar.bz2
am 2f5cb843: am 15b29ac7: Merge "Add subId as parameter for get/setDataEnabled." into lmp-mr1-dev
* commit '2f5cb843553a596d314596c2bb776541db864d63': Add subId as parameter for get/setDataEnabled.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java22
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl4
2 files changed, 21 insertions, 5 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 852978b..c745226 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3505,8 +3505,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);
}
@@ -3515,12 +3522,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.