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

Commit 89109077 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Moved SimStateToString to TelephonyManager"

parents 95bb9692 fa925004
Loading
Loading
Loading
Loading
+41 −1
Original line number Original line Diff line number Diff line
@@ -17961,7 +17961,7 @@ public class TelephonyManager {
        return false;
        return false;
    }
    }
    /*
    /**
     * Returns the primary IMEI (International Mobile Equipment Identity) of the device as
     * 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
     * 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.
     * slotID whereas this API {@link #getPrimaryImei()} returns primary IMEI of the device.
@@ -18003,4 +18003,44 @@ public class TelephonyManager {
            throw ex.rethrowAsRuntimeException();
            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 + ")";
        }
    }
}
}