Android API 23及以上版本无法发送mms startUsingNetworkfeature已删除

时间:2017-10-20 23:33:11

标签: android sdk mms

发送mms失败,因为删除了startUsingNetworkFeature我找不到与此相关的任何内容。

protected int beginMmsConnectivity() throws IOException {
        if (LOCAL_LOGV) Log.v(TAG, "beginMmsConnectivity");
        // Take a wake lock so we don't fall asleep before the message is downloaded.
        createWakeLock();


        int result = mConnMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, "enableMMS");
        NetworkInfo info = mConnMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE_MMS);

        if (LOCAL_LOGV) Log.v(TAG, "beginMmsConnectivity: result=" + result);

        switch (result) {
            case PhoneConstants.APN_ALREADY_ACTIVE:
            case PhoneConstants.APN_REQUEST_STARTED:
                acquireWakeLock();
                return result;
        }


        throw new IOException("Cannot establish MMS connectivity");
    }

0 个答案:

没有答案