TrackRecordingService log warnings if unexpected methods are invoked.

This commit is contained in:
Dennis Guse
2021-04-24 22:29:33 +02:00
parent df3720ef0d
commit b416857001
@@ -256,7 +256,7 @@ public class TrackRecordingService extends Service implements HandlerServer.Hand
*/ */
public Track.Id startNewTrack() { public Track.Id startNewTrack() {
if (isRecording()) { if (isRecording()) {
Log.d(TAG, "Ignore startNewTrack. Already recording."); Log.w(TAG, "Ignore startNewTrack. Already recording.");
return null; return null;
} }
@@ -316,7 +316,7 @@ public class TrackRecordingService extends Service implements HandlerServer.Hand
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public void resumeCurrentTrack() { public void resumeCurrentTrack() {
if (!isRecording() || !isPaused()) { if (!isRecording() || !isPaused()) {
Log.d(TAG, "Ignore resumeCurrentTrack. Not recording or not paused."); Log.w(TAG, "Ignore resumeCurrentTrack. Not recording or not paused.");
return; return;
} }
@@ -365,10 +365,10 @@ public class TrackRecordingService extends Service implements HandlerServer.Hand
} }
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public Track.Id endCurrentTrack() { public void endCurrentTrack() {
if (!isRecording()) { if (!isRecording()) {
Log.d(TAG, "Ignore endCurrentTrack. Not recording."); Log.w(TAG, "Ignore endCurrentTrack. Not recording.");
return null; return;
} }
// Need to remember the recordingTrackId before setting it to null // Need to remember the recordingTrackId before setting it to null
@@ -394,14 +394,12 @@ public class TrackRecordingService extends Service implements HandlerServer.Hand
ExportUtils.postWorkoutExport(this, track, new ExportServiceResultReceiver(new Handler(), this)); ExportUtils.postWorkoutExport(this, track, new ExportServiceResultReceiver(new Handler(), this));
endRecording(true); endRecording(true);
return trackId;
} }
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public void pauseCurrentTrack() { public void pauseCurrentTrack() {
if (!isRecording() || isPaused()) { if (!isRecording() || isPaused()) {
Log.d(TAG, "Ignore pauseCurrentTrack. Not recording or paused."); Log.w(TAG, "Ignore pauseCurrentTrack. Not recording or paused.");
return; return;
} }