SettingsExposedDropdownMenuCheckBox requires input index.
Fix: 301354014 Test: Unit Test Change-Id: I4f5ef9a3cfcd0705687232b5e67da8007bf97aed
This commit is contained in:
@@ -148,13 +148,13 @@ fun ApnPage(apnDataCur: MutableState<ApnData>) {
|
||||
stringResource(R.string.apn_mnc),
|
||||
enabled = apnData.mncEnabled
|
||||
) { apnData = apnData.copy(mnc = it) }
|
||||
// Warning: apnProtocol, apnRoaming, mvnoType string2Int
|
||||
SettingsExposedDropdownMenuBox(
|
||||
label = stringResource(R.string.apn_auth_type),
|
||||
options = authTypeOptions,
|
||||
selectedOptionText =
|
||||
authTypeOptions.getOrElse(apnData.authType) { "" },
|
||||
enabled = apnData.authTypeEnabled,
|
||||
) { apnData = apnData.copy(authType = authTypeOptions.indexOf(it)) }
|
||||
stringResource(R.string.apn_auth_type),
|
||||
authTypeOptions,
|
||||
apnData.authType,
|
||||
apnData.authTypeEnabled,
|
||||
) { apnData = apnData.copy(authType = it) }
|
||||
SettingsOutlinedTextField(
|
||||
apnData.apnType,
|
||||
stringResource(R.string.apn_type),
|
||||
|
@@ -34,11 +34,11 @@ data class ApnData(
|
||||
val mnc: String = "",
|
||||
val authType: Int = -1,
|
||||
val apnType: String = "",
|
||||
val apnProtocol: String = "",
|
||||
val apnRoaming: String = "",
|
||||
val apnProtocol: Int = -1,
|
||||
val apnRoaming: Int = -1,
|
||||
val apnEnable: Boolean = true,
|
||||
val bearer: Int = 0,
|
||||
val mvnoType: String = "",
|
||||
val mvnoType: Int = -1,
|
||||
var mvnoValue: String = "",
|
||||
val bearerBitmask: Int = 0,
|
||||
val edited: Int = Telephony.Carriers.USER_EDITED,
|
||||
|
@@ -49,13 +49,14 @@ class ApnEditPageProviderTest {
|
||||
private val apnType = "apn_type"
|
||||
private val apnRoaming = "IPv4"
|
||||
private val apnEnable = context.resources.getString(R.string.carrier_enabled)
|
||||
private val apnProtocolOptions = context.resources.getStringArray(R.array.apn_protocol_entries).toList()
|
||||
private val apnData = ApnData(
|
||||
name = apnName,
|
||||
mmsc = mmsc,
|
||||
mmsProxy = mmsProxy,
|
||||
mnc = mnc,
|
||||
apnType = apnType,
|
||||
apnRoaming = apnRoaming,
|
||||
apnRoaming = apnProtocolOptions.indexOf(apnRoaming),
|
||||
apnEnable = true
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user