flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

Repetitive Sending Of Identical Locations

Open haobole opened this issue 3 years ago • 8 comments

Your Environment

  • Plugin version: 4.6.2
  • Platform: Android
  • OS version: 12
  • Device manufacturer / model: Pixel 5a
  • Flutter info (flutter doctor):
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale zh-Hans-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
  • Plugin config:
      bg.State state = await bg.BackgroundGeolocation.ready(bg.Config(
          batchSync: true,
          debug: false,
          desiredAccuracy: bg.Config.DESIRED_ACCURACY_NAVIGATION,
          minimumActivityRecognitionConfidence: 95,
          enableHeadless: true,
          foregroundService: true,
          httpRootProperty: "data",
          locationTemplate: locationTemplate,
          logLevel: kReleaseMode
              ? bg.Config.LOG_LEVEL_INFO
              : bg.Config.LOG_LEVEL_VERBOSE,
          startOnBoot: true,
          stopOnTerminate: false,
          locationAuthorizationRequest: 'Always',
          maxBatchSize: 10,
          distanceFilter: 1000,
          backgroundPermissionRationale: bg.PermissionRationale(
              title:
                  "Allow {applicationName} to access this device's location in the background?",
              message:
                  'In order to keep load dispatchers abreast of your location even when the app is closed or not in use, please enable {backgroundPermissionOptionLabel} location permission.',
              positiveAction: "Change to {backgroundPermissionOptionLabel}",
              negativeAction: "Cancel")));

Expected Behavior

I expect the plugin not to send identical locations to the url when it is immobile on my desk.

Actual Behavior

As soon as I start the app, it starts sending identical locations at full speed over and over.

Steps to Reproduce

Context

My app is used by truckers to transmit the location of the truck to dispatchers as they make progress to their destination with the load. Version 4.3.1 worked fine in a previous version of flutter, but then I upgraded flutter to 2.10.5 and the plugin to 4.6.2 and this started happening.

I have tried a number of things, most significantly increasing minimumActivityRecognitionConfidence from the default 75 to 95 and setting an explicit distanceFilter of 1000.

Debug logs

