mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-30 22:12:55 +01:00
[Bangle.js] check if globalUartReceiver is set and move its removal to separate method
This commit is contained in:
parent
2e06d7afa5
commit
56ec206f5b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user