From 8d364a7fbc98d8cb6240373f4cf0d94a9bc760ce Mon Sep 17 00:00:00 2001 From: Laiteux Date: Fri, 31 Oct 2025 12:55:54 +0400 Subject: [PATCH] Reorder /activeProfile handler --- .../openeuicc/bridge/LpaBridgeProvider.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/im/angry/openeuicc/bridge/LpaBridgeProvider.java b/src/im/angry/openeuicc/bridge/LpaBridgeProvider.java index 7c54feb..d5cdb36 100644 --- a/src/im/angry/openeuicc/bridge/LpaBridgeProvider.java +++ b/src/im/angry/openeuicc/bridge/LpaBridgeProvider.java @@ -106,6 +106,11 @@ public class LpaBridgeProvider extends ContentProvider // out (many, can be empty): iccid, isEnabled, name, nickname rows = handleGetProfiles(args); break; + case "activeProfile": + // in: slotId, portId + // out (single, can be empty): iccid, isEnabled, name, nickname + rows = handleGetActiveProfile(args); + break; case "downloadProfile": // in: (slotId, portId) AND (activationCode OR address, matchingId?, confirmationCode?) AND imei? // out (single, can be empty): iccid, isEnabled, name, nickname @@ -126,11 +131,6 @@ public class LpaBridgeProvider extends ContentProvider // out: success rows = handleDisableProfile(args); break; - case "activeProfile": - // in: slotId, portId - // out (single, can be empty): iccid, isEnabled, name, nickname - rows = handleGetActiveProfile(args); - break; case "disableActiveProfile": // in: slotId, portId, refresh(true) // out: success @@ -245,6 +245,22 @@ public class LpaBridgeProvider extends ContentProvider return profiles(profiles); } + private MatrixCursor handleGetActiveProfile(Map args) throws Exception + { + List profiles = withEuiccChannel + ( + args, + (channel, _) -> channel.getLpa().getProfiles() + ); + + var enabledProfile = LPAUtilsKt.getEnabled(profiles); + + if (enabledProfile == null) + return empty(); + + return profile(enabledProfile); + } + private MatrixCursor handleDownloadProfile(Map args) throws Exception { String[] address = new String[1]; @@ -405,22 +421,6 @@ public class LpaBridgeProvider extends ContentProvider return success(success); } - private MatrixCursor handleGetActiveProfile(Map args) throws Exception - { - List profiles = withEuiccChannel - ( - args, - (channel, _) -> channel.getLpa().getProfiles() - ); - - var enabledProfile = LPAUtilsKt.getEnabled(profiles); - - if (enabledProfile == null) - return empty(); - - return profile(enabledProfile); - } - private MatrixCursor handleDisableActiveProfile(Map args) throws Exception { boolean[] refresh = new boolean[1];