Compare commits

..

1 commit

Author SHA1 Message Date
6bb05d910b [1/n] Add seId parameter to withEuiccChannel()
Defaults to 0 so that it doesn't break everything else.
2025-05-18 11:46:56 -04:00
4 changed files with 7 additions and 3 deletions

View file

@ -174,6 +174,7 @@ open class DefaultEuiccChannelManager(
override suspend fun <R> withEuiccChannel(
physicalSlotId: Int,
portId: Int,
seId: Int,
fn: suspend (EuiccChannel) -> R
): R {
val channel = findEuiccChannelByPort(physicalSlotId, portId)
@ -190,6 +191,7 @@ open class DefaultEuiccChannelManager(
override suspend fun <R> withEuiccChannel(
logicalSlotId: Int,
seId: Int,
fn: suspend (EuiccChannel) -> R
): R {
val channel = findEuiccChannelByLogicalSlot(logicalSlotId)

View file

@ -81,6 +81,7 @@ interface EuiccChannelManager {
suspend fun <R> withEuiccChannel(
physicalSlotId: Int,
portId: Int,
seId: Int = 0,
fn: suspend (EuiccChannel) -> R
): R
@ -89,6 +90,7 @@ interface EuiccChannelManager {
*/
suspend fun <R> withEuiccChannel(
logicalSlotId: Int,
seId: Int = 0,
fn: suspend (EuiccChannel) -> R
): R

View file

@ -92,7 +92,7 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
lifecycleScope.launch {
(infoList.adapter!! as EuiccInfoAdapter).euiccInfoItems =
euiccChannelManager.withEuiccChannel(logicalSlotId, ::buildEuiccInfoItems)
euiccChannelManager.withEuiccChannel(logicalSlotId, fn = ::buildEuiccInfoItems)
swipeRefresh.isRefreshing = false
}

View file

@ -80,7 +80,7 @@ apdu_interface_transmit(struct euicc_ctx *ctx, uint8_t **rx, uint32_t *rx_len, c
LPAC_JNI_EXCEPTION_RETURN;
*rx_len = (*env)->GetArrayLength(env, ret);
*rx = calloc(*rx_len, sizeof(uint8_t));
(*env)->GetByteArrayRegion(env, ret, 0, *rx_len, (jbyte *) *rx);
(*env)->GetByteArrayRegion(env, ret, 0, *rx_len, *rx);
(*env)->DeleteLocalRef(env, txArr);
(*env)->DeleteLocalRef(env, ret);
return 0;
@ -113,7 +113,7 @@ http_interface_transmit(struct euicc_ctx *ctx, const char *url, uint32_t *rcode,
jbyteArray rxArr = (jbyteArray) (*env)->GetObjectField(env, ret, field_resp_data);
*rx_len = (*env)->GetArrayLength(env, rxArr);
*rx = calloc(*rx_len, sizeof(uint8_t));
(*env)->GetByteArrayRegion(env, rxArr, 0, *rx_len, (jbyte *) *rx);
(*env)->GetByteArrayRegion(env, rxArr, 0, *rx_len, *rx);
(*env)->DeleteLocalRef(env, txArr);
(*env)->DeleteLocalRef(env, rxArr);
(*env)->DeleteLocalRef(env, headersArr);