Add activity manager command to watch uid state changes.

Also fix a few issues in uid reporting: active was being
reported multiple times when a process started, and idle
could be reported before the idle delay actually happened.

Test: manual, will be adding cts using the new cmd
Change-Id: I16d6dc3991350f36b04db434eaa4aa2655966db6
2 files changed