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

Commit fa925004 authored by Jack Yu's avatar Jack Yu
Browse files

Moved SimStateToString to TelephonyManager

Bug: 239607619
Test: Manual
Change-Id: I70ed2d0cc5e584311a86d52199ae00516f0b7b8d
parent 87bf4f3b
Loading
Loading
Loading
Loading
+41 −1
Original line number Diff line number Diff line
@@ -17961,7 +17961,7 @@ public class TelephonyManager {
        return false;
    }
    /*
    /**
     * Returns the primary IMEI (International Mobile Equipment Identity) of the device as
     * mentioned in GSMA TS.37. {@link #getImei(int)} returns the IMEI that belongs to the selected
     * slotID whereas this API {@link #getPrimaryImei()} returns primary IMEI of the device.
@@ -18003,4 +18003,44 @@ public class TelephonyManager {
            throw ex.rethrowAsRuntimeException();
        }
    }
    /**
     * Convert SIM state into string.
     *
     * @param state SIM state.
     * @return SIM state in string format.
     *
     * @hide
     */
    @NonNull
    public static String simStateToString(@SimState int state) {
        switch (state) {
            case TelephonyManager.SIM_STATE_UNKNOWN:
                return "UNKNOWN";
            case TelephonyManager.SIM_STATE_ABSENT:
                return "ABSENT";
            case TelephonyManager.SIM_STATE_PIN_REQUIRED:
                return "PIN_REQUIRED";
            case TelephonyManager.SIM_STATE_PUK_REQUIRED:
                return "PUK_REQUIRED";
            case TelephonyManager.SIM_STATE_NETWORK_LOCKED:
                return "NETWORK_LOCKED";
            case TelephonyManager.SIM_STATE_READY:
                return "READY";
            case TelephonyManager.SIM_STATE_NOT_READY:
                return "NOT_READY";
            case TelephonyManager.SIM_STATE_PERM_DISABLED:
                return "PERM_DISABLED";
            case TelephonyManager.SIM_STATE_CARD_IO_ERROR:
                return "CARD_IO_ERROR";
            case TelephonyManager.SIM_STATE_CARD_RESTRICTED:
                return "CARD_RESTRICTED";
            case TelephonyManager.SIM_STATE_LOADED:
                return "LOADED";
            case TelephonyManager.SIM_STATE_PRESENT:
                return "PRESENT";
            default:
                return "UNKNOWN(" + state + ")";
        }
    }
}