Code example for TelephonyManager

Methods: getSimState

0
     * 检查sim卡的状态 
     * @param tm 
     * @return 
     */ 
    private boolean checkSimCardState(TelephonyManager tm){
        int simState = tm.getSimState();
        switch (simState) {
        case TelephonyManager.SIM_STATE_ABSENT:
        	return false; 
        case TelephonyManager.SIM_STATE_NETWORK_LOCKED:
        	return true; 
        case TelephonyManager.SIM_STATE_PIN_REQUIRED:
        	return true; 
        case TelephonyManager.SIM_STATE_PUK_REQUIRED:
        	return true; 
        case TelephonyManager.SIM_STATE_READY:
        	return true; 
        case TelephonyManager.SIM_STATE_UNKNOWN:
        	return false; 
        default: 
            return false;