Skip to content

Commit 930dbe2

Browse files
authored
fix: app crash and eSIM index issue (#142)
1 parent 95d147f commit 930dbe2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/src/main/java/dev/bluehouse/enablevolte/Utils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fun checkShizukuPermission(code: Int): Boolean {
1919
}
2020

2121
val SubscriptionInfo.uniqueName: String
22-
get() = "${this.cardId} - ${this.displayName}"
22+
get() = "${this.subscriptionId} - ${this.displayName}"
2323

2424
fun getLatestAppVersion(handler: (String) -> Unit) {
2525
"https://api.github.com/repos/kyujin-cho/pixel-volte-patch/releases"

app/src/main/java/dev/bluehouse/enablevolte/pages/Home.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ fun Home(navController: NavController) {
108108
BooleanPropertyView(label = stringResource(R.string.volte_supported_by_device), toggled = deviceIMSEnabled)
109109

110110
for (idx in subscriptions.indices) {
111+
var isRegistered = false
112+
if (isIMSRegistered.isNotEmpty()) {
113+
isRegistered = isIMSRegistered[idx]
114+
}
111115
HeaderText(text = stringResource(R.string.ims_status_for, "${subscriptions[idx].uniqueName}"))
112116
BooleanPropertyView(
113117
label = stringResource(R.string.ims_status),
114-
toggled = isIMSRegistered[idx],
118+
toggled = isRegistered,
115119
trueLabel = stringResource(R.string.registered),
116120
falseLabel = stringResource(R.string.unregistered),
117121
)

0 commit comments

Comments
 (0)