You're asking different things in each part of the post. The title asks "Does Android consume power when switched off?" but the latter part of the post asks "which is watching the key press events?", with a few different questions in between, which adds further distractions and confusions to the possible answerers...
Anyhow, I guess it all boils down to: "Once an Android phone is turned off, what wakes it up to start a process in each appropriate situations?".
To answer this, I'll have to take you to even lower level of an electronic device:
You may argue,
"What are you talking about?! A hardware is nothing when there's no software! Something HAS to be there watching the button input and I'm simply asking what that could be".
Be patient, please. Well get there soon.
Believe me. Besides, you might need to remind yourself of the definition of 'software' and 'hardware' now, since we're about to dive deep into such a low level.
I wonder whether you've ever played with an
Arduino, those little boards that get clicky button inputs and put flashy LED outputs. A chip working as the brain in one of these devices* is called an 'MCU', or a 'microcontroller'. A computer - including Android devices - is equipped with a few of these. Every firmware/ROM chips, BIOS chips, or any programmable ICs is likely another microcontroller.
These MCUs are quite simple compared to CPUs, but more robust and energy-efficient. For this reason, MCUs are often used to aid CPUs to set things up for them. How do they work? Essentially, they behave just according to how a firmware is programmed inside the ROM.
"Ha, so it's simply the Boot ROM, isn't it? You could have just said so!" Well, you'll have to know a bit more to understand better to get an answer for each of your oh-so-many questions.
The keywords are
sleep mode (the terminology of the latter may vary).
The firmware could be coded in a way that the chip would constantly be looking at the external inputs. However, this is not the ideal way. The chip will have to retrieve the state of a button, compare whether it's
off, and then count up to 50ms or so to simply wait. Now back to retrieving the state, and so on. The poweroff state could last hours, days, or even years - all the while unbeknownst to the poor little chip is whether the moment for it to shine again would ever come...
Sorry, that was a little bit disturbing. The existential crisis is not the only problem though, if that helps. Even if the chip were to be actively working, each glancing costs valuable resource as well!
Interrupt works the other way round. It's more like giving a notification to the main computational part. An MCU with the capability, essentially every modern one, is prepared with a procedure where they could push away & forget whatever they were up to before, execute a specific function to respond to the interrupt signal, and then get back to the task they were doing before. This way, an MCU doesn't have to actively, repeatedly compute a retrieval & comparison set. In the case of a typical Android device, you could assign interrupt for
[power applied/removed on the charger pin],
[power applied/removed on the charger pin] and
[power button pressed].
You may ask,
"Okay, sooo... now that MCU doesn't have to be burdened with that, it could happily sleep?"
...well yes. MCU could just sleep there.
Actually what I want to remark here is that, don't quote me on this but, what they sip when they sleep should be comparable to self discharge of a battery. At this point, there's so little software involved here that I would say those running at this point are all purely implemented in the hardware - but that's just my opinion and I don't consider myself expert enough to get you necessarily convinced.
So, basically, when in the poweroff state, Boot ROM is barely running that battery consumption is minuscule. When awakened, all it has to do is to call
Preloader and/or to tell
LK about what happened. I'm not sure of even deeper details; I have no idea but I'm willing to say it should be implementation dependent.
I guess at this point, your main question should be answered.
Followings are answers to your other questions.
Does Android consume power when switched off?
It is not any part of the Android OS ("Normal boot", you said) that consumes power.
Does Android consume power when switched off?
Yes but barely.
Note that there could be additional power consumption to run other parts, notably RTC (Real Time Clock) module.
But is the phone really off when we turn it off and the battery is inserted? I know that Android is really shut down but is the phone completely off regarding the software level?
No but almost.
when the phone is off and we press the power button is it the hardware which starts the boot really from zero (from the boot rom) or at this point the phone has already been finished with processing the boot rom, the preloader and loading the little kernel as well which is watching the key press events?
More like former.
Except Boot ROM is constantly running but barely.
Hope you got better idea about how everything works now!
*Note: Most Arduino boards have two MCUs, one in the center and the other to control the USB interface.