Add icon to differentiate pSIM and eSIM
Fix: 330096133 Test: manual - on SIMs Change-Id: I7b7f5d91492d72d66cecf17e52fde1b51ad37832
This commit is contained in:
@@ -24,6 +24,8 @@ import android.telephony.euicc.EuiccManager
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Add
|
||||
import androidx.compose.material.icons.outlined.SimCard
|
||||
import androidx.compose.material.icons.outlined.SimCardDownload
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.remember
|
||||
@@ -65,6 +67,7 @@ private fun SimPreference(subInfo: SubscriptionInfo) {
|
||||
model = object : SwitchPreferenceModel {
|
||||
override val title = subInfo.displayName.toString()
|
||||
override val summary = { phoneNumber.value ?: "" }
|
||||
override val icon = @Composable { SimIcon(subInfo.isEmbedded) }
|
||||
override val checked = { checked.value }
|
||||
override val onCheckedChange = { newChecked: Boolean ->
|
||||
SubscriptionUtil.startToggleSubscriptionDialogActivity(
|
||||
@@ -80,6 +83,11 @@ private fun SimPreference(subInfo: SubscriptionInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SimIcon(isEmbedded: Boolean) {
|
||||
SettingsIcon(if (isEmbedded) Icons.Outlined.SimCardDownload else Icons.Outlined.SimCard)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun phoneNumber(subInfo: SubscriptionInfo): State<String?> {
|
||||
val context = LocalContext.current
|
||||
|
Reference in New Issue
Block a user