- 自注册在cmcc 终端测试查看结果,输入IMEI,选择时间时一定要范围大点 3月到10月 因为他的时间不准
- 手机Debug模式也可以测试,测试时换卡就行,不用重起和刷机,最重要打开4G数据连接
- getPhoneCount()
- TelephonyManager getPhoneCount()
- getGsmDeviceId(int phoneId)
- 卡1 SystemProperties.get("persist.radio.imei", "");
- 卡2 SystemProperties.get("persist.radio.imei1", "");
- getCdmaDeviceId()
- SystemProperties.get("persist.radio.meid","");
- getSubscriberId(int phoneId)
- TelephonyManager getSubscriberId(subId)
- getIccId(int phoneId)
- TelephonyManager getSimSerialNumber(subId)
- getDataState(int phoneId)
- TelephonyManager getDataState(subId)
- getSimState(int phoneId)
- TelephonyManager getSimState(slotid)
- getNetworkType(int phoneId)
- TelephonyManager getNetworkType(int subId)
- getMasterPhoneId()
- SubscriptionManager getPhoneId(int defDataSubId)
- isInternationalNetworkRoaming(int phoneId)
- TelephonyManager isNetworkRoaming(subId)
- getVoLTEState(int phoneId)
- 参考后面实现 "
- public int getVoLTEState(int phoneId) {
- int result = VOLTE_STATE_UNKNOWN;
- if (phoneId >= 0 && phoneId < 2) {
- // phoneId specified in parameter list is actually slot ID
- phoneId = SubscriptionManager.getPhoneId(getSubIdForSlotId(phoneId));
- try {
- Method method = ImsManager.class.getDeclaredMethod(
- ""isEnhanced4gLteModeSettingEnabledByUser"",
- Context.class,
- Integer.class);
- boolean enabled =
- (Boolean) method.invoke(null, new Object[]{mContext, phoneId});
- result = enabled ? VOLTE_STATE_ON : VOLTE_STATE_OFF;
- } catch (NoSuchMethodException e1) {
- if (phoneId == 0) {
- boolean enabled =
- ImsManager.isEnhanced4gLteModeSettingEnabledByUser(mContext);
- result = enabled ? VOLTE_STATE_ON : VOLTE_STATE_OFF;
- } else {
- result = VOLTE_STATE_UNKNOWN;
- }
- } catch (Exception e2) {
- e2.printStackTrace();
- result = VOLTE_STATE_UNKNOWN;
- }
- }
- return result;
- }"
- getAPNContentUri(int phoneId)
- 参考后面实现
- "public Uri getAPNContentUri(int phoneId) {
- String result = null;
- if (phoneId >= 0 && phoneId < 2) {
- int subId = getSubIdForSlotId(phoneId);
- if (subId >= 0) {
- result = ""content://telephony/carriers/subId/"" + subId;
- }
- }
- MLog.d(""getContentUri("" + phoneId + ""): "" + result);
- return result == null ? null : Uri.parse(result);
- }"
- getSlotId (int phoneId)
- getCellId (int phoneId)
- "CellLocation loc = TelephonyManager.getDefault().getCellLocationForSubscriber(slotId);
- if (loc instanceof GsmCellLocation) {
- CELLID : ((GsmCellLocation)loc).getCid()
- LAC: ((GsmCellLocation)loc).getLac()
- }"
- getLac (int phoneId)