What determines power management policies in Android? I am just approaching to the Smart Phone and Android world and have a couple of doubts:


  Which modules (and SW or FW?) decide the policies with which power is
  given to any component of the Smart Phone that requires it?


furthermore


  Are power management modules on Smart Phones implemented in the
  Android OS or in some special dedicated firmware?


Obviously power management must work also if the OS is not yet loaded, but who is responsible of it? 

And to what extent can I modify the power management with an application running inside of the OS?

(I hope these questions are not Off-Topic, in case can you please direct me to the correct Stack-Exchange site?)
Power management is determined by governors which set the CPU clock speed according to use. Each clock speed operates at a certain voltage and a lower voltage means less power. If you have root access you can change the governor and the allowed CPU clock speeds. Also there is sleep state into which the CPU will enter when the screen is off and nothing is working in the background. There are probably battery-charging functions that can't be messed with, but everything else can be changed even the cpu and dsp voltages.