Yes, no matter the screen is turned off or not, this (the first if) shall break.