rsteckler / unbounce-android

Take control of your battery life by limiting wakelocks and alarms
MIT License
126 stars 45 forks source link

Hook alarm hacks at set()/setRepeating()/cancel() instead of triggerAlarmsLocked() #139

Open ccaapton opened 8 years ago

ccaapton commented 8 years ago

In the current implementation, the alarm hook is done at triggerAlarmsLocked(), this would stop the app from being notified when the alarm occurs. However, the kernel will be waken from sleep state by the time a blocked alarm got fired by the hardware, as it is already scheduled inside the hardware clock at set()/setRepeating() calls. Correct me if i'm wrong.

If the hook is done at set()/setRepeating() level, the kernel will do nothing about the blocked alarms, it will save more power.