Skip to content

Comments

Expose battery monitoring#504

Merged
frederoni merged 1 commit intomasterfrom
fred-battery-monitoring
Aug 17, 2017
Merged

Expose battery monitoring#504
frederoni merged 1 commit intomasterfrom
fred-battery-monitoring

Conversation

@frederoni
Copy link
Contributor

@frederoni frederoni commented Aug 16, 2017

This PR exposes isMonitoringBatteryState so a user can disable it and use their own desired accuracy.

@bsudekum @ericrwolfe 👀

@bsudekum
Copy link
Contributor

@frederoni where exactly can they disable it?

@frederoni
Copy link
Contributor Author

On the location manager before you start navigation

let locationManager = MyLocationManager()
locationManager.isMonitoringBatteryState = false

or reaching through the navigation and route controller

navigationViewController.routeController.locationManager.isMonitoringBatteryState = false

@bsudekum
Copy link
Contributor

I think we should rethink this. If the goal is to have control over the kCLLocationAccuracyBestForNavigation vs kCLLocationAccuracyBest, we should expose that. Battery monitoring should always be enabled for telemetry purposes.

@frederoni frederoni force-pushed the fred-battery-monitoring branch from 7e3291d to 966cd99 Compare August 17, 2017 13:33
@frederoni
Copy link
Contributor Author

Made a few changes here. We always observe the battery state but only update the desired accuracy when automaticallyUpdatesDesiredAccuracy is set to true.

However, the actual battery monitoring is something that the RouteController is responsible for.
This PR won't have any impact on telemetry or anything else by default.

@frederoni frederoni force-pushed the fred-battery-monitoring branch from 966cd99 to 515703f Compare August 17, 2017 13:41
Copy link
Contributor

@bsudekum bsudekum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks great.

@frederoni frederoni merged commit adeec03 into master Aug 17, 2017
@frederoni frederoni deleted the fred-battery-monitoring branch August 17, 2017 15:11
@ericrwolfe ericrwolfe modified the milestone: v0.7.0-3 Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants