I need to make an app that keeps the screen on even when the app is running in the background.
I've tried:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
But it only works when the app is running and can't run as a service.
I've also tried wakelocks but SCREEN_BRIGHT_WAKE_LOCK and FULL_WAKE_LOCK have both been deprecated. The only wakelock left is PARTIAL_WAKE_LOCK.
Is there someway to keep the screen on using the PARTIAL_WAKE_LOCK, ACQUIRE_CAUSES_WAKEUP, and some loops?
Frankly I have no real experience with Java or app development and I've been assigned this task as an intern so any help would be appreciated.