Implement message handling in ExecutorImpl
Previously, we were posting runnables to the queue but never doing
anything when their messages came due.
- Implements message handling (in onHandleMessage).
- Inlines HandlerExecutor superclass. It was only offering one, very
simple, method and the required super() call was awkward.
- Changes ExecutorImpl to take in a Looper instead of a Handler; we
construct the Handler for ourselves.
- Changes ExecutorImpl to be a singleton per-looper (since we're
constructing a new Handler each time).
- Changes our token to be an instance of ExecutionToken. This serves as
wrapper around the Runnable that we need to run and itself serves as
cancellation token that can be returned to the caller of
executeDelayed() etc.i
Test: manual
Change-Id: Ia986d48c675a794c6f16dca6a82cb8cbd4010741
2 files changed