Fix for charger switching off when connected to AC. Convert to PM API.

Change-Id: Ie3afa19eff7c456bd112803b13233dc501989408