Skip to content

Commit

Permalink
Bugfix: BarometerInternal shouldn't send data after disconnect().
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisguse committed Nov 21, 2023
1 parent 8d5a7e7 commit caf8b55
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void onAccuracyChanged(Sensor sensor, int accuracy) {
};

public void connect(Context context, Handler handler, GainManager observer) {
this.observer = observer;
SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
Sensor pressureSensor = sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
if (pressureSensor == null) {
Expand All @@ -58,6 +57,7 @@ public void connect(Context context, Handler handler, GainManager observer) {
public void disconnect(Context context) {
SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
sensorManager.unregisterListener(listener);
observer = null;
}

public boolean isConnected() {
Expand Down

0 comments on commit caf8b55

Please sign in to comment.