forked from upstream-mirrors/OpenTracks
Cleanup: static code analysis using AndroidStudio.
This commit is contained in:
@@ -8,8 +8,8 @@ import de.dennisguse.opentracks.content.data.TrackPoint;
|
||||
public class HandlerServer {
|
||||
private String TAG = HandlerServer.class.getSimpleName();
|
||||
|
||||
private LocationHandler locationHandler;
|
||||
private HandlerServerInterface service;
|
||||
private final LocationHandler locationHandler;
|
||||
private final HandlerServerInterface service;
|
||||
|
||||
public HandlerServer(HandlerServerInterface service) {
|
||||
this.locationHandler = new LocationHandler(this);
|
||||
|
||||
@@ -19,10 +19,10 @@ import de.dennisguse.opentracks.util.UnitConversions;
|
||||
|
||||
class LocationHandler implements HandlerServer.Handler, LocationListener {
|
||||
|
||||
private String TAG = LocationHandler.class.getSimpleName();
|
||||
private final String TAG = LocationHandler.class.getSimpleName();
|
||||
|
||||
private LocationManager locationManager;
|
||||
private HandlerServer handlerServer;
|
||||
private final HandlerServer handlerServer;
|
||||
private LocationListenerPolicy locationListenerPolicy;
|
||||
private long currentRecordingInterval;
|
||||
private int recordingGpsAccuracy;
|
||||
|
||||
@@ -19,7 +19,6 @@ package de.dennisguse.opentracks.services.tasks;
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.speech.tts.TextToSpeech;
|
||||
import android.speech.tts.TextToSpeech.OnInitListener;
|
||||
import android.speech.tts.UtteranceProgressListener;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -50,7 +49,7 @@ public class AnnouncementPeriodicTask implements PeriodicTask {
|
||||
|
||||
private final AudioManager audioManager;
|
||||
|
||||
private ContentProviderUtils contentProviderUtils;
|
||||
private final ContentProviderUtils contentProviderUtils;
|
||||
|
||||
private final AudioManager.OnAudioFocusChangeListener audioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {
|
||||
@Override
|
||||
@@ -116,12 +115,9 @@ public class AnnouncementPeriodicTask implements PeriodicTask {
|
||||
Log.d(TAG, "Start");
|
||||
|
||||
if (tts == null) {
|
||||
tts = new TextToSpeech(context, new OnInitListener() {
|
||||
@Override
|
||||
public void onInit(int status) {
|
||||
Log.i(TAG, "TextToSpeech initialized with status " + status);
|
||||
ttsInitStatus = status;
|
||||
}
|
||||
tts = new TextToSpeech(context, status -> {
|
||||
Log.i(TAG, "TextToSpeech initialized with status " + status);
|
||||
ttsInitStatus = status;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user