Remove /activeProfile + /disableActiveProfile
This commit is contained in:
@@ -106,11 +106,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
// out (many, can be empty): string iccid, bool isEnabled, string name, string nickname
|
// out (many, can be empty): string iccid, bool isEnabled, string name, string nickname
|
||||||
rows = handleGetProfiles(args);
|
rows = handleGetProfiles(args);
|
||||||
break;
|
break;
|
||||||
case "activeProfile":
|
|
||||||
// in: int slotId, int portId
|
|
||||||
// out (single, can be empty): string iccid, bool isEnabled, string name, string nickname
|
|
||||||
rows = handleGetActiveProfile(args);
|
|
||||||
break;
|
|
||||||
case "downloadProfile":
|
case "downloadProfile":
|
||||||
// in: int slotId, int portId, (either {string activationCode} or {string address, string? matchingId}), string? confirmationCode, string? imei
|
// in: int slotId, int portId, (either {string activationCode} or {string address, string? matchingId}), string? confirmationCode, string? imei
|
||||||
// out (single, can be empty): string iccid, bool isEnabled, string name, string nickname
|
// out (single, can be empty): string iccid, bool isEnabled, string name, string nickname
|
||||||
@@ -131,11 +126,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
// out: bool success
|
// out: bool success
|
||||||
rows = handleDisableProfile(args);
|
rows = handleDisableProfile(args);
|
||||||
break;
|
break;
|
||||||
case "disableActiveProfile":
|
|
||||||
// in: int slotId, int portId, bool refresh=true
|
|
||||||
// out: bool success
|
|
||||||
rows = handleDisableActiveProfile(args);
|
|
||||||
break;
|
|
||||||
case "switchProfile":
|
case "switchProfile":
|
||||||
// in: int slotId, int portId, string iccid, bool enable=true, bool refresh=true
|
// in: int slotId, int portId, string iccid, bool enable=true, bool refresh=true
|
||||||
// out: bool success
|
// out: bool success
|
||||||
@@ -245,22 +235,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
return profiles(profiles);
|
return profiles(profiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MatrixCursor handleGetActiveProfile(Map<String, String> args) throws Exception
|
|
||||||
{
|
|
||||||
List<LocalProfileInfo> profiles = withEuiccChannel
|
|
||||||
(
|
|
||||||
args,
|
|
||||||
(channel, _) -> channel.getLpa().getProfiles()
|
|
||||||
);
|
|
||||||
|
|
||||||
var enabledProfile = LPAUtilsKt.getEnabled(profiles);
|
|
||||||
|
|
||||||
if (enabledProfile == null)
|
|
||||||
return empty();
|
|
||||||
|
|
||||||
return profile(enabledProfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
private MatrixCursor handleDownloadProfile(Map<String, String> args) throws Exception
|
private MatrixCursor handleDownloadProfile(Map<String, String> args) throws Exception
|
||||||
{
|
{
|
||||||
String[] address = new String[1];
|
String[] address = new String[1];
|
||||||
@@ -421,41 +395,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
return success(success);
|
return success(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MatrixCursor handleDisableActiveProfile(Map<String, String> args) throws Exception
|
|
||||||
{
|
|
||||||
boolean[] refresh = new boolean[1];
|
|
||||||
|
|
||||||
if (!tryGetArgAsBoolean(args, "refresh", refresh))
|
|
||||||
refresh[0] = true;
|
|
||||||
|
|
||||||
String iccid = withEuiccChannel
|
|
||||||
(
|
|
||||||
args,
|
|
||||||
(channel, _) -> LPAUtilsKt.disableActiveProfileKeepIccId(channel.getLpa(), refresh[0])
|
|
||||||
);
|
|
||||||
|
|
||||||
return success();
|
|
||||||
|
|
||||||
// if (iccid == null)
|
|
||||||
// return empty();
|
|
||||||
|
|
||||||
// List<LocalProfileInfo> profiles = withEuiccChannel
|
|
||||||
// (
|
|
||||||
// args,
|
|
||||||
// (channel, _) -> channel.getLpa().getProfiles()
|
|
||||||
// );
|
|
||||||
|
|
||||||
// var profile = profiles.stream()
|
|
||||||
// .filter(p -> iccid.equals(p.getIccid()))
|
|
||||||
// .findFirst()
|
|
||||||
// .get();
|
|
||||||
|
|
||||||
// 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
|
||||||
{
|
{
|
||||||
String[] iccid = new String[1];
|
String[] iccid = new String[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user