Tasks are persisted only if the client has the RECEIVE_BOOT_COMPLETED permission. This applies to both periodic and one-off tasks. Write out task as xml, using PersistableBundle for the extras data. Todo: Add persistable bundle to xml when ag/468207 is merged. Also added BatteryController logic. Change-Id: I23eeeb8b3bc6ba155e7fa4ec25857a68ee8b1567