Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Grechuhin <i.grechuhin@gmail.com>2017-07-24 17:57:07 +0300
committerVladimir Byko-Ianko <bykoianko@gmail.com>2017-07-25 11:32:25 +0300
commit2eb4868f96fa86a19620e20edfecbc626ce0661f (patch)
treea09920a2f328b2764ad933dd607331f82b3a98a3
parentcb884f88b2a7c4228a18689a070a95424e664365 (diff)
[MAPSME-5105] [ios] Fixed high cpu load in background.
-rw-r--r--iphone/Maps/Core/Location/MWMLocationManager.mm7
1 files changed, 6 insertions, 1 deletions
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<MapsAppDelegate *>(app.delegate);
- if (delegate.isDrapeEngineCreated && app.applicationState == UIApplicationStateActive)
+ if (delegate.isDrapeEngineCreated)
{
auto & f = GetFramework();
if (self.frameworkUpdateMode & MWMLocationFrameworkUpdateLocation)