* commit 'cc52272b4fa27ab36ba20e22a53f872fedc8bb45': TIME_TICK was not occurred for one hour
This commit is contained in:
@@ -956,16 +956,12 @@ class AlarmManagerService extends IAlarmManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void scheduleTimeTickEvent() {
|
public void scheduleTimeTickEvent() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
final long currentTime = System.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
calendar.setTimeInMillis(currentTime);
|
final long nextTime = 60000 * ((currentTime / 60000) + 1);
|
||||||
calendar.add(Calendar.MINUTE, 1);
|
|
||||||
calendar.set(Calendar.SECOND, 0);
|
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
|
||||||
|
|
||||||
// Schedule this event for the amount of time that it would take to get to
|
// Schedule this event for the amount of time that it would take to get to
|
||||||
// the top of the next minute.
|
// the top of the next minute.
|
||||||
final long tickEventDelay = calendar.getTimeInMillis() - currentTime;
|
final long tickEventDelay = nextTime - currentTime;
|
||||||
|
|
||||||
set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + tickEventDelay,
|
set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + tickEventDelay,
|
||||||
mTimeTickSender);
|
mTimeTickSender);
|
||||||
|
|||||||
Reference in New Issue
Block a user