1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-06 10:17:04 +01:00

[Bangle.js] check if globalUartReceiver is set and move its removal to separate method

This commit is contained in:
Albert 2023-01-27 20:33:59 +01:00 committed by Gitea
parent 2e06d7afa5
commit 56ec206f5b

View File

@ -182,10 +182,17 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
@Override @Override
public void dispose() { public void dispose() {
super.dispose(); super.dispose();
GBApplication.getContext().unregisterReceiver(globalUartReceiver); // remove uart.tx intent listener stopGlobalUartReceiver();
stopLocationUpdate(); stopLocationUpdate();
} }
private void stopGlobalUartReceiver(){
if(globalUartReceiver != null){
GBApplication.getContext().unregisterReceiver(globalUartReceiver); // remove uart.tx intent listener
}
}
private void stopLocationUpdate() { private void stopLocationUpdate() {
GBLocationManager.stop(getContext(), this, null); GBLocationManager.stop(getContext(), this, null);
gpsUpdateSetup = false; gpsUpdateSetup = false;