Skip to content

Commit

Permalink
SensorManager: crash if started twice.
Browse files Browse the repository at this point in the history
Part of #1780.
  • Loading branch information
dennisguse committed Dec 24, 2023
1 parent aed4af5 commit 47ceb29
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public SensorManager(TrackPointCreator observer) {
}

public void start(Context context, Handler handler) {
if (gpsManager != null) {
throw new RuntimeException("SensorManager cannot be started twice; stop first.");
}

gpsManager = new GPSManager(observer); //TODO Pass listener
altitudeSumManager = new GainManager(listener);
bluetoothSensorManager = new BluetoothRemoteSensorManager(context, handler, listener);
Expand Down

0 comments on commit 47ceb29

Please sign in to comment.