summaryrefslogtreecommitdiff
path: root/platform/macos
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2017-12-27 12:01:39 -0800
committerJesse Bounds <jesse@rebounds.net>2018-01-04 10:38:52 -0800
commit9c9ad538f8f097f19837cdbe4865ced8ba19e81e (patch)
tree3f7aeea3a42028a69dff9c59387d86a8047147fe /platform/macos
parent760ef23ac3faf4437cadb52983383c9501336964 (diff)
downloadqtlocation-mapboxgl-9c9ad538f8f097f19837cdbe4865ced8ba19e81e.tar.gz
[ios] Dispatch location auth status check to background
This attempts to work around reports of repeated calls to [CLLocationManager authorizationStatus] blocking the main thread by dispatching it to the background, serial queue that is already available in MGLMapboxEvents. This also adds a guard to the handler for the user defaults change event so that the call to pause or resume if required is done only if a user defaults value changes that would require an update to the pause / resume state. The guard works by utilizing two new state variables that keep track of the previous values for account type and metrics enabled configuration variables. The call to pause/resume is only done if the latest relevant values in the user defaults dictionary are actually different than the previous ones. The default values for the new state variables assume an account value of 0 and metrics enabled == true so there can be a small inefficiency if a user prevously opted out of telemetry, kills the app, and restarts it. In that case, the pause/resume method would get invoked one time when it would not technically need to. This should not be an issue in practice though.
Diffstat (limited to 'platform/macos')
0 files changed, 0 insertions, 0 deletions