[eSIM] Get sim state for active port index instead of DEFAULT_PORT_INDEX 0.
MEP device port 0 might not be active(no valid logical slot index).Instead we should find any active port to check the card state. Bug: 228407530 Test: manual, atest FrameworksTelephonyTests Change-Id: Ib7fcc345431473a2d95a82fa827f11928aa58fc4
This commit is contained in:
@@ -3582,7 +3582,8 @@ public class TelephonyManager {
|
||||
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||
@Deprecated
|
||||
public @SimState int getSimCardState(int physicalSlotIndex) {
|
||||
int simState = getSimState(getLogicalSlotIndex(physicalSlotIndex, DEFAULT_PORT_INDEX));
|
||||
int activePort = getFirstActivePortIndex(physicalSlotIndex);
|
||||
int simState = getSimState(getLogicalSlotIndex(physicalSlotIndex, activePort));
|
||||
return getSimCardStateFromSimState(simState);
|
||||
}
|
||||
|
||||
@@ -3688,9 +3689,10 @@ public class TelephonyManager {
|
||||
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||
@Deprecated
|
||||
public @SimState int getSimApplicationState(int physicalSlotIndex) {
|
||||
int activePort = getFirstActivePortIndex(physicalSlotIndex);
|
||||
int simState =
|
||||
SubscriptionManager.getSimStateForSlotIndex(getLogicalSlotIndex(physicalSlotIndex,
|
||||
DEFAULT_PORT_INDEX));
|
||||
activePort));
|
||||
return getSimApplicationStateFromSimState(simState);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user