自注冊DM(四)CMCC移動DM 實現方法

[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)   
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章