forked from upstream-mirrors/OpenTracks
Added back throwing of IllegalStateExceptions to startNewTrack and
endCurrentTrack so they still are thrown when called from the ServiceBinder methods.
This commit is contained in:
@@ -573,6 +573,9 @@ public class TrackRecordingService extends Service {
|
|||||||
|
|
||||||
public long startNewTrack() {
|
public long startNewTrack() {
|
||||||
Log.d(TAG, "TrackRecordingService.startNewTrack");
|
Log.d(TAG, "TrackRecordingService.startNewTrack");
|
||||||
|
if (isTrackInProgress()) {
|
||||||
|
throw new IllegalStateException("A track is already in progress!");
|
||||||
|
}
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
acquireWakeLock();
|
acquireWakeLock();
|
||||||
@@ -1008,6 +1011,9 @@ public class TrackRecordingService extends Service {
|
|||||||
|
|
||||||
private void endCurrentTrack() {
|
private void endCurrentTrack() {
|
||||||
Log.d(TAG, "TrackRecordingService.endCurrentTrack");
|
Log.d(TAG, "TrackRecordingService.endCurrentTrack");
|
||||||
|
if (!isTrackInProgress()) {
|
||||||
|
throw new IllegalStateException("No recording track in progress!");
|
||||||
|
}
|
||||||
|
|
||||||
announcementExecutor.shutdown();
|
announcementExecutor.shutdown();
|
||||||
splitExecutor.shutdown();
|
splitExecutor.shutdown();
|
||||||
|
|||||||
Reference in New Issue
Block a user