Add better screen state detection for API >= 20