Reorder /activeProfile handler
This commit is contained in:
@@ -106,6 +106,11 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
// out (many, can be empty): iccid, isEnabled, name, nickname
|
// out (many, can be empty): iccid, isEnabled, name, nickname
|
||||||
rows = handleGetProfiles(args);
|
rows = handleGetProfiles(args);
|
||||||
break;
|
break;
|
||||||
|
case "activeProfile":
|
||||||
|
// in: slotId, portId
|
||||||
|
// out (single, can be empty): iccid, isEnabled, name, nickname
|
||||||
|
rows = handleGetActiveProfile(args);
|
||||||
|
break;
|
||||||
case "downloadProfile":
|
case "downloadProfile":
|
||||||
// in: (slotId, portId) AND (activationCode OR address, matchingId?, confirmationCode?) AND imei?
|
// in: (slotId, portId) AND (activationCode OR address, matchingId?, confirmationCode?) AND imei?
|
||||||
// out (single, can be empty): iccid, isEnabled, name, nickname
|
// out (single, can be empty): iccid, isEnabled, name, nickname
|
||||||
@@ -126,11 +131,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
// out: success
|
// out: success
|
||||||
rows = handleDisableProfile(args);
|
rows = handleDisableProfile(args);
|
||||||
break;
|
break;
|
||||||
case "activeProfile":
|
|
||||||
// in: slotId, portId
|
|
||||||
// out (single, can be empty): iccid, isEnabled, name, nickname
|
|
||||||
rows = handleGetActiveProfile(args);
|
|
||||||
break;
|
|
||||||
case "disableActiveProfile":
|
case "disableActiveProfile":
|
||||||
// in: slotId, portId, refresh(true)
|
// in: slotId, portId, refresh(true)
|
||||||
// out: success
|
// out: success
|
||||||
@@ -245,6 +245,22 @@ 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];
|
||||||
@@ -405,22 +421,6 @@ public class LpaBridgeProvider extends ContentProvider
|
|||||||
return success(success);
|
return success(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 handleDisableActiveProfile(Map<String, String> args) throws Exception
|
private MatrixCursor handleDisableActiveProfile(Map<String, String> args) throws Exception
|
||||||
{
|
{
|
||||||
boolean[] refresh = new boolean[1];
|
boolean[] refresh = new boolean[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user