首页 > 代码库 > Android 数据连接关闭的情况下如何让彩信发不出去

Android 数据连接关闭的情况下如何让彩信发不出去

alps\frameworks\base\services\java\com\android\server\ConnectivityService.java
如下2个函数的开头加入如下语句:
startUsingNetworkFeature()
startUsingNetworkFeatureGemini()


        int currentDataConnectionSimId = -1;
        if(FeatureOption.MTK_GEMINI_ENHANCEMENT == true){
            long currentDataConnectionMultiSimId =  Settings.System.getLong(mContext.getContentResolver(), Settings.System.GPRS_CONNECTION_SIM_SETTING, Settings.System.DEFAULT_SIM_NOT_SET);
            currentDataConnectionSimId = SIMInfo.getSlotById(mContext, currentDataConnectionMultiSimId);
        }else{
            currentDataConnectionSimId = Settings.System.getInt(mContext.getContentResolver(), GPRS_CONNECTION_SETTING, GPRS_CONNECTION_SETTING_DEFAULT) - 1;
        }


  if(currentDataConnectionSimId < 0){
                return Phone.APN_REQUEST_FAILED;
  }

Android 数据连接关闭的情况下如何让彩信发不出去