PowerFi is a very lightweight application that enables/disables WiFi depending on the presence of a power source. Principally developed to combat Android bug 2207.