[MEP] Refactor SlotSidecar API for all of sim page.
remove the SlotSidecar's run() and using new run() with port id information. Bug: 218439715 Test: manual test for UI Change-Id: I81479a0c514f2b8f58b9167b31d357f017732482
This commit is contained in:
@@ -80,29 +80,6 @@ public class SwitchToRemovableSlotSidecar extends EuiccOperationSidecar
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts switching to the removable slot. It disables the active eSIM profile before switching
|
||||
* if there is one.
|
||||
*
|
||||
* @param physicalSlotId removable physical SIM slot ID.
|
||||
*/
|
||||
// ToDo: delete this api and refactor the related code.
|
||||
public void run(int physicalSlotId) {
|
||||
mPhysicalSlotId = physicalSlotId;
|
||||
SubscriptionManager subscriptionManager =
|
||||
getContext().getSystemService(SubscriptionManager.class);
|
||||
if (SubscriptionUtil.getActiveSubscriptions(subscriptionManager).stream()
|
||||
.anyMatch(SubscriptionInfo::isEmbedded)) {
|
||||
// In SS mode, the esim is active, then inactivate the esim.
|
||||
Log.i(TAG, "There is an active eSIM profile. Disable the profile first.");
|
||||
// Use INVALID_SUBSCRIPTION_ID to disable the only active profile.
|
||||
mSwitchToSubscriptionSidecar.run(SubscriptionManager.INVALID_SUBSCRIPTION_ID, 0, null);
|
||||
} else {
|
||||
Log.i(TAG, "There is no active eSIM profiles. Start to switch to removable slot.");
|
||||
mSwitchSlotSidecar.runSwitchToRemovableSlot(mPhysicalSlotId, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts switching to the removable slot.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user