I know it's a pretty old phone, but maybe someone here can help.

I have a Samsung Gravity T on T-Mobile. The screen doesn't stay on when the phone is closed (i.e. keyboard hidden away). I've tried a master reset, but I'm pretty sure it's not a software issue. If I close the phone even just as the phone starts to boot up, the screen goes off. Screen is fine when the phone is open.

Very weird. It's almost like there's a hardware trigger that tells the screen to go off.

Anyone have any ideas?