[Android P][Network data][Notes1]DcTracker setDataProfile 判断APN modemCognitive and requestNetwork set mApnSetting

一、setDataProfile(apn.modemCognitive->??aosp apn not invoke setDataProfilesAsNeeded??):
DcTracker.setDataProfilesAsNeeded
    ->for (ApnSetting apn : mAllApnSettings) {
    ->if (apn.modemCognitive) {
    ->...->RIL.setDataProfile->RIL_REQUEST_SET_DATA_PROFILE->...->ril_service.cpp
->RadioImpl::setDataProfile->RIL_REQUEST_SET_DATA_PROFILE->...->reference-ril.c.onRequest->??

Telephony.Carriers.MODEM_COGNITIVE:
        /**
         * Is the apn setting to be set in modem
         * <P>Type: INTEGER (boolean)</P>
         *@hide
         */
        public static final String MODEM_COGNITIVE = "modem_cognitive";

(setModemCognitive:
DevicePolicyManager.getOverrideApns->DevicePolicyManagerService.getOverrideApns
->getOverrideApnsUnchecked->ApnSetting.makeApnSetting->setModemCognitive)

二、requestNetwork set mApnSetting(from APN_TYPE_DUN/mAllApnSettings):
DcTracker.requestNetwork->...->trySetupData
    ->int radioTech = mPhone.getServiceState().getRilDataRadioTechnology();
    ->ArrayList<ApnSetting> waitingApns =
                        buildWaitingApns(apnContext.getApnType(), radioTech);
->...(APN_TYPE_DUN/mPreferredApn/mAllApnSettings(
        ->for (ApnSetting apn : mAllApnSettings) {
        ->if (apn.canHandleType(requestedApnType)) {
        ->ServiceState.bitmaskHasTech(apn.networkTypeBitmask,
                            ServiceState.rilRadioTechnologyToNetworkType(radioTech))))
    ->apnContext.setWaitingApns(waitingApns);->RetryManager.setWaitingApns->mWaitingApns
    ->setupData
        ->apnSetting = apnContext.getNextApnSetting();->RetryManager.getNextApnSetting->mWaitingApns.get
        ->apnContext.setApnSetting(apnSetting);->apnContext.mApnSetting

mPreferredApn(from apnContext.getApnSetting):
DcTracker.requestNetwork->...->setupData->EVENT_DATA_SETUP_COMPLETE->...->onDataSetupComplete
    ->ApnSetting apn = apnContext.getApnSetting();->ApnContext.mApnSetting
    ->mPreferredApn = apn;
    ->setPreferredApn(mPreferredApn.id)

buildWaitingApns:
    /**
     * Build a list of APNs to be used to create PDP‘s.
    private ArrayList<ApnSetting> buildWaitingApns(String requestedApnType, int radioTech) {

setupDataCall mApnSetting(from apnContext.getApnSetting):
DataConnection.DcInactiveState.processMessage->EVENT_CONNECT
    ->initConnection->mApnSetting = apnContext.getApnSetting();->ApnContext.mApnSetting
    ->onConnect(ConnectionParams cp)
        ->DataProfile dp = DcTracker.createDataProfile(mApnSetting, cp.mProfileId);
        ->DataServiceManager.setupDataCall(dp)->...->RIL.setupDataCall(DataProfile dataProfile)
            ->// Convert to HAL data profile
                    DataProfileInfo dpi = convertToHalDataProfile(dataProfile);
            ->radioProxy.setupDataCall(rr.mSerial, dataRat, dpi,
                                    dataProfile.isModemCognitive())

mRilDataRadioTechnology(getRilDataRadioTechnology):
ServiceStateTracker.EVENT_POLL_STATE_GPRS
    ->NetworkRegistrationState networkRegState = (NetworkRegistrationState) ar.result;
    ->int newDataRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());->mAccessNetworkTechnology
    ->ServiceState.setRilDataRadioTechnology(newDataRat)->this.mRilDataRadioTechnology = newDataRat;<-getRilDataRadioTechnology

NetworkRegistrationState.mAccessNetworkTechnology(from mCi):
CellularNetworkService.getNetworkRegistrationState->mPhone.mCi.getDataRegistrationState->GET_PS_REGISTRATION_STATE_DONE
->...->getRegistrationStateFromResult->createRegistrationStateFromDataRegState(Object result)
    ->if (result instanceof android.hardware.radio.V1_0.DataRegStateResult) {
    ->android.hardware.radio.V1_0.DataRegStateResult dataRegState =
                        (android.hardware.radio.V1_0.DataRegStateResult) result;
    ->int accessNetworkTechnology = getAccessNetworkTechnologyFromRat(dataRegState.rat);->ServiceState.rilRadioTechnologyToNetworkType(rilRat)
    ->return new NetworkRegistrationState(transportType, domain, regState,
                        accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices,
                        cellIdentity, maxDataCalls);->mAccessNetworkTechnology = accessNetworkTechnology;
    ->...(V1_2)

(ServiceStateTracker.pollState
    ->mRegStateManagers.get(AccessNetworkConstants.TransportType.WWAN)
                        .getNetworkRegistrationState(NetworkRegistrationState.DOMAIN_PS,
                        obtainMessage(EVENT_POLL_STATE_GPRS, mPollingContext));
private final SparseArray<NetworkRegistrationManager> mRegStateManagers = new SparseArray<>();
NetworkRegistrationManager)

ServiceState
    public static int rilRadioTechnologyToNetworkType(@RilRadioTechnology int rt) {
        switch(rt) {
        case ServiceState.RIL_RADIO_TECHNOLOGY_GPRS:
            return TelephonyManager.NETWORK_TYPE_GPRS;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EDGE:
            return TelephonyManager.NETWORK_TYPE_EDGE;
        case ServiceState.RIL_RADIO_TECHNOLOGY_UMTS:
            return TelephonyManager.NETWORK_TYPE_UMTS;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSDPA:
            return TelephonyManager.NETWORK_TYPE_HSDPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSUPA:
            return TelephonyManager.NETWORK_TYPE_HSUPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPA:
            return TelephonyManager.NETWORK_TYPE_HSPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95A:
        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95B:
            return TelephonyManager.NETWORK_TYPE_CDMA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT:
            return TelephonyManager.NETWORK_TYPE_1xRTT;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0:
            return TelephonyManager.NETWORK_TYPE_EVDO_0;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A:
            return TelephonyManager.NETWORK_TYPE_EVDO_A;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B:
            return TelephonyManager.NETWORK_TYPE_EVDO_B;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD:
            return TelephonyManager.NETWORK_TYPE_EHRPD;
        case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
            return TelephonyManager.NETWORK_TYPE_LTE;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
            return TelephonyManager.NETWORK_TYPE_HSPAP;
        case ServiceState.RIL_RADIO_TECHNOLOGY_GSM:
            return TelephonyManager.NETWORK_TYPE_GSM;
        case ServiceState.RIL_RADIO_TECHNOLOGY_TD_SCDMA:
            return TelephonyManager.NETWORK_TYPE_TD_SCDMA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN:
            return TelephonyManager.NETWORK_TYPE_IWLAN;
        case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA:
            return TelephonyManager.NETWORK_TYPE_LTE_CA;
        default:
            return TelephonyManager.NETWORK_TYPE_UNKNOWN;
        }
    }

原文地址:https://www.cnblogs.com/sxjzhjj/p/12285849.html

时间: 2024-10-15 04:59:36

[Android P][Network data][Notes1]DcTracker setDataProfile 判断APN modemCognitive and requestNetwork set mApnSetting的相关文章

跟Google 学代码:Transmitting Network Data Using Volley

这篇博客讲了什么 全文脉络可以看这张思维导图: 准备工作 观看 youtube Google I/O 2013 - Volley: Easy, Fast Networking for Android 使用篇: git clone https://android.googlesource.com/platform/frameworks/volley clone到本地 在开发环境中添加Android Library 发送简单的Request 添加权限 使用newRequestQueue 发送 Req

[RxJS] Reactive Programming - Using cached network data with RxJS -- withLatestFrom()

So now we want to replace one user when we click the 'x' button. To do that, we want: 1. Get the cached network data for generating the userList. 2. Then get a random user from the cached data. 3. Showing the user in the list. We have the function to

Linux Http-Lua-Mode MsgPack(network data)

Location: clients -----|---->  proxy gate -----|---->  gserver ||nginx---------------->http-lua-mode nginx-net.api  ===>  URL .POST/GET.Socket and so on.....(role by web server) ||network data ==================================================

Android应用添加(创建)和删除及判断是否存在桌面快捷方式

Android应用添加(创建)和删除及判断是否存在桌面快捷方式-Android新手入门-eoe 移动开发者论坛 - Powered by Discuz! Android桌面程序提供了应用添加和删除桌面快捷方式的功能以及判断快捷方式是否存在, 只要传入快捷方式标题.图标及点击快捷方式执行的应用Intent即可.代码如下: 1.Android添加桌面快捷方式 /** * 为当前应用添加桌面快捷方式 * * @param cx * @param appName *            快捷方式名称

Android训练课程(Android Training) - 使用Volley传输网络数据(Transmitting Network Data Using Volley)

Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available through the open AOSP repository. Volley offers the following benefits: Automatic scheduling of network requests. Multiple concu

Transmitting Network Data Using Volley

Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available through the open AOSP repository. Volley offers the following benefits: Automatic scheduling of network requests. Multiple concu

CMD 使用emulator.exe启动Android模拟器——emulator -data 镜像文件名称

在命令行[CMD]使用emulator.exe启动Android模拟器两种方式: - emulator -avd (AVD名称) - emulator -data (镜像文件名称) avd目录中的镜像文件 image 有: 文件 文件类型 cache.img: VMS Alpha executable userdata.img: VMS Alpha executable userdata-qemu.img: data 到底哪个镜像文件是呢? 显然cache.img不是,userdata-qemu

android Webkit 解决重定向 之 通过URL判断 网页是否是重定向的CODE 3XX

要解决重定向导致浏览器,无法goback问题一直困扰着我 最后,解决方案为,判断3xx重定向 url,自己维护一个 返回的list历史记录即可实现. 代码比较简单直接上代码. 前面一直得到code 200,原来是 用get请求的,直接返回重定向后的 code . package com.example.chongdingxiang; import java.io.BufferedInputStream; import java.io.IOException; import java.io.Inp

android 中Network error IOException: failed to connect to /127.0.0.1 (port 1433): connect failed: ECONNREFUSED (Connection refused)

下面对android中出现的Network error IOException: failed to connect to /127.0.0.1 (port 1433): 做一下总结: 当用android程序调用本地的sqlserver的时候,当连接ip写成127.0.0.1的时候,怎么都连不通,出现以下的错误信息: 感觉好像是代码有问题或者是清单文件中某个权限忘加了,其实不是这样的.原来模拟器默认把127.0.0.1和localhost当做本身了,在模拟器上可以用10.0.2.2代替127.0