I have a WakefulBroadcastReceiver
with IntentService
, every half hour alarm called and doing some stuff.
I have already handle doze mode with setExactAndAllowWhileIdle()
method.
Some new smart phones with customized os recently launched in market they have their own customized os based on android os. Like oppo with color os, vivo with funtouch os, xiomi with MIUI os. In the OSs there is a feature to clear memory. They have one touch clear memory option. for example if user clear recent app list or remove app from recent app list app's all background service along with all alarms will be killed.
How to work with these new OS?
For MIUI phones, you need to Off the POWER SAVING MODE then your app can run in the background.
Procedure : Go to Settings-> Battery-> Manage app's battery usage-> Click on Off or Choose your app
Programmatically:
Intent intent = new Intent();
intent.setClassName("com.miui.powerkeeper",
"com.miui.powerkeeper.ui.HiddenAppsContainerManagementActivity");
startActivity(intent);
For Oppo devices follow these steps:
Programmatically:
Intent intent = new Intent();
intent.setClassName("com.coloros.oppoguardelf",
"com.coloros.powermanager.fuelgaue.PowerConsumptionActivity");
startActivity(intent);
Programmatically:
Intent intent = new Intent();
intent.setClassName("com.coloros.safecenter",
"com.coloros.safecenter.permission.startup.StartupAppListActivity");
startActivity(intent);
This worked for me, hope this will work for you too :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With