Merge branch 'release-ios-v3.3.5' into master

This commit is contained in:
Jason Wray
2016-11-02 16:15:19 -04:00
2 changed files with 29 additions and 5 deletions

View File

@@ -72,6 +72,13 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* MGLMapDebugOverdrawVisualizationMask no longer has any effect in Release builds of the SDK. This debug mask has been disabled for performance reasons. ([#5555](https://github.com/mapbox/mapbox-gl-native/pull/5555))
* Fixed a typo in the documentation for the MGLCompassDirectionFormatter class. ([#5879](https://github.com/mapbox/mapbox-gl-native/pull/5879))
## 3.3.5 - November 2, 2016
* Speculatively fixed an OpenGL rendering crash. ([#6844](https://github.com/mapbox/mapbox-gl-native/pull/6844))
* Fixed an issue with symbols not being properly stripped from the dynamic framework. The dSYM file included with the standard dynamic framework in previous releases (e.g., `mapbox-ios-sdk-3.3.4-dynamic.zip` or the `Mapbox-iOS-SDK` pod) could not be used to symbolicate crashes. ([#6531](https://github.com/mapbox/mapbox-gl-native/pull/6531))
* Include simulator architecture slices in the dSYM file that is generated for release builds. ([#5740](https://github.com/mapbox/mapbox-gl-native/pull/5740))
* Fixed a rare networking-related crash. ([#5932](https://github.com/mapbox/mapbox-gl-native/pull/5932))
## 3.3.4 - August 8, 2016
* Fixed an issue that caused the user dot to be selected when tapping an annotation that lies within the user dot’s accuracy circle. First attempt was [#5816](https://github.com/mapbox/mapbox-gl-native/pull/5816) in v3.3.2, which excluded the pulsing halo but not the accuracy circle. ([#5894](https://github.com/mapbox/mapbox-gl-native/pull/5894))

View File

@@ -129,6 +129,7 @@ const NSTimeInterval MGLFlushInterval = 180;
@implementation MGLMapboxEvents {
NSString *_instanceID;
UIBackgroundTaskIdentifier _backgroundTaskIdentifier;
}
+ (void)initialize {
@@ -257,9 +258,20 @@ const NSTimeInterval MGLFlushInterval = 180;
}
- (void)pauseOrResumeMetricsCollectionIfRequired {
UIApplication *application = [UIApplication sharedApplication];
// Prevent blue status bar when host app has `when in use` permission only and it is not in foreground
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse &&
[UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
application.applicationState == UIApplicationStateBackground) {
if (_backgroundTaskIdentifier == UIBackgroundTaskInvalid) {
_backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{
[application endBackgroundTask:_backgroundTaskIdentifier];
_backgroundTaskIdentifier = UIBackgroundTaskInvalid;
}];
[self flush];
}
[self pauseMetricsCollection];
return;
}
@@ -307,7 +319,10 @@ const NSTimeInterval MGLFlushInterval = 180;
return;
}
if ([self.eventQueue count] == 0) {
if ([self.eventQueue count] <= 1) {
[self.eventQueue removeAllObjects];
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
_backgroundTaskIdentifier = UIBackgroundTaskInvalid;
return;
}
@@ -485,10 +500,12 @@ const NSTimeInterval MGLFlushInterval = 180;
if (error) {
[strongSelf pushDebugEvent:MGLEventTypeLocalDebug withAttributes:@{MGLEventKeyLocalDebugDescription: @"Network error",
@"error": error}];
return;
} else {
[strongSelf pushDebugEvent:MGLEventTypeLocalDebug withAttributes:@{MGLEventKeyLocalDebugDescription: @"post",
@"debug.eventsCount": @(events.count)}];
}
[strongSelf pushDebugEvent:MGLEventTypeLocalDebug withAttributes:@{MGLEventKeyLocalDebugDescription: @"post",
@"debug.eventsCount": @(events.count)}];
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
_backgroundTaskIdentifier = UIBackgroundTaskInvalid;
}];
});
}