How force the app to opt out of battery saver mode when the service is ON?
问题 The expected behavior is that the app will be running all the time when it's in ON state. Some phones put the app in background mode when the app is not active for some time. I want the app to be running all the time even its in standby mode(standby mode means when we press the home button the app will go to background. and it will run for some time). I found following code and I tried that PowerManager powerManager = (PowerManager) getApplicationContext().getSystemService(POWER_SERVICE);