Improved error report

This commit is contained in:
M66B 2019-09-24 15:39:10 +02:00
parent d603e00d35
commit 45a1b5db6c
1 changed files with 6 additions and 1 deletions

View File

@ -289,7 +289,12 @@ public class ServiceSynchronize extends ServiceBase {
setUnseen(null);
if (state != null && state.isRunning()) {
Log.e("Destroy while running");
Boolean ignoring = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
ignoring = (pm != null && pm.isIgnoringBatteryOptimizations(BuildConfig.APPLICATION_ID));
}
Log.e("Destroy while running ignoring=" + ignoring);
state.stop();
}