Provide means of interrupting energy greedy operations (e.g., using timeouts, or users input).
Mobile apps might feature operations that can be unexpectedly energy greedy (e.g., taking a long time to execute).
Provide a reasonable timeout for tasks or wakelocks. Alternatively provide an intuitive way of interrupting those tasks.
In a mobile app that features an alarm clock, set a reasonable timeout for the duration of the alarm.. In case the user is not able to turn it off it will not drain the battery.