diff options
author | Amit Mahajan <amitmahajan@google.com> | 2019-09-18 14:03:49 -0700 |
---|---|---|
committer | Amit Mahajan <amitmahajan@google.com> | 2019-10-07 16:19:05 -0700 |
commit | 505e17417637dd02c12dd468b54e86f1c9c1ffe9 (patch) | |
tree | a889bddd6da5c0f6ea244dedf3019014e8a94212 | |
parent | 00ce4ae0fefea6fa61b3db75f48a23ed0442a533 (diff) |
Make isDataEnabledForApn() a system api.
Test: atest TelephonyManagerTest#testIsDataEnabledForApn
Bug: 140763963
Change-Id: Icbb29124294972766f68533b7e23700dd491c075
-rw-r--r-- | api/system-current.txt | 1 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index fc488457e3b2..fc50a8bc96e9 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8276,6 +8276,7 @@ package android.telephony { method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduLogicalChannelBySlot(int, int, int, int, int, int, int, @Nullable String); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int); method public boolean isDataConnectivityPossible(); + method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index cfc2ed4361d7..c90dffaf2523 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -11378,10 +11378,13 @@ public class TelephonyManager { * 3) APN type is whitelisted. E.g. MMS is whitelisted if * {@link SubscriptionManager#setAlwaysAllowMmsData} is turned on. * + * @param apnType Value indicating the apn type. Apn types are defined in {@link ApnSetting}. * @return whether data is enabled for a apn type. * * @hide */ + @SystemApi + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(@ApnType int apnType) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; try { |