summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jack Yu <jackyu@google.com> 2019-02-20 15:48:07 -0800
committer Jack Yu <jackyu@google.com> 2019-02-21 15:57:32 -0800
commitc9747b94f03d1a61cdf91a07e85d503dfc2e22bb (patch)
treeac725740bcb45772fcb8a98988b95c92b9169db1
parent07037a86d3211bf84f897ae28f4c303d7587ee41 (diff)
Fixed incorrect data network type when device is on IWLAN
When the device is configured as AP-assisted mode, the cellular network service should reports the cellular data RAT instead of IWLAN. However, before we clean up all usages of ServiceState.getDataNetworkType(), we still need to simulate the old behavior, which is reporting IWLAN as the data network type. Once all places are cleaned up, we can remove this temporary solution. Test: Manual Bug: 124994459 Merged-In: I37256517af3bcf7330cefe55a33d6f09af7e1353 Change-Id: I37256517af3bcf7330cefe55a33d6f09af7e1353 (cherry picked from commit 2bd032071b1ccbb9da8ba197d448dd676cc42693)
-rw-r--r--telephony/java/android/telephony/ServiceState.java11
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) {