1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +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
public void dispose() {
super.dispose();
GBApplication.getContext().unregisterReceiver(globalUartReceiver); // remove uart.tx intent listener
stopGlobalUartReceiver();
stopLocationUpdate();
}
private void stopGlobalUartReceiver(){
if(globalUartReceiver != null){
GBApplication.getContext().unregisterReceiver(globalUartReceiver); // remove uart.tx intent listener
}
}
private void stopLocationUpdate() {
GBLocationManager.stop(getContext(), this, null);
gpsUpdateSetup = false;