/disableActiveProfile will not return profile() anymore but success()

This commit is contained in:
Laiteux
2025-10-31 12:54:54 +04:00
parent 50ebb580d1
commit 2ced5f3642

View File

@@ -133,7 +133,7 @@ public class LpaBridgeProvider extends ContentProvider
break; break;
case "disableActiveProfile": case "disableActiveProfile":
// in: slotId, portId, refresh(true) // in: slotId, portId, refresh(true)
// out (single, can be empty): iccid, isEnabled, name, nickname // out: success
rows = handleDisableActiveProfile(args); rows = handleDisableActiveProfile(args);
break; break;
case "switchProfile": case "switchProfile":
@@ -434,24 +434,26 @@ public class LpaBridgeProvider extends ContentProvider
(channel, _) -> LPAUtilsKt.disableActiveProfileKeepIccId(channel.getLpa(), refresh[0]) (channel, _) -> LPAUtilsKt.disableActiveProfileKeepIccId(channel.getLpa(), refresh[0])
); );
if (iccid == null) return success();
return empty();
List<LocalProfileInfo> profiles = withEuiccChannel // if (iccid == null)
( // return empty();
args,
(channel, _) -> channel.getLpa().getProfiles()
);
var profile = profiles.stream() // List<LocalProfileInfo> profiles = withEuiccChannel
.filter(p -> p.getIccid().equals(iccid)) // (
.findFirst() // args,
.orElse(null); // should never be null // (channel, _) -> channel.getLpa().getProfiles()
// );
if (profile == null) // var profile = profiles.stream()
return empty(); // .filter(p -> iccid.equals(p.getIccid()))
// .findFirst()
// .get();
return profile(profile); // if (profile == null)
// return empty();
// return profile(profile);
} }
private MatrixCursor handleSwitchProfile(Map<String, String> args) throws Exception private MatrixCursor handleSwitchProfile(Map<String, String> args) throws Exception