Logs
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 13.451
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 2 records
I/TSLocationManager( 7502): [c.t.l.http.HttpService a]
I/TSLocationManager( 7502):   🔵  HTTP POST batch (2)
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity execute] locationsettings
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
I/TSLocationManager( 7502): [c.t.l.data.sqlite.b persist]
I/TSLocationManager( 7502):   ✅  INSERT: 1ae3e95e-f23b-4f7c-bb99-58aa06a390f0
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: TERMINATE_EVENT
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity stop] eventCount: 0
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity onDestroy]
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [headers, params]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
D/TSLocationManager( 7502): [c.t.locationmanager.util.c g]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): - Enable: true → true, trackingMode: 1
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
D/TSLocationManager( 7502): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring connectivity changes
D/TSLocationManager( 7502): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring powersave changes
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService onStartCommand] action: start
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
I/TSLocationManager( 7502): [c.t.l.service.HeartbeatService c]
I/TSLocationManager( 7502):   🔴  Stop heartbeat
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): [c.t.l.service.TrackingService a]
I/TSLocationManager( 7502):   🔵  setPace: true → true
I/TSLocationManager( 7502): [c.t.l.http.HttpService$i onResponse]
I/TSLocationManager( 7502):   🔵  Response: 200
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b destroyAll]
D/TSLocationManager( 7502):   ✅  DELETED: (2)
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 1 records
I/TSLocationManager( 7502): [c.t.l.http.HttpService a]
I/TSLocationManager( 7502):   🔵  HTTP POST batch (1)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.service.TrackingService h]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ TrackingService motionchange: true
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: STOP_TIMEOUT
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m16s569ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 265ms, time: 1652729331878
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  LocationRequestService [eventCount: 0]
I/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ motionchange LocationResult: 576
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m16s804ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 41ms, time: 1652729332114
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  LocationRequestService destroyed
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7502):   🔵  Acquired motionchange position, isMoving: true
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 13.451
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b] SingleLocationRequest 576 isFinished? true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
I/TSLocationManager( 7502): [c.t.l.data.sqlite.b persist]
I/TSLocationManager( 7502):   ✅  INSERT: f3ed563a-b28d-4024-bdfc-56b07b1681a4
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  LocationRequestService destroyed
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m16s804ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 113ms, time: 1652729332114
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -26.21
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.http.HttpService$i onResponse]
I/TSLocationManager( 7502):   🔵  Response: 200
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b destroyAll]
D/TSLocationManager( 7502):   ✅  DELETED: (1)
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 1 records
I/TSLocationManager( 7502): [c.t.l.http.HttpService a]
I/TSLocationManager( 7502):   🔵  HTTP POST batch (1)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m16s804ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 174ms, time: 1652729332114
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -26.21
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity execute] locationsettings
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: TERMINATE_EVENT
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity stop] eventCount: 0
I/TSLocationManager( 7502): [c.t.l.http.HttpService$i onResponse]
I/TSLocationManager( 7502):   🔵  Response: 200
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b destroyAll]
D/TSLocationManager( 7502):   ✅  DELETED: (1)
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 0 records
I/TSLocationManager( 7502): [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 152
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  BackgroundTaskService destroyed
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [headers, params]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ HTTP Service (count: 0)
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity onDestroy]
D/TSLocationManager( 7502): [c.t.locationmanager.util.c g]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): - Enable: true → true, trackingMode: 1
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
D/TSLocationManager( 7502): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring connectivity changes
D/TSLocationManager( 7502): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring powersave changes
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService onStartCommand] action: start
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
I/TSLocationManager( 7502): [c.t.l.service.HeartbeatService c]
I/TSLocationManager( 7502):   🔴  Stop heartbeat
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): [c.t.l.service.TrackingService a]
I/TSLocationManager( 7502):   🔵  setPace: true → true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.service.TrackingService h]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ TrackingService motionchange: true
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: STOP_TIMEOUT
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  LocationRequestService destroyed
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m17s285ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 49ms, time: 1652729332595
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity execute] locationsettings
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: TERMINATE_EVENT
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity stop] eventCount: 0
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity onDestroy]
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [headers, params]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ HTTP Service (count: 0)
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.locationmanager.util.c g]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): - Enable: true → true, trackingMode: 1
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
D/TSLocationManager( 7502): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring connectivity changes
D/TSLocationManager( 7502): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring powersave changes
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService onStartCommand] action: start
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
I/TSLocationManager( 7502): [c.t.l.service.HeartbeatService c]
I/TSLocationManager( 7502):   🔴  Stop heartbeat
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): [c.t.l.service.TrackingService a]
I/TSLocationManager( 7502):   🔵  setPace: true → true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m17s285ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 467ms, time: 1652729332595
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -26.21
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.service.TrackingService h]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ TrackingService motionchange: true
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: STOP_TIMEOUT
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  LocationRequestService destroyed
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity execute] locationsettings
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: TERMINATE_EVENT
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  LocationRequestService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity stop] eventCount: 0
I/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ motionchange LocationResult: 578
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654092,-112.044098 hAcc=13.018 et=+9d3h8m16s463ms alt=411.8999938964844 vAcc=1.0 vel=0.1082553 bear=2.0305643 {Bundle[EMPTY_PARCEL]}], age: 1511ms, time: 1652729331773
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7502):   🔵  Acquired motionchange position, isMoving: true
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b] SingleLocationRequest 578 isFinished? true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
I/TSLocationManager( 7502): [c.t.l.data.sqlite.b persist]
I/TSLocationManager( 7502):   ✅  INSERT: f572cb2a-248d-4d78-b90b-0dc46773b6e7
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  LocationRequestService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ HTTP Service (count: 1)
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ motionchange LocationResult: 580
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654092,-112.044098 hAcc=13.018 et=+9d3h8m16s463ms alt=411.8999938964844 vAcc=1.0 vel=0.1082553 bear=2.0305643 {Bundle[EMPTY_PARCEL]}], age: 1530ms, time: 1652729331773
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onSingleLocationResult]
I/TSLocationManager( 7502):   🔵  Acquired motionchange position, isMoving: true
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
I/TSLocationManager( 7502): [c.t.l.data.sqlite.b persist]
I/TSLocationManager( 7502):   ✅  INSERT: b3a96687-a1c2-4fd5-b26d-a74c33e65556
D/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b] SingleLocationRequest 580 isFinished? true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m17s285ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 770ms, time: 1652729332595
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  BackgroundTaskService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.u.BackgroundTaskManager onStartJob] ⏳ startBackgroundTask: 153
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654086,-112.044104 hAcc=13.105 et=+9d3h8m17s285ms alt=411.8999938964844 vAcc=1.0 vel=0.5794067 bear=229.34099 {Bundle[EMPTY_PARCEL]}], age: 827ms, time: 1652729332595
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -26.21
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654092,-112.044098 hAcc=13.018 et=+9d3h8m18s37ms alt=411.8999938964844 vAcc=1.0 vel=0.1082553 bear=2.0305643 {Bundle[EMPTY_PARCEL]}], age: 82ms, time: 1652729333347
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -25.263248
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 13.451
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 2 records
I/TSLocationManager( 7502): [c.t.l.http.HttpService a]
I/TSLocationManager( 7502):   🔵  HTTP POST batch (2)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654092,-112.044098 hAcc=13.018 et=+9d3h8m18s37ms alt=411.8999938964844 vAcc=1.0 vel=0.1082553 bear=2.0305643 {Bundle[EMPTY_PARCEL]}], age: 93ms, time: 1652729333347
I/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
I/TSLocationManager( 7502):   ℹ️  Distance from stoppedAtLocation: -25.263248
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.data.sqlite.b persist]
I/TSLocationManager( 7502):   ✅  INSERT: 27eccbe6-8c5a-4213-a388-aca8ebae7d3d
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
D/TSLocationManager( 7502): [c.t.l.a.TSLocationManagerActivity onDestroy]
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [headers, params]
I/TSLocationManager( 7502): [c.t.l.http.HttpService flush]
I/TSLocationManager( 7502):   ℹ️  HttpService is busy
D/TSLocationManager( 7502): [c.t.locationmanager.util.c g]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): - Enable: true → true, trackingMode: 1
I/TSLocationManager( 7502): [c.t.l.s.ActivityRecognitionService b]
I/TSLocationManager( 7502):   🎾  Start motion-activity updates
D/TSLocationManager( 7502): [c.t.l.http.HttpService startMonitoringConnectivityChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring connectivity changes
D/TSLocationManager( 7502): [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
D/TSLocationManager( 7502):   🎾  Start monitoring powersave changes
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService onStartCommand] action: start
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
I/TSLocationManager( 7502): [c.t.l.service.HeartbeatService c]
I/TSLocationManager( 7502):   🔴  Stop heartbeat
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager removeLocationUpdates]
I/TSLocationManager( 7502):   🔴  Location-services: OFF
I/TSLocationManager( 7502): [c.t.l.l.TSLocationManager requestLocationUpdates]
I/TSLocationManager( 7502):   🎾  Location-services: ON
D/TSLocationManager( 7502): [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -2
D/TSLocationManager( 7502): [c.t.locationmanager.util.c h]
D/TSLocationManager( 7502):   ℹ️  LocationAuthorization: Permission granted
I/TSLocationManager( 7502): [c.t.l.service.TrackingService a]
I/TSLocationManager( 7502):   🔵  setPace: true → true
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.service.TrackingService h]
I/TSLocationManager( 7502): ╔═════════════════════════════════════════════
I/TSLocationManager( 7502): ║ TrackingService motionchange: true
I/TSLocationManager( 7502): ╠═════════════════════════════════════════════
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager cancelOneShot]
I/TSLocationManager( 7502):   ⏰ Cancel OneShot: STOP_TIMEOUT
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
D/TSLocationManager( 7502): [c.t.l.service.AbstractService onDestroy]
D/TSLocationManager( 7502):   🔴  LocationRequestService destroyed
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  TrackingService [eventCount: 1]
D/TSLocationManager( 7502): [c.t.l.service.TrackingService b]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ TrackingService: LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): ╟─ 📍  Location[fused 33.654092,-112.044098 hAcc=13.018 et=+9d3h8m18s207ms alt=411.8999938964844 vAcc=1.0 vel=0.1082553 bear=2.0305643 {Bundle[EMPTY_PARCEL]}], age: 84ms, time: 1652729333516
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502): ╔═════════════════════════════════════════════
D/TSLocationManager( 7502): ║ Process LocationResult
D/TSLocationManager( 7502): ╠═════════════════════════════════════════════
D/TSLocationManager( 7502): [c.t.l.l.TSLocationManager onLocationResult]
D/TSLocationManager( 7502):   ℹ️  IGNORED: same as last location
I/TSLocationManager( 7502): [c.t.l.s.TSScheduleManager oneShot]
I/TSLocationManager( 7502):   ⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
I/TSLocationManager( 7502): [c.t.l.http.HttpService$i onResponse]
I/TSLocationManager( 7502):   🔵  Response: 200
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b destroyAll]
D/TSLocationManager( 7502):   ✅  DELETED: (2)
D/TSLocationManager( 7502): [c.t.l.data.sqlite.b allWithLocking]
D/TSLocationManager( 7502):   ✅  Locked 1 records
I/TSLocationManager( 7502): [c.t.l.http.HttpService a]
I/TSLocationManager( 7502):   🔵  HTTP POST batch (1)
D/TSLocationManager( 7502): [c.t.l.service.AbstractService a]
D/TSLocationManager( 7502):   🎾  LocationRequestService [eventCount: 1]
I/TSLocationManager( 7502): [c.t.l.s.LocationRequestService b]
</details>

