SensorManager and GPSManager: prefer to crash rather than hide usage errors.

This commit is contained in:
Dennis Guse
2023-08-10 19:33:00 +02:00
parent ce0365c2e9
commit 205c5c7528
2 changed files with 16 additions and 43 deletions
@@ -62,20 +62,14 @@ public class SensorManager implements SharedPreferences.OnSharedPreferenceChange
}
public void stop(Context context) {
if (bluetoothSensorManager != null) {
bluetoothSensorManager.stop(context);
bluetoothSensorManager = null;
}
bluetoothSensorManager.stop(context);
bluetoothSensorManager = null;
if (altitudeSumManager != null) {
altitudeSumManager.stop(context);
altitudeSumManager = null;
}
altitudeSumManager.stop(context);
altitudeSumManager = null;
if (gpsManager != null) {
gpsManager.stop(context);
gpsManager = null;
}
gpsManager.stop(context);
gpsManager = null;
sensorDataSet.clear();
}