Check battery charging status

This snippet will let you check if the device battery is charging.