一、设备到ntp服务器的网络是否正常

130|test:/ # ping 2.android.pool.ntp.org
PING 2.android.pool.ntp.org (202.112.29.82) 56(84) bytes of data.
64 bytes from dns1.synet.edu.cn (202.112.29.82): icmp_seq=1 ttl=47 time=94.5 ms

出现如上日志说明是可以ping通的,可以正常访问网络
二、域名和IP查询网址

https://site.ip138.com/2.android.pool.ntp.org/

域名查询
IP查询
总结:
1、如果该卡不能ping通域名,换一张卡可以ping通,则说明是该卡运营商那边有问题,运营商那边是否有做限制
2、从上面可以ping通域名的设备看,每次ping域名的时候,IP是随机分配的
解决方法:
代码路径:
frameworks/base/core/res/res/values/config.xml
frameworks/base/core/java/android/util/NtpTrustedTime.java
frameworks/base/services/core/java/com/android/server/NetworkTimeUpdateService.java
NetworkTimeUpdateService.java文件是网络更新时间处理,在config.xml资源文件中可以对其它参数可以配置,比如重连次数,超时时间的、域名

<!-- Remote server that can provide NTP responses. --><string translatable="false" name="config_ntpServer">2.android.pool.ntp.org</string><!-- Normal polling frequency in milliseconds --><integer name="config_ntpPollingInterval">86400000</integer><!-- Try-again polling interval in milliseconds, in case the network request failed --><integer name="config_ntpPollingIntervalShorter">60000</integer><!-- Number of times to try again with the shorter interval, before backingoff until the normal polling interval. A value < 0 indicates infinite. --><integer name="config_ntpRetry">3</integer><!-- If the time difference is greater than this threshold in milliseconds,then update the time. --><integer name="config_ntpThreshold">5000</integer><!-- Timeout to wait for NTP server response in milliseconds. --><integer name="config_ntpTimeout">5000</integer><!-- Default network policy warning threshold, in megabytes. --><integer name="config_networkPolicyDefaultWarning">2048</integer>

