forked from upstream-mirrors/OpenTracks
BarometerInternal: if there is no internal barometer - don't register a listener.
This commit is contained in:
@@ -42,6 +42,7 @@ public class BarometerInternal implements SensorEventListener {
|
|||||||
if (pressureSensor == null) {
|
if (pressureSensor == null) {
|
||||||
Log.w(TAG, "No pressure sensor available.");
|
Log.w(TAG, "No pressure sensor available.");
|
||||||
this.observer = null;
|
this.observer = null;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sensorManager.registerListener(this, pressureSensor, SAMPLING_PERIOD, handler)) {
|
if (sensorManager.registerListener(this, pressureSensor, SAMPLING_PERIOD, handler)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user