diff options
author | Christopher Tate <ctate@android.com> | 2013-01-11 08:58:34 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-01-11 08:58:34 -0800 |
commit | ec64c30bfc221fea888efe5eac62f7c5303aeeb0 (patch) | |
tree | eac88a968afad3b501171844ea7f52d06cd420a8 /services | |
parent | 50fc82fdf025bc1fee8f0eb50fa88e4591c8daae (diff) | |
parent | cc52272b4fa27ab36ba20e22a53f872fedc8bb45 (diff) | |
download | frameworks_base-ec64c30bfc221fea888efe5eac62f7c5303aeeb0.zip frameworks_base-ec64c30bfc221fea888efe5eac62f7c5303aeeb0.tar.gz frameworks_base-ec64c30bfc221fea888efe5eac62f7c5303aeeb0.tar.bz2 |
am cc52272b: am a3e79199: Merge "TIME_TICK was not occurred for one hour"
* commit 'cc52272b4fa27ab36ba20e22a53f872fedc8bb45':
TIME_TICK was not occurred for one hour
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/AlarmManagerService.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java index cbd00f3..fa758a8 100644 --- a/services/java/com/android/server/AlarmManagerService.java +++ b/services/java/com/android/server/AlarmManagerService.java @@ -956,16 +956,12 @@ class AlarmManagerService extends IAlarmManager.Stub { } public void scheduleTimeTickEvent() { - Calendar calendar = Calendar.getInstance(); final long currentTime = System.currentTimeMillis(); - calendar.setTimeInMillis(currentTime); - calendar.add(Calendar.MINUTE, 1); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); + final long nextTime = 60000 * ((currentTime / 60000) + 1); // Schedule this event for the amount of time that it would take to get to // the top of the next minute. - final long tickEventDelay = calendar.getTimeInMillis() - currentTime; + final long tickEventDelay = nextTime - currentTime; set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + tickEventDelay, mTimeTickSender); |