Frameworks: Add Permissions Management to AOKP [3/4]

Allows the user to revoke individual permissions on a per app basis.  Adapted from
CM7 commits 949eb057d81da7cd0a79fc1fe9cc9c4d989d1c27 and 4a0a352b36b21d0d22713c232baccca84ce13a2d
to work with 4.2.2

Change-Id: Ibc7be45b88838a2fffaff80514e77702d330de0f
Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>
Fix Watchdog HeartbeatHandler to run on correct thread

The HeartbeatHandler for the System Server Watchdog has been running
on the wrong thread due to a race condition in initialization.  It's
designed to run on ServerThread, so that it can catch lockups in the
main looper of the System Server.  It has been running on
ActivityManagerThread instead, so it does not detect lockups on the
ServerThread as it should.

ActivityManagerService is calling Watchdog.getInstance() before
ServerThread calls Watchdog.getInstance().init(), so the handler is
being bound to the ActivityManagerThread instead of the ServerThread.

Explicitly bind HeartbeatHandler to ServerThread, so that the Watchdog
catches lockups on this critical thread.

Change-Id: Iccb184ac3adb817feb86ed4ee0e50e443bf74636