@ RequiresPermission ( anyOf = { Manifest . permission . ACCESS_COARSE_LOCATION , Manifest . permission . ACCESS_FINE_LOCATION } ) public synchronized void stopLocalization ( ) { if ( started ) { AlarmUtils . cancelAlarm ( getCancelPendingIntent ( ) ) ; locationManager . removeUpdates ( this ) ; if ( location == null ) { location = locationManager . getLastKnownLocation ( LocationManager . GPS_PROVIDER ) ; if ( location == null ) { location = locationManager . getLastKnownLocation ( LocationManager . NETWORK_PROVIDER ) ; } locationTime = DateUtils . nowMillis ( ) ; } started = false ; LOGGER . info ( "Localization stopped" ) ; } }
Remove the listener to receive location updates