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: I051b54145f3cabf72e757b0dcb1f0ef2e979b34e
2 files changed