.agps. WARNING. .APP.|Used In Fix:|GnssManager: GNSS_|GnssLocationProvider: suplMode|GnssLocationProvider: setting position_mode|mnld_fsm: mnld_fsm|gps provider added registration|LocationManagerService: gps provider removed registration|GnssLocationProvider: TTFF:|.SUPL. config supl_version|nbr_cell_info_reg_cnf|requestDedicatedApnAndDnsQuery|AGPS is disabled by Setting|SUPL_INT_CAUSE_INVALID_CERT|SUPL_MMI_CAUSE_NETWORK_DISCONN|getDefaultDataSubscriptionId|framework: use standalone mode|SEC_ERROR_SSL_NO_MATCHING_CERTS|AgpsApn : DnsQueryResult
1. 必须在 full start 冷启动 才会去请求 AGPS(SUPL) , 清空位置信息
$PMTKEPH,0*43 // 没有星历,需要SUPL辅助
$PMTKEPH,99,1,2,3,4,5,6,7,8,9,1 // 有足够实收星历,不需要SUPL辅助
2. 可以在测试 SUPL 可以关闭 EPO 和 NPL
关闭EPO: 工模 > Location > YGPS > Inform ACTION > 【Enalbe EPO(Need Restart)】(disable) 【Enalbe QEPO(Need Restart)】(disable)
关闭NPL for SUPL: 工模 > Location > LocationEM > AGPS > 【Use NPL Settings to SUPL】(disable) (打开NPL 会变为Framework优先 可能导致优先使用 standalone mode 而不触发AGPS)
3. 需要给 non-framework app授予allow loction all the time 的权限
4. 如果需要 dedicated APN 那么必须在 在 工模下打开 【Allow SUPL dedicated APN】
5. 如果需要SUPL 需要使用 .cer证书 (.pem 需要转为 .cer证书 ) 进行加密TLS 通信 那么需要 确保当前 LOG 打印 ca_enable=1 是打开的
<up_setting ca_enable="true" >
手机没有开启ca_enable,证书在连接supl server时并不会因为证书匹配失败导致连接失败。
并且在实验室测试时 需要打开工模AGPS 下的 【Allow AGPS Certificates for Lab Test】(enable) 选项 匹配的Log是 sdcard_cert=1
requestDedicatedApnAndDnsQuery
14-24 13:53:41.057704 1932 4656 D LocationManagerService: gps provider added registration from 10441/com.skyline.lbsapp/6718BE43 -> Request[@+1s0ms HIGH_ACCURACY, WorkSource{10441 com.skyline.lbsapp}], mInterval: 1000, mFastestInterval: 1000, mSmallestDisplacement: 0.0, mNumUpdates: 2147483647
14-24 13:53:41.068542 1932 1985 D GnssLocationProvider: suplMode=1
14-24 13:53:41.068634 1932 1985 D GnssLocationProvider: setting position_mode to MS_BASED
14-24 13:53:41.070730 1529 2179 W MNLD : mnld_fsm: mnld_fsm() state=[IDLE] event=[START], user=0x00000001
14-24 13:53:41.407843 1529 2179 W MNLD : mnld_fsm: mnld_fsm() state=[STARTING] event=[START_DONE], user=0x00000001
14-24 13:53:41.409956 1932 4323 D GnssManager: GNSS_STATUS_ENGINE_ON
14-24 13:53:41.410769 1932 4656 D GnssManager: GNSS_STATUS_SESSION_BEGIN
14-24 13:53:41.426437 1583 1596 D agps : [agps][n][CP] [MD_1] read nbr_cell_info_reg_cnf rat_mode=4 (GSM=1 UMTS=2 LTE=4) is_nbr_info_valid=1 mcc=440 mnc=10
14-24 13:53:41.427783 1583 1596 D agps : [agps][SUPL] config supl_version=2 eCID=1 addr=[dcm-supl.com] port=7275 tls=1
14-24 13:53:41.430447 1932 1985 D GnssLocationProvider: SV count: 0 Used In Fix: 0
14-24 13:53:41.432591 1583 1630 D agps : [agps] WARNING: [APP] SUPL_START [SET_BASE][2.0.4] [Snd]
14-24 13:53:41.435989 1932 4648 D AgpsApn : requestDedicatedApnAndDnsQuery() fqdn=dcm-supl.com isEsupl=false isSuplApn=true 【是否专用APN】
14-24 13:53:41.688150 1932 6120 D AgpsApn : DnsQueryResult() fqdn=dcm-supl.com isSuccess=true hasIpv4=true ipv4=11610ed3 hasIpv6=true ipv6=[0, 100, -1, -101, 0, 0, 0, 0, 0, 0, 0, 0, -45, 14, 97, 17] hasNetId=true netId=108 ret=true // 【解析 SUPL DNS 地址】
14-24 13:53:41.692006 1583 1630 D agps : [agps] WARNING: [APP] Before Connection v6=[0064,...,6111] Port=[7275] ret=[-1] errno=[115] fd=[44]
14-24 13:53:41.724748 1583 1630 D agps : [agps] WARNING: [APP] After Connection
14-24 13:53:42.422949 1932 1985 D GnssLocationProvider: SV count: 33 Used In Fix: 0
14-24 13:53:42.481714 1583 1630 D agps : [agps] WARNING: [APP] SUPL_RESPONSE [SET_BASE][2.0.4] [Rcv]
14-24 13:53:42.485008 1583 1630 D agps : [agps] WARNING: [APP] SUPL_POS_INIT [SET_BASE][2.0.4] [Snd]
14-24 13:53:42.542218 1583 1630 D agps : [agps] WARNING: [APP] SUPL_POS [LPP][2.0.4] [Rcv]
14-24 13:53:43.418961 1932 1985 D GnssLocationProvider: SV count: 21 Used In Fix: 8
14-24 13:53:43.429562 1932 1985 D GnssLocationProvider: TTFF: 2360
14-24 13:53:43.543241 1583 1630 D agps : [agps] WARNING: [APP] Timeout=[SUPL_TIMER_SI_AIDING]
14-24 13:53:44.849777 1932 1985 D GnssLocationProvider: SV count: 24 Used In Fix: 15
14-24 13:53:45.850822 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 17
14-24 13:53:46.857402 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 17
14-24 13:53:47.851721 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 19
14-24 13:53:48.858354 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 17
14-24 13:53:49.851645 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 18
14-24 13:53:50.850398 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 19
14-24 13:53:51.854461 1932 1985 D GnssLocationProvider: SV count: 25 Used In Fix: 18
14-24 13:53:52.861195 1932 1985 D GnssLocationProvider: SV count: 24 Used In Fix: 17
14-24 13:53:53.429366 1932 4648 D LocationManagerService: gps provider removed registration from 10441/com.skyline.lbsapp/6718BE43, mInterval: 1000, mFastestInterval: 1000, mSmallestDisplacement: 0.0, mNumUpdates: 2147483647
14-24 13:53:53.432208 1529 2179 W MNLD : mnld_fsm: mnld_fsm() state=[STARTED] event=[STOP], user=0x00000000
14-24 13:53:53.470296 1529 2179 W MNLD : mnld_fsm: mnld_fsm() state=[STOPPING] event=[SUSPEND_DONE], user=0x00000000
14-24 13:53:53.471027 1583 1630 D agps : [agps] WARNING: [APP] SUPL_END w/o POS [UNSPECIFIED][2.0.4] [Snd]
14-24 13:53:53.473076 1583 1630 D agps : [agps] WARNING: [APP] Close Connection
14-24 13:53:53.478848 1932 4648 D GnssManager: GNSS_STATUS_SESSION_END
14-24 13:53:53.478894 1932 4648 D GnssManager: GNSS_STATUS_ENGINE_OFF
14-24 13:53:53.482074 1932 2614 D GnssManager: GNSS_STATUS_ENGINE_OFF
14-24 13:54:03.438010 1529 2179 W MNLD : mnld_fsm: mnld_fsm() state=[SUSPEND] event=[RESET], user=0x00000000
// 请给non-framework app授予allow all the time权限
03-10 01:42:42.721973 1146 1171 E agps : [agps] ERR: [AGPS] AGPS is disabled by Setting (GNSS Visibility Control): gvc=0, emergency_state=0, po_mode=0, ni_type=0
// 当前发生 无效证书事件
23177 02-28 13:30:52.869553 1140 1204 D MtkAgpsNative: supl_conn_do_tls_handshake: SUPL_INT_CAUSE_INVALID_CERT but treat it as SUPL_CONN_WOULDBLOCK
// SIM卡用的是国内卡,supl服务器是谷歌的,挂了vpn来连接外网
// AGPS 在请求时 有网络类型的限制 , 对于 不在 VPN 的网络 来发起SUPL请求
07-12 14:33:48.987 1071 1101 D agps : [agps][SUPL] req_id=1 case=[SUPL_MMI_CAUSE_NETWORK_DISCONN]
解决: 在MTK 的AgpsApn.java 文件中修改加入一行 /vendor/mediatek/proprietary/packages/services/LPPeService/src/com/mediatek/location/agps/apn/AgpsApn.java
mNetReqInternet = nrBuilder
.removeCapability(Networkcapabilities.NET_CAPABILITY_NOT_VPN) //增加这一行 使得 AGPS 允许使用VPN网络
.removeTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
双SIM卡,发起SUPL请求的消息是SIM0,但在SIM0中却发现了 SIM1的 IMSI电话号码,
修复措施: 打开 ENABLE_ACTIVE_SIM_EMERGENCY_SUPL 对应 /packages/apps/CarrierConfig/res/xml/vendor_asia.xml
<carrier_config cid="1894" name="SoftBank" unique_rule_id="SoftBank">
<boolean name="gps.enable_active_sim_emergency_supl" value="true" />
</carrier_config>
03-01 15:21:08.975573 1884 2112 D GnssLocationProvider: getDefaultDataSubscriptionId=2, isActive= true
// 检查 关闭NPL for SUPL:
// 工模 > Location > LocationEM > AGPS > 【Use NPL Settings to SUPL】(disable)
// (打开NPL 会变为Framework优先 可能导致优先使用 standalone mode 而不触发AGPS)
// 如果勾选了Use NLP Setting To Supl,所以变成framework优先,从framework独到的模式MTK没有办法控制
WARNING: [AGPS] framework: use standalone mode
//SUPL 1.0只能在wcdma测试,不可以在LTE下测试的
Sending Location to com.autonavi.minimap|Used In Fix:|Location result:|GNSS_STATUS|Sending Location to com.tencent.mm|location successful by Baidu|GnssLocationProvider: TTFF:|Sending Location to com.waze|Sending Location to com.baidu.BaiduMap
CTRL-EVENT|Probe failed with exception|TcpDataFromSnmp|ACK: your new IP|onWifiEntriesChanged|startConnectivityScan: