Fix calendar reminder notification is not shown in idle state

M introduce "doze" which prevents alarm goes off when devices is in idle
state.

The solution is to use setExactAndAllowWhileIdle, however,
there is a restriction that we can only have one such an alarm within 15
mins during dozing.

Before explaining the changes, here is the brief introduction how reminder
notification works.
CalendarProvider send EVENT_REMINDER broadcast to notify calendar app
to show notification.
It sets two alarms, one to send this broadcast and set one another to
schedule the next coming reminder.
The scheduler alarm goes off one minute after the reminder alarm.

Here are the changes:
1.Due to the 15 min restriction, the current architecture is not working.
This commit removes the scheduler alarm.
CalendarProvider now listens for the EVENT_REMINDER broadcast and
schedule the next reminder immediately.

2. When there is no reminder within 1 day, CalendarProvider will setup
an alarm on the next day to start the scheduler again.
This alarm needs to goes off in idle state. But due to the 15 mins
restriction, now the time is set to 15 mins earlier.

3. Also remove SCHEDULE broadcast which is basically same as the
ACTION_CHECK_NEXT_ALARM broadcast.

4. ag/720759 make sure the reminder alarm goes off during dozing.

Please notice that even with this commit, we can't have more than
one reminder notification within 15 minutes due to the restriction
mentioned above.

Bug: 22182280

Change-Id: I950dab5595a98a26370f2cd8decf0b32d9363591
7 files changed