From 038027ef83151f2f88503224e1330c14b5a195a0 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Wed, 10 Aug 2022 07:33:25 +0000 Subject: [PATCH] Revert "Removed IWLAN legacy mode support" Revert "Removed IWLAN legacy mode support" Revert submission 19536179-iwlan_legacy_removal Reason for revert: b/241947400 Reverted Changes: Ie0efe54c5:Removed IWLAN legacy mode support Id899b53ac:Removed IWLAN legacy mode support I81fce3558:Removed IWLAN legacy mode support Change-Id: I94764fb4a3246f8fa6a320fa0d7ba1856cafc7f1 --- .../java/android/telephony/ServiceState.java | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 795ecf3979d37..bfa60ba960ca0 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -1207,8 +1207,13 @@ public class ServiceState implements Parcelable { /** * Initialize the service state. Set everything to the default value. + * + * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is + * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device + * is on AP-assisted mode, where IWLAN should be reported through WLAN. + * {@link NetworkRegistrationInfo}. */ - private void init() { + private void init(boolean legacyMode) { if (DBG) Rlog.d(LOG_TAG, "init"); mVoiceRegState = STATE_OUT_OF_SERVICE; mDataRegState = STATE_OUT_OF_SERVICE; @@ -1240,11 +1245,13 @@ public class ServiceState implements Parcelable { .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) .build()); - addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() - .setDomain(NetworkRegistrationInfo.DOMAIN_PS) - .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) - .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) - .build()); + if (!legacyMode) { + addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() + .setDomain(NetworkRegistrationInfo.DOMAIN_PS) + .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) + .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) + .build()); + } } mOperatorAlphaLongRaw = null; mOperatorAlphaShortRaw = null; @@ -1253,11 +1260,11 @@ public class ServiceState implements Parcelable { } public void setStateOutOfService() { - init(); + init(true); } public void setStateOff() { - init(); + init(true); mVoiceRegState = STATE_POWER_OFF; mDataRegState = STATE_POWER_OFF; } @@ -1265,11 +1272,14 @@ public class ServiceState implements Parcelable { /** * Set the service state to out-of-service * + * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is + * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device + * is on AP-assisted mode, where IWLAN should be reported through WLAN. * @param powerOff {@code true} if this is a power off case (i.e. Airplane mode on). * @hide */ - public void setOutOfService(boolean powerOff) { - init(); + public void setOutOfService(boolean legacyMode, boolean powerOff) { + init(legacyMode); if (powerOff) { mVoiceRegState = STATE_POWER_OFF; mDataRegState = STATE_POWER_OFF;