It depends. Maybe you don’t need this at all. Related topic - Prevent screen form going black on android