状态栏下拉通知右边时间变化问题,由时间变为日期

来源:互联网 发布:甲骨文软件研发中心 编辑:程序博客网 时间:2024/05/16 00:58

【PR-2127492-alm】

一、现象:

插入sdcard,sim card,开启自动更新时间选项,会发现通知栏中的通知右边的时间由插入时的系统时间xx:xx变为类似1/1/1970这种日期(当前手机设置的日期)

二、问题分析:

经过测试发现

1、单独插入SD卡,时间不会变为日期

2、单独插入sim卡,关闭设置中的自动更新时间选项,时间不会变为日期

3、单独插入sim卡,开启设置中的自动更新时间选项,时间变为日期

4、把时间设置为23:59分,然后单独插入SD卡,等待变为00:00分,发现时间变为日期

得出结论:只要日期发生变化,通知右边的时间就会由时间变为日期。

插入sim卡并且开启自动更新时间,插入之前系统的日期是错误的,所以插入sim卡引发了系统日期的更新,同样系统时间自动走过00:00的时候,也会引发系统日期的更新。


三、结论:

通过代码发现这个时间是通过

when = System.currentTimeMillis()方法获取的,所以可能是因为这个方法的逻辑引发的,暂时没有进行更深一步的研究。

个人猜想应该是Google为了体现通知出现时的时间,所以当日期发生变化时使用时间无法明确表明通知出现的时间,所以就显示为发生的日期。

The case described is normal, the display Date is the current system
date, the reason why this situation appeared is that insert SIM card and
the "Settings---Date & time---Automatic date & time" option is checked,
so that when insert sim card, the system date and time will be update,
then the time at upper right corner will be temporarily changed to the
current system date, you can do the following examples to verify:
1. Pull out the sim card, factory reset your device and reboot, ensure
the "Automatic date & time" option is checked, insert SD card, the time
at upper right corner display current system time.
2. Pull out the sim card, factory reset your device and reboot, ensure
the "Automatic date & time" option is checked, insert sim card, the time
at upper right corner will be changed to the current system date.
3.Pull out the sim card, factory reset your device and reboot, ensure
the "Automatic date & time" option is not checked, insert sim card, the
time at upper right corner display current system time.
In summary, if system time is updating, the notification's time at upper
right corner will be temporarily changed to the current system date

0 0
原创粉丝点击