Toast notification and proximity sensor in WP8

I notice that the notification system checks proximity sensor first before firing the toast notification in WP8,

I tried covering the top sensor area of the phone and send email to my phone from desktop mail client, the notification sounded but the screen is not on, when I remove the covering, the phone then light up and show the toast notification.

Does anybody know more about this, some technical explanation, for example: does it have a certain timeout and then dismiss the toast notification?

Does Android or iPhone have similar behaviour? (I didn't notice this with my previous Android phone, but then again it's a 2011 phone, quite old, maybe newer phones have it?).