Merge "Added IWLAN handover rules support"

This commit is contained in:
Jack Yu
2022-03-08 04:02:38 +00:00
committed by Gerrit Code Review
2 changed files with 49 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
package android.telephony; package android.telephony;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.hardware.radio.V1_5.AccessNetwork; import android.hardware.radio.V1_5.AccessNetwork;
@@ -28,6 +29,8 @@ import java.lang.annotation.RetentionPolicy;
*/ */
public final class AccessNetworkConstants { public final class AccessNetworkConstants {
private static final String TAG = AccessNetworkConstants.class.getSimpleName();
/** /**
* Wireless transportation type * Wireless transportation type
* *
@@ -108,6 +111,21 @@ public final class AccessNetworkConstants {
default: return Integer.toString(type); default: return Integer.toString(type);
} }
} }
/** @hide */
public static @RadioAccessNetworkType int fromString(@NonNull String str) {
switch (str.toUpperCase()) {
case "GERAN" : return GERAN;
case "UTRAN" : return UTRAN;
case "EUTRAN" : return EUTRAN;
case "CDMA2000" : return CDMA2000;
case "IWLAN" : return IWLAN;
case "NGRAN" : return NGRAN;
default:
Rlog.e(TAG, "Invalid access network type " + str);
return UNKNOWN;
}
}
} }
/** /**

View File

@@ -5730,6 +5730,34 @@ public class CarrierConfigManager {
public static final String KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL = public static final String KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL =
"unthrottle_data_retry_when_tac_changes_bool"; "unthrottle_data_retry_when_tac_changes_bool";
/**
* IWLAN handover rules that determine whether handover is allowed or disallowed between
* cellular and IWLAN.
*
* The handover rules will be matched in the order. Here are some sample rules.
* <string-array name="iwlan_handover_rules" num="5">
* <!-- Handover from IWLAN to 2G/3G is not allowed -->
* <item value="source=IWLAN, target=GERAN|UTRAN, type=disallowed"/>
* <!-- Handover from 2G/3G to IWLAN is not allowed -->
* <item value="source=GERAN|UTRAN, target:IWLAN, type=disallowed"/>
* <!-- Handover from IWLAN to 3G/4G/5G is not allowed if the device is roaming. -->
* <item value="source=IWLAN, target=UTRAN|EUTRAN|NGRAN, roaming=true, type=disallowed"/>
* <!-- Handover from 4G to IWLAN is not allowed -->
* <item value="source=EUTRAN, target=IWLAN, type=disallowed"/>
* <!-- Handover is always allowed in any condition. -->
* <item value="source=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN,
* target=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, type=allowed"/>
* </string-array>
*
* When handover is not allowed, frameworks will tear down the data network on source transport,
* and then setup a new one on the target transport when Qualified Network Service changes the
* preferred access networks for particular APN types.
*
* @hide
*/
public static final String KEY_IWLAN_HANDOVER_POLICY_STRING_ARRAY =
"iwlan_handover_policy_string_array";
/** The default value for every variable. */ /** The default value for every variable. */
private final static PersistableBundle sDefaults; private final static PersistableBundle sDefaults;
@@ -6378,6 +6406,9 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL, false); sDefaults.putBoolean(KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL, false);
sDefaults.putBoolean(KEY_VONR_SETTING_VISIBILITY_BOOL, false); sDefaults.putBoolean(KEY_VONR_SETTING_VISIBILITY_BOOL, false);
sDefaults.putBoolean(KEY_VONR_ENABLED_BOOL, false); sDefaults.putBoolean(KEY_VONR_ENABLED_BOOL, false);
sDefaults.putStringArray(KEY_IWLAN_HANDOVER_POLICY_STRING_ARRAY, new String[]{
"source=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, "
+ "target=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, type=allowed"});
} }
/** /**