Parallel shutdown

Decrease shutdown time by doing some shutdown tasks in parallel.

There are two threads executing during the shut down:
the ShutdownThread and a separate thread for the radio shutdown.
However, the execution is done in serial,
as the ShutdownThread immediately joins on the radio thread.

This commit will move the shutdown of the radio to the
beginning of shutdown and execute it in parallel to the
shutdown of the rest of the system.

The flow of the two threads during shutdown is now:

Radio Thread
  * Start shutdown of the radio
  * Wait for radio off or time out
  * Notify that the radio is done
ShutdownThread
  * Broadcast ACTION_SHUTDOWN as a parallel broadcast.
    (The receivers will get as much time to handle
    onReceive as it takes execute the rest of the tasks
    in the shut down flow. If they are not done in
    that time, we don't care.)
  * Shutdown ActivityManager
  * Shutdown MountService
  * Wait for MountService and radio to notify done
  * Vibrate
  * Low level shutdown

并行双线程关机

通过并行一些关机任务来减少关机时间.

关机时会执行两个线程: ShutdownThread和一个独立的线程来
关闭通信基带. 但是, 这个执行是依次执行的. 在通信基带关闭后
ShutdownThread的任务会立刻接上去.

而这条commit将关闭基带的任务移至关机任务最开始的位置,
并将其与系统其它部分的关闭同时执行.

现在关机的双线程流程如下:

通信基带线程
  * 开始关闭基带
  * 等待基带关闭或延时
  * 提示基带已关闭
ShutdownThread线程
  * 将ACTION_SHUTDOWN的Broadcast Action以并行broadcast的方式
    发出. (这样接收方就有和完成余下的关机流程同样多的时间来
    处理onReceive. 如果他们届时没有完成, 我们也不受影响.)
  * 关闭ActivityManager
  * 关闭MountService
  * 等待MountService和基带提示已关闭
  * 震动
  * 底层关机

Original commit in AOSP
AOSP中的原commit
https://android-review.googlesource.com/83597/