Small improvement

pull/169/head
M66B 6 years ago
parent e51278ed0f
commit 7fcb883786

@ -689,6 +689,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
final PowerManager.WakeLock wlMessage = pm.newWakeLock( final PowerManager.WakeLock wlMessage = pm.newWakeLock(
PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":account." + account.id + ".message"); PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":account." + account.id + ".message");
try {
wlAccount.acquire();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (account.notify) if (account.notify)
account.createNotificationChannel(ServiceSynchronize.this); account.createNotificationChannel(ServiceSynchronize.this);
@ -696,9 +699,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
account.deleteNotificationChannel(ServiceSynchronize.this); account.deleteNotificationChannel(ServiceSynchronize.this);
} }
try {
wlAccount.acquire();
long ago = new Date().getTime() - lastLost; long ago = new Date().getTime() - lastLost;
if (ago < RECONNECT_BACKOFF) if (ago < RECONNECT_BACKOFF)
try { try {

Loading…
Cancel
Save