PeriodTaskFactory: refactor interfaces.

This commit is contained in:
Dennis Guse
2021-08-24 06:20:52 +02:00
parent 29a1daa177
commit b32e87e10b
7 changed files with 35 additions and 72 deletions
@@ -29,8 +29,6 @@ public class TrackPointCreator {
private Context context;
private final Callback service;
// Disabled to simplify testing and implementation of #822
// private ExecutorService serviceExecutor;
@NonNull
private Clock clock = Clock.systemUTC();
@@ -52,7 +50,6 @@ public class TrackPointCreator {
public void start(@NonNull Context context) {
this.context = context;
// serviceExecutor = Executors.newSingleThreadExecutor();
SharedPreferences sharedPreferences = PreferencesUtils.getSharedPreferences(context);
locationHandler.onStart(context, sharedPreferences);
@@ -100,11 +97,6 @@ public class TrackPointCreator {
public void stop() {
locationHandler.onStop();
// if (serviceExecutor != null) {
// serviceExecutor.shutdownNow();
// }
// serviceExecutor = null;
if (remoteSensorManager != null) {
remoteSensorManager.stop();
remoteSensorManager = null;
@@ -128,13 +120,8 @@ public class TrackPointCreator {
}
public void onNewTrackPoint(TrackPoint trackPoint, Distance thresholdHorizontalAccuracy) {
// if (serviceExecutor == null || serviceExecutor.isTerminated() || serviceExecutor.isShutdown()) {
// return;
// }
fillAndReset(trackPoint);
// serviceExecutor.execute(() -> service.newTrackPoint(trackPoint, thresholdHorizontalAccuracy));
service.newTrackPoint(trackPoint, thresholdHorizontalAccuracy);
}