Fix issue #2171766: Device can go to sleep while in dock

The issue I saw was then when plugging into the dock, we the battery
first is in the "USB" state before going to "AC".  The phone window
manager would pick up the first state, but not the second.

This change reworks this code to always monitor the battery status
while plugged in to the dock, to update itself whenever that state
changes.  When not in the dock, we don't monitor, since this is
only used to determine whether to keep the device on while in the
dock.

Change-Id: Ic1e8b584082a44c4e5df13ee19dab450775027f6
1 file changed
tree: a80b9cf627803b747d12e1040f0fc4842678baec
  1. policy/