APNs missing while numeric is null in add mode.

Test: Visual Test
Fix: 312142091
Change-Id: I2b7d4580dcb3fda08ce8d147ed827ee4383befba
This commit is contained in:
Charlotte Lu
2023-11-21 14:47:15 +08:00
parent 6bb2c73579
commit 3a1252a6d5

View File

@@ -72,9 +72,6 @@ data class ApnData(
val customizedConfig: CustomizedConfig = CustomizedConfig()
) {
fun getContentValues(context: Context): ContentValues {
val simCarrierId =
context.getSystemService(TelephonyManager::class.java)!!.createForSubscriptionId(subId)
.getSimCarrierId()
val values = ContentValues()
values.put(Telephony.Carriers.NAME, name)
values.put(Telephony.Carriers.APN, apn)
@@ -96,7 +93,12 @@ data class ApnData(
values.put(Telephony.Carriers.NETWORK_TYPE_BITMASK, networkType)
values.put(Telephony.Carriers.CARRIER_ENABLED, apnEnable)
values.put(Telephony.Carriers.EDITED_STATUS, Telephony.Carriers.USER_EDITED)
if (newApn) {
val simCarrierId =
context.getSystemService(TelephonyManager::class.java)!!.createForSubscriptionId(subId)
.getSimCarrierId()
values.put(Telephony.Carriers.CARRIER_ID, simCarrierId)
}
return values
}
}