From afa05c0b43cbc065181d5c2d6ee368a08bb00c3b Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Wed, 21 May 2014 20:04:36 -0700 Subject: Move dis/enable of mobile data to Telephony ConnectivityService doesn't do this anymore. bug:15077247 Change-Id: I3208c91b2c0369b594987f39ca29da7478435513 (cherry picked from commit 53013c87496980b534e447e717a32698fbd4bca0) --- .../java/android/telephony/TelephonyManager.java | 21 +++++++++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 14 ++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 5d485c5..a896861 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2249,4 +2249,25 @@ public class TelephonyManager { } return false; } + + /** @hide */ + @PrivateApi + public void setDataEnabled(boolean enable) { + try { + getITelephony().setDataEnabled(enable); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#setDataEnabled", e); + } + } + + /** @hide */ + @PrivateApi + public boolean getDataEnabled() { + try { + return getITelephony().getDataEnabled(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#getDataEnabled", e); + } + return false; + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index baacb74..6d7f158 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -436,4 +436,18 @@ interface ITelephony { * @return true on success; false on any failure. */ boolean setPreferredNetworkType(int networkType); + + /** + * User enable/disable Mobile Data. + * + * @param enable true to turn on, else false + */ + void setDataEnabled(boolean enable); + + /** + * Get the user enabled state of Mobile Data. + * + * @return true on enabled + */ + boolean getDataEnabled(); } -- cgit v1.1