privileged: Disable slot mapping support for pre-T
All checks were successful
/ build-debug (push) Successful in 4m22s
All checks were successful
/ build-debug (push) Successful in 4m22s
Fixes #15.
This commit is contained in:
parent
80adac68c8
commit
f046d40f2c
|
@ -1,5 +1,6 @@
|
|||
package im.angry.openeuicc.service
|
||||
|
||||
import android.os.Build
|
||||
import android.service.euicc.*
|
||||
import android.telephony.UiccSlotMapping
|
||||
import android.telephony.euicc.DownloadableSubscription
|
||||
|
@ -34,6 +35,10 @@ class OpenEuiccService : EuiccService(), OpenEuiccContextMarker {
|
|||
lpa.profiles.any { it.iccid == iccid }
|
||||
|
||||
private fun ensurePortIsMapped(slotId: Int, portId: Int) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
return
|
||||
}
|
||||
|
||||
val mappings = telephonyManager.simSlotMapping.toMutableList()
|
||||
|
||||
mappings.firstOrNull { it.physicalSlotIndex == slotId && it.portIndex == portId }?.let {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package im.angry.openeuicc.ui
|
||||
|
||||
import android.os.Build
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.widget.Toast
|
||||
|
@ -11,6 +12,10 @@ class PrivilegedMainActivity : MainActivity() {
|
|||
super.onCreateOptionsMenu(menu)
|
||||
menuInflater.inflate(R.menu.activity_main_privileged, menu)
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
menu.findItem(R.id.slot_mapping).isVisible = false
|
||||
}
|
||||
|
||||
if (tm.supportsDSDS) {
|
||||
val dsds = menu.findItem(R.id.dsds)
|
||||
dsds.isVisible = true
|
||||
|
|
Loading…
Reference in a new issue