Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 1.32 KB

todo.org

File metadata and controls

29 lines (28 loc) · 1.32 KB

Code Cleanup

Refactor PhoneBoot to use a service

  • Receivers cannot perform long running operations!

No receiver can call the database directly

use enums in TaskDatabaseFacade

save new repeating tasks in AlarmManager$GetNextAlarm with batch operation

make sure db is multi-thread safe

UI

implement cartoon animation to swipe to delete

Bugs

revert “repeat hourly” to correct behavior

alarm doesn’t vibrate when phone set in vibrate mode

don’t forget to remove alarms when completing them!

back to back alarms don’t update the due alarm dialog

Fix AlarmReceiver

  • As per the docs, receivers are designed for short operations.
  • However, the AlarmReceiver calls findNextDueAlarm, which is now a potentially heavy db operation

Create a service to call findNextDueAlarm

  • the catch is that the phone might go back to sleep before we do our work so we need to grab a wake lock

Grab a wake lock in the service and make sure to let it go

Create an Async task to findNextDueAlarm

Testing

Get Guice working!

Retest alarm manager using test-defined NOW, not the actual current time

Test case when there are multiple alarms backed up

  • i.e, dueTime1 = 12pm, dueTime2 = 12:01pm, etc. and NOW = 12:05pm