From 5884933ee6490034e5ea06fb0d2413a382b1c3c9 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Fri, 27 Dec 2019 19:42:20 -0800 Subject: Expose ServiceState#getDataNetworkType as SystemApi Test: atest android.telephony.cts.ServiceStateTest#testGetDataNetworkType Bug: 146834818 Change-Id: If3f7b227da1bd2d3a107375dbd8b4218435dc1dc --- api/system-current.txt | 1 + api/test-current.txt | 1 + telephony/java/android/telephony/ServiceState.java | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/system-current.txt b/api/system-current.txt index d6a3433f66bd..2dcd0a69802c 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8954,6 +8954,7 @@ package android.telephony { public class ServiceState implements android.os.Parcelable { method @NonNull public android.telephony.ServiceState createLocationInfoSanitizedCopy(boolean); method public void fillInNotifierBundle(@NonNull android.os.Bundle); + method public int getDataNetworkType(); method public int getDataRegistrationState(); method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int); method @NonNull public java.util.List getNetworkRegistrationInfoList(); diff --git a/api/test-current.txt b/api/test-current.txt index a20b75c3355b..8f6006e9d389 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3018,6 +3018,7 @@ package android.telephony { public class ServiceState implements android.os.Parcelable { method public void addNetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo); + method public int getDataNetworkType(); method public void setCdmaSystemAndNetworkId(int, int); method public void setCellBandwidths(int[]); method public void setChannelNumber(int); diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 2c62d0667e19..ad8ac76642ae 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -1624,7 +1624,8 @@ public class ServiceState implements Parcelable { * @return Current data network type * @hide */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) + @SystemApi + @TestApi public @NetworkType int getDataNetworkType() { final NetworkRegistrationInfo iwlanRegInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WLAN); -- cgit v1.2.3-59-g8ed1b