Has it ever been repaired? There are several variables that can cause this. A faulty screen, cracked glass over the ambient light sensor, loose display connection. First, turn off adaptive brightness. Settings>Display>Adaptive brightness and toggle it off.