Konrad Sobczak
Jan 11, 2019
12:27 pm

Hello Lin Shengjie,

 

You can use public int addPackageToBatteryOptimizationWhiteList (AppIdentity appIdentity) method of ApplicationPolicy class to exlude your app from Battery Saving features and Doze Mode and public boolean addPackagesToForceStopBlackList (List<String> packageList) to exclude app from being force stopped by system.

 

Best regards, Konrad.

Comments

Unfortunately, they dont work quite well. My app is still killed by system if I put it on backound and continuously run other apps.

It seems  not Doze Mode but lack of memory leads to this case.

Lin ShengjieJan 11, 2019 at 5:15 pm