diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2014-05-21 20:04:36 -0700 |
---|---|---|
committer | Dave Langemak <dlangemak@google.com> | 2014-05-27 20:28:50 +0000 |
commit | afa05c0b43cbc065181d5c2d6ee368a08bb00c3b (patch) | |
tree | ab4c243bf6731f87c3de08e827bad1e5f1b9a929 /telephony | |
parent | 6ecbe3f2d6a9d0a2f69473cc0496fa6c63c4f7f8 (diff) | |
download | frameworks_base-afa05c0b43cbc065181d5c2d6ee368a08bb00c3b.zip frameworks_base-afa05c0b43cbc065181d5c2d6ee368a08bb00c3b.tar.gz frameworks_base-afa05c0b43cbc065181d5c2d6ee368a08bb00c3b.tar.bz2 |
Move dis/enable of mobile data to Telephony
ConnectivityService doesn't do this anymore.
bug:15077247
Change-Id: I3208c91b2c0369b594987f39ca29da7478435513
(cherry picked from commit 53013c87496980b534e447e717a32698fbd4bca0)
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 21 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 14 |
2 files changed, 35 insertions, 0 deletions
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(); } |