Android's Watchdog - Kitkat
Android's watchdog implementation stayed same through out most versions of Android until Kitkat. It had to be modified to support variable timeouts rather than the standard 1 minute timeout interval. Based on a commit e6f81cf1f69e0683f969238f921950befba8e6c3, this was done to support lengthy operations like application installations of multi giga bytes in size. Yet, this still supports the previous one minute based checks too. This is implemented by having the Watchdog thread post runnables to different threads (having a looper) associated with them. In the current implementation, these runnables are posted to Foreground Thread (android.fg), Ui Thread (android.ui), Io Thread (android.io) and MainThread, Window Manager, Activity Manager, Package Manager, Power Manager. The runnable (HandlerChecker) is a generic implementation and is not specific to the type of the thread to which it it being posted (Io, Fg etc). It checks the status of requested Moni...