Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89d59314 authored by Shivakumar Neginal's avatar Shivakumar Neginal
Browse files

[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
parent f0f06ed2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);
    }