自注冊DM(四)CMCC移動DM 實現方法
-
自注冊在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 = 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:
-
}
-
}
-
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)