From b88a36a48c8a27539a1fbbb7bd40b3918dfda696 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 24 Jul 2017 17:57:07 +0300 Subject: [PATCH] [cherry] [MAPSME-5105] [ios] Fixed high cpu load in background. --- iphone/Maps/Core/Location/MWMLocationManager.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iphone/Maps/Core/Location/MWMLocationManager.mm b/iphone/Maps/Core/Location/MWMLocationManager.mm index 4292f71d89..4f30c3ac8c 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.mm +++ b/iphone/Maps/Core/Location/MWMLocationManager.mm @@ -215,7 +215,10 @@ void setPermissionRequested() + (void)applicationDidBecomeActive { if (isPermissionRequested() || ![Alohalytics isFirstSession]) + { [self start]; + [[self manager] updateFrameworkInfo]; + } } + (void)applicationWillResignActive @@ -538,8 +541,10 @@ void setPermissionRequested() - (void)updateFrameworkInfo { auto app = UIApplication.sharedApplication; + if (app.applicationState != UIApplicationStateActive) + return; auto delegate = static_cast(app.delegate); - if (delegate.isDrapeEngineCreated && app.applicationState == UIApplicationStateActive) + if (delegate.isDrapeEngineCreated) { auto & f = GetFramework(); if (self.frameworkUpdateMode & MWMLocationFrameworkUpdateLocation)