Simplification

pull/152/head
M66B 6 years ago
parent 861cf0eb4a
commit cd023f5855

@ -96,7 +96,6 @@ import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
public class ServiceSynchronize extends LifecycleService {
private TupleAccountStats lastStats = null;
private ServiceManager serviceManager = new ServiceManager();
private ExecutorService executor = Executors.newSingleThreadExecutor(Helper.backgroundThreadFactory);
private static final int CONNECT_BACKOFF_START = 8; // seconds
private static final int CONNECT_BACKOFF_MAX = 64; // seconds (totally 2 minutes)
@ -138,15 +137,6 @@ public class ServiceSynchronize extends LifecycleService {
@Override
public void onChanged(final List<TupleMessageEx> messages) {
executor.submit(new Runnable() {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(
PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":notify");
@Override
public void run() {
try {
wl.acquire();
Log.i("Notification messages=" + messages.size());
Widget.update(ServiceSynchronize.this, messages.size());
@ -216,13 +206,6 @@ public class ServiceSynchronize extends LifecycleService {
notifying.put(account, all);
}
} catch (Throwable ex) {
Log.e(ex);
} finally {
wl.release();
}
}
});
}
});
}

Loading…
Cancel
Save