haobole avatar May 16 '22 19:05 haobole

@christocracy

I found this didChangeAppLifecycleState are looping if start() then chagnePace(). I don't know why start() trigger AppLifecycleState.inactive then AppLifecycleState.resumed again?

void didChangeAppLifecycleState(AppLifecycleState state) async {
  if (state == AppLifecycleState.resumed) {
    await bg.BackgroundGeolocation.start();
    await bg.BackgroundGeolocation.changePace(true);
  } else if (state == AppLifecycleState.inactive) {    
    // app is inactive
  } else if (state == AppLifecycleState.paused) {
    // user is about quit our app temporally
  } else if (state == AppLifecycleState.detached) {
    // app suspended (not used in iOS)
  }
}

xinlangzi avatar May 25 '22 14:05 xinlangzi

It is due to a feature of Play Services FusedLocationProviderAPI. Before turning on location updates, the code can check the state of the device settings to ensure they are configured to allow location updates (eg: Location not disabled by user) and offer a helpful dialog offering to automatically adjust device settings to allow the location updates.

This feature requires that a hidden android Activity be shown in order to perform the request, which is what you are experiencing.

See API docs Config.disableLocationAuthorizationAlert (Android section).

christocracy avatar May 25 '22 14:05 christocracy

Try it yourself: After calling .stop() on the plugin, navigate to Device Settings and disable Location.