在NtpTrustedTime.java文件中forceRefresh()方法中可以动态添加NTP服务器域名

 @Overridepublic boolean forceRefresh() {if (TextUtils.isEmpty(mServer)) {// missing server, so no trusted time availablereturn false;}// We can't do this at initialization time: ConnectivityService might not be running yet.synchronized (this) {if (mCM == null) {mCM = (ConnectivityManager) sContext.getSystemService(Context.CONNECTIVITY_SERVICE);}}final NetworkInfo ni = mCM == null ? null : mCM.getActiveNetworkInfo();if (ni == null || !ni.isConnected()) {if (LOGD) Log.d(TAG, "forceRefresh: no connectivity");return false;}if (LOGD) Log.d(TAG, "forceRefresh() from cache miss");final SntpClient client = new SntpClient();if (client.requestTime(mServer, (int) mTimeout)) {mHasCache = true;mCachedNtpTime = client.getNtpTime();mCachedNtpElapsedRealtime = client.getNtpTimeReference();mCachedNtpCertainty = client.getRoundTripTime() / 2;return true;} else {return false;}}

Android 10 4G网络不能校时问题分析相关推荐

  1. STM32多时段闹钟(10个闹钟),网络自动校时

    STM32多时段闹钟(10个闹钟),网络自动校时 STM32多时段闹钟(10个闹钟),网络自动校时 STM32多时段闹钟(10个闹钟),利用AT命令网络自动校时,到时间继电器开1分钟,利用ESP826 ...

  2. android2.2智能手机,Jelly 2:全球最小的Android 10 4G智能手机

    原标题:Jelly 2:全球最小的Android 10 4G智能手机 继2017年,Unihertz在Kickstarter上推出了第一款Jelly智能机后,近日,团队再次推出二代产品-- Jelly ...

  3. 【高通SDM660平台 Android 10.0】(12) --- Camera Chromatix 代码分析

    [高通SDM660平台 Android 10.0]Qcom Camera Daemon 代码分析 一.chromatix_imx258_lc898217xc 目录 1.1 例:imx258_lc898 ...

  4. 4G网络数据传输流程与速率分析系列(一)

    2009年1月,瑞典运营商TeliaSonera宣布商用4G LTE网络,建成全球首个4G商用网络: 2013年12月,中国移动宣布商用4G网络,速率超百兆,成为国内首家4G网络运营商: 2014年1 ...

  5. android10蓝牙搜不到ble设备_Android BLE程序在Android 10手机搜不到设备问题分析

    前言 前一阵帮别人做个蓝牙的Android程序,调试的好好的, 用的自己的老手机,android 5.1.8.0的都是好好的能够搜索,但是交付过去,对方的华为p30 Android 10手机就是不行, ...

  6. android获取4g网络ip,android 获取ip地址,获取2,3,4g,wifi状态等

    1.获取ip地址 public String getLocalIpAddress() { if(((ConnectivityManager) this.getSystemService(Context ...

  7. Android手机4G网络设置ipv6

    我的卡是联通的,所以下面截图也是联通的,移动和电信的卡类似: 1.进入目录:设置--移动网络--接入点名称(APN): 2.点击默认的连接项,进入详情页,如果'APN协议'可以更改,则直接修改为IPV ...

  8. Android 10.0 系统设置蓝牙配对时去掉配对框实现直接配对功能

    目录 1.概述 2.系统设置蓝牙配对时去掉配对框实现直接配对功能核心代码

  9. 网络在线校时服务器ip,网络校时服务器如何同步服务器时间?

    gzbowie 如果出错,就证明该电脑/PC没有开启Windowstime功能/ntp客户端功能,开启方法如下: Windows ntp服务客户端配置 1. 打开"开始",点击运行 ...

最新文章

  1. WebP 大战 JPEG,谁才是真正的王者?
  2. 【翻译】关于vertical-align所有你需要知道的
  3. 动态换ip如何实现_动态IP可以实现哪些功能及用途
  4. linux对目录进行操作,Linux 基础:对文件和目录进行操作的 Linux 和 Unix 命令 笔记...
  5. 在matlab上利用fft进行信号频谱分析_全面分析:频谱分析仪原理技术(收藏必备)...
  6. PCB设计中,如何快速消除PCB布线?
  7. WARNING: The script markdown_py.exe is installed in......
  8. 七、最短路径——弗洛伊德(Floyd)算法
  9. js代码格式化(js代码格式化html标签)
  10. 软件公司绩效考核(大家提提建议)
  11. 微信公众号的附件链接怎么弄
  12. 解决Eclipse打开某个workspace报错:The project description file (.project) for (项目名)
  13. 1218学习笔记——kvm上vm+vtpm(IMA)
  14. Android UI 设计工具
  15. kindle版java核心_深入理解java 7 核心技术与最佳实践-成富[6寸pdf mobi epub kindle版].pdf...
  16. 【疫情是否会对2021届就业形势产生影响】听说连21届都要跟20届毕业生“抢饭碗”了?
  17. win7 开始 计算机箭头,win7系统开机黑屏屏幕上一个箭头的解决办法
  18. c++实战(OpenCV C++案例实战九《对象计数》)
  19. DNS 缓存查看以及清除
  20. 漫画头像怎么制作?掌握这几个技巧就够了

热门文章

  1. redis初学者教程—带你进入不一样的世界
  2. Android快速编译镜像
  3. C语言泰勒公式求sin(x)值
  4. AD域设置共享打印机
  5. 软工学者Rui Abreu的论文研究
  6. 今天新拉取得项目启动报错:No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
  7. 苹果x屏幕出现一条绿线_部分用户反映苹果iPhone 12屏幕出现划痕
  8. MySql 相似度计算
  9. JavaScript创建对象的4种方法
  10. 6.实现 Callable 接口