diff options
| author | 2019-02-22 11:11:38 -0800 | |
|---|---|---|
| committer | 2019-02-22 11:11:38 -0800 | |
| commit | cfd6493bb89ff3f2a52118ec3ccbbe6bd8e93e95 (patch) | |
| tree | 163e133ef97dfa87599087b2c1a3a9f712c730aa | |
| parent | 1ae35be3e3f2d78e4e5742b26e5a8dc063e8cba2 (diff) | |
| parent | e8eb967389b5ade9db024cb3d3a6ae829c0f13cd (diff) | |
Merge "Fixed incorrect data network type when device is on IWLAN"
am: e8eb967389
Change-Id: Ib4285fbee98a72cc4e159822c2784873b4423a9f
| -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) { |