Switch back to your app and call .start().

christocracy avatar May 25 '22 14:05 christocracy

And why are you even doing this?

if (state == AppLifecycleState.resumed) {
    await bg.BackgroundGeolocation.start();
    await bg.BackgroundGeolocation.changePace(true);
  }

christocracy avatar May 25 '22 14:05 christocracy

@christocracy

I want to start the BG when the app is resumed. Does this make sense?

xinlangzi avatar May 25 '22 14:05 xinlangzi

I would check State.enabled first.

if (state == AppLifecycleState.resumed) {
    let state = await BackgroundGeolocation.getState();
    if (state.enabled) {
      // Already enabled:  Do nothing.
      return;
    }
    await bg.BackgroundGeolocation.start();
    await bg.BackgroundGeolocation.changePace(true);
  }

Or disableLocationAuthorizationAlert: true.

christocracy avatar May 25 '22 14:05 christocracy

It is due to a feature of Play Services FusedLocationProviderAPI. Before turning on location updates, the code can check the state of the device settings to ensure they are configured to allow location updates (eg: Location not disabled by user) and offer a helpful dialog offering to automatically adjust device settings to allow the location updates.

This feature requires that a hidden android Activity be shown in order to perform the request, which is what you are experiencing.

See API docs Config.disableLocationAuthorizationAlert (Android section).

Thank you, this hidden activity makes sense to me now. I will make change. Thank you again.

xinlangzi avatar May 25 '22 14:05 xinlangzi

  • Calling .start() -> State.enabled: true
  • Calling .stop() -> State.enabled: false

christocracy avatar May 25 '22 14:05 christocracy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] avatar Sep 21 '22 05:09 stale[bot]