From 0007300277e13cc8fbd67799fe2ebfef3d4d2b1c Mon Sep 17 00:00:00 2001 From: Laiteux Date: Fri, 7 Nov 2025 23:44:56 +0400 Subject: [PATCH] Add `eid` to /cards --- .../angry/openeuicc/bridge/LpaProvider.java | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/im/angry/openeuicc/bridge/LpaProvider.java b/src/im/angry/openeuicc/bridge/LpaProvider.java index 1b44aaa..eda42ec 100644 --- a/src/im/angry/openeuicc/bridge/LpaProvider.java +++ b/src/im/angry/openeuicc/bridge/LpaProvider.java @@ -246,7 +246,8 @@ public class LpaProvider extends ContentProvider var rows = new MatrixCursor(new String[] { "slotId", - "portId" + "portId", + "eid" }); for (UiccCardInfoCompat card : cards) @@ -263,10 +264,18 @@ public class LpaProvider extends ContentProvider if (euiccChannel != null) { + String eid = withEuiccChannel + ( + slotId, + portId, + (channel, _) -> channel.getLpa().getEID() + ); + rows.addRow(new Object[] { slotId, - portId + portId, + eid }); } } @@ -485,19 +494,24 @@ public class LpaProvider extends ContentProvider } @SuppressWarnings("unchecked") + private T withEuiccChannel(int slotId, int portId, Function2, ?> operation) throws Exception + { + var euiccChannelManager = appContainer.getEuiccChannelManager(); + + return (T) BuildersKt.runBlocking + ( + EmptyCoroutineContext.INSTANCE, + (_, continuation) -> euiccChannelManager.withEuiccChannel(slotId, portId, operation, continuation) + ); + } + private T withEuiccChannel(Map args, Function2, ?> operation) throws Exception { var slotId = new int[1]; var portId = new int[1]; requireSlotAndPort(args, slotId, portId); - var euiccChannelManager = appContainer.getEuiccChannelManager(); - - return (T) BuildersKt.runBlocking - ( - EmptyCoroutineContext.INSTANCE, - (_, continuation) -> euiccChannelManager.withEuiccChannel(slotId[0], portId[0], operation, continuation) - ); + return withEuiccChannel(slotId[0], portId[0], operation); } private List getProfiles(Map args) throws Exception