Fix rescheduling of alarms that are snoozed
When AlarmInitReceiver recieves android.intent.action.TIME_SET, a call is made to AlarmStateManager.fixAlarmInstances() which will update all alarm instances based on the newly set time. This updates the AlarmInstance based on the Alarm time and not the current time for the given AlarmInstance. This causes snoozed alarms to be scheduled the next time the Alarm is suppose to fire off, if the alarm a repeating alarm. This patch fixes this behavior by passing in a Calendar instance based on the AlarmInstance's time. Steps to repro: 1) Set an alarm for 1 minute from current time 2) Snooze alarm when it goes off 3) Go to Settings -> Date & Time and set the time to 2 minutes ahead 4) The snoozed alarm should be rescheduled to the next day the alarm would fire. Change-Id: Id7e2d5c7b5d2b9d3b92eb51a2e14d70639d56761
Loading