Align PreSelectedTypes with Android U

The Android U pre selected types:
default,mms,supl,dun,hipri,fota,cbs,xcap

Fix: 331875869
Test: manual - on ApnSettings
Test: unit test
Change-Id: I60c9a1a68af1b78825b9f08338b6001f99699414
This commit is contained in:
Chaohui Wang
2024-04-01 11:50:35 +08:00
parent fd6ae421fd
commit 333c309742
2 changed files with 55 additions and 6 deletions

View File

@@ -109,11 +109,15 @@ object ApnTypes {
return regularOptions.filter { it.selected.value }.joinToString(",") { it.text }
}
private val NotPreSelectedTypes = setOf(
ApnSetting.TYPE_IMS_STRING,
ApnSetting.TYPE_IA_STRING,
ApnSetting.TYPE_EMERGENCY_STRING,
ApnSetting.TYPE_MCX_STRING,
private val PreSelectedTypes = setOf(
ApnSetting.TYPE_DEFAULT_STRING,
ApnSetting.TYPE_MMS_STRING,
ApnSetting.TYPE_SUPL_STRING,
ApnSetting.TYPE_DUN_STRING,
ApnSetting.TYPE_HIPRI_STRING,
ApnSetting.TYPE_FOTA_STRING,
ApnSetting.TYPE_CBS_STRING,
ApnSetting.TYPE_XCAP_STRING,
)
fun getPreSelectedApnType(customizedConfig: CustomizedConfig): String =
@@ -123,5 +127,5 @@ object ApnTypes {
private fun defaultPreSelectedApnTypes(readOnlyApnTypes: List<String>) =
if (ApnSetting.TYPE_ALL_STRING in readOnlyApnTypes) emptyList()
else APN_TYPES.filter { it !in readOnlyApnTypes + NotPreSelectedTypes }
else PreSelectedTypes.filterNot { it in readOnlyApnTypes }
}