diff --git a/iphone/Maps/Classes/LocalNotificationManager.mm b/iphone/Maps/Classes/LocalNotificationManager.mm index ee4e7838e0..faf4427267 100644 --- a/iphone/Maps/Classes/LocalNotificationManager.mm +++ b/iphone/Maps/Classes/LocalNotificationManager.mm @@ -95,10 +95,12 @@ using namespace storage; selector:@selector(timerSelector:) userInfo:nil repeats:NO]; + LOG(LINFO, ("startUpdatingLocation")); [self.locationManager startUpdatingLocation]; } else { + LOG(LINFO, ("stopUpdatingLocation")); [self.locationManager stopUpdatingLocation]; completionHandler(UIBackgroundFetchResultFailed); } @@ -129,6 +131,7 @@ using namespace storage; - (void)timerSelector:(id)sender { // Location still was not received but it's time to finish up so system will not kill us. + LOG(LINFO, ("stopUpdatingLocation")); [self.locationManager stopUpdatingLocation]; [self performCompletionHandler:UIBackgroundFetchResultFailed]; } @@ -158,6 +161,7 @@ using namespace storage; didUpdateLocations:(NSArray *)locations { [self.timer invalidate]; + LOG(LINFO, ("stopUpdatingLocation")); [self.locationManager stopUpdatingLocation]; NSString * flurryEventName = @"'Download Map' Notification Didn't Schedule"; UIBackgroundFetchResult result = UIBackgroundFetchResultNoData; diff --git a/iphone/Maps/Platform/LocationManager.mm b/iphone/Maps/Platform/LocationManager.mm index 69be8bbab0..344d745204 100644 --- a/iphone/Maps/Platform/LocationManager.mm +++ b/iphone/Maps/Platform/LocationManager.mm @@ -109,13 +109,17 @@ map const kGeoSettings{ - (void)onDaemonMode { [self.locationManager stopMonitoringSignificantLocationChanges]; + LOG(LINFO, ("startUpdatingLocation")); [self.locationManager startUpdatingLocation]; } - (void)onBackground { if (!GpsTracker::Instance().IsEnabled()) + { + LOG(LINFO, ("stopUpdatingLocation")); [self.locationManager stopUpdatingLocation]; + } } - (void)beforeTerminate @@ -148,6 +152,7 @@ map const kGeoSettings{ case kCLAuthorizationStatusNotDetermined: if (kRequestAuthStatus == kCLAuthorizationStatusAuthorizedAlways && [self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) [self.locationManager requestAlwaysAuthorization]; + LOG(LINFO, ("startUpdatingLocation")); [self.locationManager startUpdatingLocation]; if ([CLLocationManager headingAvailable]) [self.locationManager startUpdatingHeading]; @@ -185,6 +190,7 @@ map const kGeoSettings{ self.isStarted = NO; if ([CLLocationManager headingAvailable]) [self.locationManager stopUpdatingHeading]; + LOG(LINFO, ("stopUpdatingLocation")); [self.locationManager stopUpdatingLocation]; } }