Android 测试工具类
2010-02-09 03:51:00 来源:WEB开发网int simState = telMgr.getSimState();
String simStateString = "NA";
switch (simState) {
case TelephonyManager.SIM_STATE_ABSENT:
simStateString = "ABSENT";
break;
case TelephonyManager.SIM_STATE_NETWORK_LOCKED:
simStateString = "NETWORK_LOCKED";
break;
case TelephonyManager.SIM_STATE_PIN_REQUIRED:
simStateString = "PIN_REQUIRED";
break;
case TelephonyManager.SIM_STATE_PUK_REQUIRED:
simStateString = "PUK_REQUIRED";
break;
case TelephonyManager.SIM_STATE_READY:
simStateString = "STATE_READY";
break;
case TelephonyManager.SIM_STATE_UNKNOWN:
simStateString = "STATE_UNKNOWN";
break;
}
StringBuilder sb = new StringBuilder();
sb.append("telMgr - ");
sb.append(" callState = " + callStateString);
sb.append(" cellLocationString = " + cellLocationString);
sb.append(" deviceId = " + deviceId);
sb.append(" deviceSoftwareVersion = " + deviceSoftwareVersion);
sb.append(" line1Number = " + line1Number);
sb.append(" networkCountryIso = " + networkCountryIso);
sb.append(" networkOperator = " + networkOperator);
sb.append(" networkOperatorName = " + networkOperatorName);
sb.append(" phoneTypeString = " + phoneTypeString);
sb.append(" simCountryIso = " + simCountryIso);
sb.append(" simOperator = " + simOperator);
sb.append(" simOperatorName = " + simOperatorName);
sb.append(" simSerialNumber = " + simSerialNumber);
sb.append(" simSubscriberId = " + simSubscriberId);
sb.append(" simStateString = " + simStateString);
return sb.toString();
}
}
更多精彩
赞助商链接