自注册DM(四)CMCC移动DM 实现方法

来源:互联网 发布:mysql的sequence 编辑:程序博客网 时间:2024/06/04 23:21
[java] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. 自注册在cmcc 终端测试查看结果,输入IMEI,选择时间时一定要范围大点 3月到10月 因为他的时间不准  
[java] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. 手机Debug模式也可以测试,测试时换卡就行,不用重起和刷机,最重要打开4G数据连接  
[java] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. getPhoneCount()   
  2. TelephonyManager    getPhoneCount()  
  3. getGsmDeviceId(int phoneId)   
  4. 1  SystemProperties.get("persist.radio.imei""");  
  5. 2  SystemProperties.get("persist.radio.imei1""");  
  6. getCdmaDeviceId()         
  7. SystemProperties.get("persist.radio.meid","");  
  8. getSubscriberId(int phoneId)      
  9. TelephonyManager    getSubscriberId(subId)  
  10. getIccId(int phoneId)     
  11. TelephonyManager    getSimSerialNumber(subId)  
  12. getDataState(int phoneId)     
  13. TelephonyManager    getDataState(subId)  
  14. getSimState(int phoneId)      
  15. TelephonyManager    getSimState(slotid)  
  16. getNetworkType(int phoneId)   
  17. TelephonyManager    getNetworkType(int subId)  
  18. getMasterPhoneId()    
  19. SubscriptionManager getPhoneId(int defDataSubId)  
  20. isInternationalNetworkRoaming(int phoneId)    
  21. TelephonyManager    isNetworkRoaming(subId)  
  22. getVoLTEState(int phoneId)    
  23. 参考后面实现  "  
  24. public int getVoLTEState(int phoneId) {  
  25.         int result = VOLTE_STATE_UNKNOWN;  
  26.         if (phoneId >= 0 && phoneId < 2) {  
  27.                 // phoneId specified in parameter list is actually slot ID  
  28.                 phoneId = SubscriptionManager.getPhoneId(getSubIdForSlotId(phoneId));  
  29.                 try {  
  30.                     Method method = ImsManager.class.getDeclaredMethod(  
  31.                         ""isEnhanced4gLteModeSettingEnabledByUser"",  
  32.                         Context.class,  
  33.                         Integer.class);  
  34.                     boolean enabled =  
  35.                         (Boolean) method.invoke(nullnew Object[]{mContext, phoneId});  
  36.                     result = enabled ? VOLTE_STATE_ON : VOLTE_STATE_OFF;  
  37.                 } catch (NoSuchMethodException e1) {  
  38.                     if (phoneId == 0) {  
  39.                         boolean enabled =  
  40.                             ImsManager.isEnhanced4gLteModeSettingEnabledByUser(mContext);  
  41.                         result = enabled ? VOLTE_STATE_ON : VOLTE_STATE_OFF;  
  42.                     } else {  
  43.                         result = VOLTE_STATE_UNKNOWN;  
  44.                     }  
  45.                 } catch (Exception e2) {  
  46.                     e2.printStackTrace();  
  47.                     result = VOLTE_STATE_UNKNOWN;  
  48.                 }  
  49.         }  
  50.         return result;  
  51.     }"  
  52. getAPNContentUri(int phoneId)     
  53. 参考后面实现    
  54. "public Uri getAPNContentUri(int phoneId) {  
  55.         String result = null;  
  56.         if (phoneId >= 0 && phoneId < 2) {  
  57.             int subId = getSubIdForSlotId(phoneId);  
  58.             if (subId >= 0) {  
  59.                 result = ""content://telephony/carriers/subId/"" + subId;  
  60.             }  
  61.         }  
  62.         MLog.d(""getContentUri("" + phoneId + ""): "" + result);  
  63.         return result == null ? null : Uri.parse(result);  
  64.     }"  
  65. getSlotId (int phoneId)       
  66. getCellId (int phoneId)       
  67. "CellLocation loc = TelephonyManager.getDefault().getCellLocationForSubscriber(slotId);  
  68.         if (loc instanceof GsmCellLocation) {  
  69.             CELLID :    ((GsmCellLocation)loc).getCid()  
  70.             LAC:          ((GsmCellLocation)loc).getLac()  
  71.         }"  
  72.           
  73.           
  74.           
  75.           
  76.     getLac (int phoneId)   
1 0
原创粉丝点击