Unless I'm mistaken, phones and other battery powered devices have an independent charging circuit. The CPU can communicate with it in limited fashion, such as cutting off charging at 80%, but it is not fully controlled by the CPU. When the phone is turned off, it should return to its default...