Make sure calendar alarms can dispatch in doze mode.

By calling AlarmManager's setExactAndAllowWhileIdle() and
setAndAllowWhileIdle() methods to allow alarms to be executed in doze
mode.
Alarms added by set() and setExact() do not execute in doze
mode.

Fix: 111286997
Test: "adb shell dumpsys deviceidle force-idle" to put device in doze
mode, "adb shell settings put global alarm_manager_constants.allow_while_idle_long_time 1000" to change ALLOW_WHILE_IDLE_LONG_TIME to 1 second. In Calendar app, add a event that is 3 minutes in the future, observe the alarm of this event can go off.

Change-Id: I58182a22a2ca2dffc5ad1fba811baa2b98109405
2 files changed