@Override
  public void selectNetworkManually(OperatorInfo network, Message response) {
    // wrap the response message in our own message along with
    // the operator's id.
    NetworkSelectMessage nsm = new NetworkSelectMessage();
    nsm.message = response;
    nsm.operatorNumeric = network.getOperatorNumeric();
    nsm.operatorAlphaLong = network.getOperatorAlphaLong();

    // get the message
    Message msg = obtainMessage(EVENT_SET_NETWORK_MANUAL_COMPLETE, nsm);

    mCi.setNetworkSelectionModeManual(network.getOperatorNumeric(), msg);
  }
예제 #2
0
 /**
  * If user insert CU card, set CMCC/CT operator networks as forbidden.
  *
  * @param operatorInfoList old operatorInfoList
  * @param subId The sub id user selected
  * @return new list OperatorInfo
  */
 @Override
 public List<OperatorInfo> customizeNetworkList(List<OperatorInfo> operatorInfoList, long subId) {
   if (operatorInfoList == null || operatorInfoList.size() == 0) {
     Log.d(TAG, "customizeNetworkList return null list");
     return operatorInfoList;
   }
   String iccNumeric;
   TelephonyManager telephonyManager =
       (TelephonyManager) mOp02Context.getSystemService(Context.TELEPHONY_SERVICE);
   iccNumeric = telephonyManager.getSimOperator(subId);
   Log.d(TAG, "customizeNetworkList subId" + subId + ", iccNumeric=" + iccNumeric);
   if (iccNumeric == null
       || (!iccNumeric.equals(CU_NUMERIC_1) && !iccNumeric.equals(CU_NUMERIC_2))) {
     return operatorInfoList;
   }
   String cmccOpName =
       mOp02Context.getResources().getString(com.mediatek.R.string.oper_long_46000);
   String ctOpName = mOp02Context.getResources().getString(com.mediatek.R.string.oper_long_46003);
   List<OperatorInfo> newOPInfoList = new ArrayList<OperatorInfo>(operatorInfoList.size());
   for (OperatorInfo operatorInfo : operatorInfoList) {
     Log.d(TAG, "customizeNetworkList operatorInfo=" + operatorInfo.toString());
     // CT new 4G network is under testing, its network alphalong name is "46011 4G"
     // and does not follow 3gpp spec to return forbidden
     // when CU card performs network search.
     // We need to check this network and set it as forbidden here
     if (operatorInfo.getOperatorAlphaLong().contains(cmccOpName)
         || operatorInfo.getOperatorAlphaLong().contains(ctOpName)
         || operatorInfo.getOperatorAlphaLong().contains(CT_4G_NUMERIC)
         || operatorInfo.getOperatorAlphaLong().contains(GSM_R)) {
       newOPInfoList.add(
           new OperatorInfo(
               operatorInfo.getOperatorAlphaLong(),
               operatorInfo.getOperatorAlphaShort(),
               operatorInfo.getOperatorNumeric(),
               "forbidden"));
     } else {
       newOPInfoList.add(operatorInfo);
     }
     Log.d(TAG, " last customizeNetworkList operatorInfo=" + operatorInfo.toString());
   }
   return newOPInfoList;
 }
예제 #3
0
  @Override
  public boolean onPreferenceTreeClick(OperatorInfo operatorInfo, long subId) {
    String iccNumeric;
    TelephonyManager telephonyManager =
        (TelephonyManager) mOp02Context.getSystemService(Context.TELEPHONY_SERVICE);
    iccNumeric = telephonyManager.getSimOperator(subId);
    Log.d(TAG, "customizeHideForbiddenNetworkList subId" + subId + ", iccNumeric=" + iccNumeric);
    if (iccNumeric == null
        || (!iccNumeric.equals(CU_NUMERIC_1) && !iccNumeric.equals(CU_NUMERIC_2))) {
      return false;
    }

    if (operatorInfo.getState() == OperatorInfo.State.FORBIDDEN) {
      Log.i(TAG, "toast a dialog");
      Toast.makeText(mOp02Context, mOp02Context.getString(R.string.network_do_not_register), 1)
          .show();
      return true;
    }

    return false;
  }