diff --git a/iphone/Maps/Classes/DownloadIndicatorProtocol.h b/iphone/Maps/Classes/DownloadIndicatorProtocol.h index e68cd2c255..80368db6c8 100644 --- a/iphone/Maps/Classes/DownloadIndicatorProtocol.h +++ b/iphone/Maps/Classes/DownloadIndicatorProtocol.h @@ -2,9 +2,6 @@ @protocol DownloadIndicatorProtocol -- (void)disableStandby; -- (void)enableStandby; - - (void)disableDownloadIndicator; - (void)enableDownloadIndicator; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index cad55988fe..4ad9df99be 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -206,13 +206,10 @@ extern NSString * const kAlohalyticsTapEventKey = @"$onClick"; - (void)onLocationStateModeChanged:(location::State::Mode)newMode { - [UIApplication sharedApplication].idleTimerDisabled = NO; - switch (newMode) { case location::State::UnknownPosition: { - [[MapsAppDelegate theApp] enableStandby]; [[MapsAppDelegate theApp].m_locationManager stop:self]; PlacePageView * placePage = self.containerView.placePage; @@ -224,15 +221,12 @@ extern NSString * const kAlohalyticsTapEventKey = @"$onClick"; break; } case location::State::PendingPosition: - [[MapsAppDelegate theApp] disableStandby]; [[MapsAppDelegate theApp].m_locationManager start:self]; [[NSNotificationCenter defaultCenter] postNotificationName:LOCATION_MANAGER_STARTED_NOTIFICATION object:nil]; break; case location::State::NotFollow: case location::State::Follow: - break; case location::State::RotateAndFollow: - [UIApplication sharedApplication].idleTimerDisabled = YES; break; } } @@ -910,7 +904,6 @@ extern NSString * const kAlohalyticsTapEventKey = @"$onClick"; - (void)routeViewDidStartFollowing:(RouteView *)routeView { - [UIApplication sharedApplication].idleTimerDisabled = YES; [routeView setState:RouteViewStateTurnInstructions animated:YES]; self.controlsManager.zoomHidden = NO; GetFramework().FollowRoute(); @@ -923,7 +916,6 @@ extern NSString * const kAlohalyticsTapEventKey = @"$onClick"; - (void)dismissRouting { - [UIApplication sharedApplication].idleTimerDisabled = NO; GetFramework().CloseRouting(); [self.controlsManager resetZoomButtonsVisibility]; [self.routeView setState:RouteViewStateHidden animated:YES]; diff --git a/iphone/Maps/Classes/MapsAppDelegate.h b/iphone/Maps/Classes/MapsAppDelegate.h index 8ea2dabaef..6c7bd76b48 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.h +++ b/iphone/Maps/Classes/MapsAppDelegate.h @@ -11,7 +11,6 @@ @interface MapsAppDelegate : NSObject { - NSInteger m_standbyCounter; NSInteger m_activeDownloadsCounter; UIBackgroundTaskIdentifier m_backgroundTask; NavigationController * m_navController; @@ -24,9 +23,6 @@ + (MapsAppDelegate *)theApp; -- (void)disableStandby; -- (void)enableStandby; - - (void)disableDownloadIndicator; - (void)enableDownloadIndicator; diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 129c1eb73d..2cc217cf50 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -205,6 +205,8 @@ void InitLocalizedStrings() [self shouldShowFacebookAlert]; } [[NSUserDefaults standardUserDefaults] synchronize]; + + application.idleTimerDisabled = YES; Framework & f = GetFramework(); application.applicationIconBadgeNumber = f.GetCountryTree().GetActiveMapLayout().GetOutOfDateCount(); @@ -304,22 +306,6 @@ void InitLocalizedStrings() DeleteFramework(); } -- (void)disableStandby -{ - ++m_standbyCounter; - [UIApplication sharedApplication].idleTimerDisabled = YES; -} - -- (void)enableStandby -{ - --m_standbyCounter; - if (m_standbyCounter <= 0) - { - [UIApplication sharedApplication].idleTimerDisabled = NO; - m_standbyCounter = 0; - } -} - - (void)disableDownloadIndicator { --m_activeDownloadsCounter;