diff options
| author | 2019-02-21 22:41:32 +0000 | |
|---|---|---|
| committer | 2019-02-21 22:41:32 +0000 | |
| commit | 26ad134742edb08ef68e7645d816e46f95149cc7 (patch) | |
| tree | fc870449de2e419fa816c3cf0be494357c6a70b8 | |
| parent | 3b5741c5604f538aab7434eb746327dc0124ba74 (diff) | |
| parent | 2bd032071b1ccbb9da8ba197d448dd676cc42693 (diff) | |
Merge "Fixed incorrect data network type when device is on IWLAN"
| -rw-r--r-- | telephony/java/android/telephony/ServiceState.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index a1aee6d8217f..3dc119950a59 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -1569,6 +1569,17 @@ public class ServiceState implements Parcelable { /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public @TelephonyManager.NetworkType int getDataNetworkType() { + final NetworkRegistrationState iwlanRegState = getNetworkRegistrationState( + NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN); + if (iwlanRegState != null + && iwlanRegState.getRegState() == NetworkRegistrationState.REG_STATE_HOME) { + // If the device is on IWLAN, return IWLAN as the network type. This is to simulate the + // behavior of legacy mode device. In the future caller should use + // getNetworkRegistrationState() to retrieve the actual data network type on cellular + // or on IWLAN. + return iwlanRegState.getAccessNetworkTechnology(); + } + final NetworkRegistrationState regState = getNetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); if (regState != null) { |