diff options
| author | Amit Mahajan <amitmahajan@google.com> | 2019-09-18 14:03:49 -0700 |
|---|---|---|
| committer | Amit Mahajan <amitmahajan@google.com> | 2019-11-01 14:19:31 -0700 |
| commit | ed79bea3c42700a46292fdd5a8d9469b964a76e1 (patch) | |
| tree | e20a2fb785a4816d5068104d6b4d9704e8784777 | |
| parent | 3d8a0ce48992c77b67e27f1fc079a3fdb648b9b3 (diff) | |
Make isDataEnabledForApn() a system api.
Test: atest TelephonyManagerTest#testIsDataEnabledForApn
Bug: 140763963
Merged-in: Icbb29124294972766f68533b7e23700dd491c075
Change-Id: Icbb29124294972766f68533b7e23700dd491c075
(cherry picked from commit 505e17417637dd02c12dd468b54e86f1c9c1ffe9)
| -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 9946f6dd3983..7ac2315bd3ec 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8201,6 +8201,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 c9440a66ab96..a06d19f069d3 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -11466,10 +11466,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(@ApnSetting.ApnType int apnType) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; try { |
