chore: cleanup #81
5 changed files with 8 additions and 7 deletions
|
@ -38,8 +38,8 @@ class OmapiApduInterface(
|
|||
check(!this::lastChannel.isInitialized) {
|
||||
"Can only open one channel"
|
||||
}
|
||||
lastChannel = session.openLogicalChannel(aid)!!;
|
||||
return 1;
|
||||
lastChannel = session.openLogicalChannel(aid)!!
|
||||
return 1
|
||||
}
|
||||
|
||||
override fun logicalChannelClose(handle: Int) {
|
||||
|
|
|
@ -109,7 +109,7 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean =
|
||||
when (item.itemId) {
|
||||
R.id.settings -> {
|
||||
startActivity(Intent(this, SettingsActivity::class.java));
|
||||
startActivity(Intent(this, SettingsActivity::class.java))
|
||||
true
|
||||
}
|
||||
R.id.reload -> {
|
||||
|
|
|
@ -39,7 +39,7 @@ class TelephonyManagerApduInterface(
|
|||
val hex = aid.encodeHex()
|
||||
val channel = tm.iccOpenLogicalChannelByPortCompat(port.card.physicalSlotIndex, port.portIndex, hex, 0)
|
||||
if (channel.status != IccOpenLogicalChannelResponse.STATUS_NO_ERROR || channel.channel == IccOpenLogicalChannelResponse.INVALID_CHANNEL) {
|
||||
throw IllegalArgumentException("Cannot open logical channel $hex via TelephonManager on slot ${port.card.physicalSlotIndex} port ${port.portIndex}");
|
||||
throw IllegalArgumentException("Cannot open logical channel $hex via TelephonManager on slot ${port.card.physicalSlotIndex} port ${port.portIndex}")
|
||||
}
|
||||
lastChannel = channel.channel
|
||||
return lastChannel
|
||||
|
|
|
@ -94,6 +94,7 @@ val TelephonyManager.uiccCardsInfoCompat: List<RealUiccCardInfoCompat>
|
|||
fun TelephonyManager.iccOpenLogicalChannelByPortCompat(
|
||||
slotIndex: Int, portIndex: Int, aid: String?, p2: Int
|
||||
): IccOpenLogicalChannelResponse =
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
iccOpenLogicalChannelByPort(slotIndex, portIndex, aid, p2)!!
|
||||
} else {
|
||||
|
|
|
@ -16,9 +16,9 @@ android {
|
|||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
cFlags(
|
||||
"-fmacro-prefix-map=${project.projectDir.toString()}=/fake/path/",
|
||||
"-fdebug-prefix-map=${project.projectDir.toString()}=/fake/path/",
|
||||
"-ffile-prefix-map=${project.projectDir.toString()}=/fake/path/"
|
||||
"-fmacro-prefix-map=${project.projectDir}=/fake/path/",
|
||||
"-fdebug-prefix-map=${project.projectDir}=/fake/path/",
|
||||
"-ffile-prefix-map=${project.projectDir}=/fake/path/"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue