Compare commits

..

No commits in common. "a101ae6805340053c9d783b2a886965070bf34fb" and "2d1c96023a8669036dc2652e13414bcb4f05a893" have entirely different histories.

2 changed files with 5 additions and 13 deletions

View file

@ -47,13 +47,11 @@ abstract class CompatibilityCheck(context: Context) {
abstract val title: String
protected abstract val defaultDescription: String
protected lateinit var successDescription: String
protected lateinit var failureDescription: String
val description: String
get() = when {
(state == State.FAILURE || state == State.FAILURE_UNKNOWN) && this::failureDescription.isInitialized -> failureDescription
state == State.SUCCESS && this::successDescription.isInitialized -> successDescription
else -> defaultDescription
}
@ -113,9 +111,9 @@ internal class OmapiConnCheck(private val context: Context): CompatibilityCheck(
failureDescription = context.getString(R.string.compatibility_check_omapi_connectivity_fail)
return State.FAILURE
} else if (simReaders.size < tm.activeModemCountCompat) {
successDescription = context.getString(R.string.compatibility_check_omapi_connectivity_partial_success_sim_number,
failureDescription = context.getString(R.string.compatibility_check_omapi_connectivity_fail_sim_number,
simReaders.map { it.slotIndex }.joinToString(", "))
return State.SUCCESS
return State.FAILURE
}
return State.SUCCESS
@ -134,13 +132,7 @@ internal class IsdrChannelAccessCheck(private val context: Context): Compatibili
override suspend fun doCheck(): State {
val seService = connectSEService(context)
val readers = seService.readers.filter { it.isSIM }
if (readers.isEmpty()) {
failureDescription = context.getString(R.string.compatibility_check_isdr_channel_desc_unknown)
return State.FAILURE_UNKNOWN
}
val (validSlotIds, result) = readers.map {
val (validSlotIds, result) = seService.readers.filter { it.isSIM }.map {
try {
it.openSession().openLogicalChannel(ISDR_AID)?.close()
Pair(it.slotIndex, State.SUCCESS)

View file

@ -9,8 +9,8 @@
<string name="compatibility_check_system_features_no_omapi">Your device has no support for accessing SIM cards via OMAPI.</string>
<string name="compatibility_check_omapi_connectivity">OMAPI Connectivity</string>
<string name="compatibility_check_omapi_connectivity_desc">Does your device allow access to Secure Elements on SIM cards via OMAPI?</string>
<string name="compatibility_check_omapi_connectivity_fail">Unable to detect Secure Element readers for SIM cards via OMAPI. If you have not inserted a SIM in this device, try inserting one and retry this check.</string>
<string name="compatibility_check_omapi_connectivity_partial_success_sim_number">Successfully detected Secure Element access, but only for the following SIM slots: %s.</string>
<string name="compatibility_check_omapi_connectivity_fail">Unable to detect Secure Element readers for SIM cards via OMAPI.</string>
<string name="compatibility_check_omapi_connectivity_fail_sim_number">Only the following SIM slots are accessible via OMAPI: %s.</string>
<string name="compatibility_check_isdr_channel">ISD-R Channel Access</string>
<string name="compatibility_check_isdr_channel_desc">Does your device support opening an ISD-R (management) channel to eSIMs via OMAPI?</string>
<string name="compatibility_check_isdr_channel_desc_unknown">Cannot determine whether ISD-R access through OMAPI is supported. You might want to retry with SIM cards inserted (any SIM card will do) if not already.</string>